[sr-dev] avp and topoh questions

Paul Claudiu Boriga paul.boriga at 1and1.ro
Thu Mar 23 14:49:54 CET 2017


Hello all,

My name is Claudiu and I am a new developer in the 1&1 team, also new to 
SIP and Kamailio.

I am having some issues trying to change the way topoh module works, 
could you help me with some avp and topoh related issues?

The idea is to modify how the topoh module works by introducing a per 
message/transaction parameter to mark which messages/transactions should 
be hidden. I am using an avp parameter, which I define in the config 
like this: "modparam("topoh","hide_avp", "$avp(hide)")"
and later use as this "$avp(hide)=1;". I intend to modify the 
th_msg_sent and th_msg_received, to read the value of the avp, using 
"search_first_avp" function, and only mask the headears if the avp is set.
These functions are registered as callbacks for the SREV_NET_DATA_IN and 
SREV_NET_DATA_OUT events:
     sr_event_register_cb(SREV_NET_DATA_IN, th_msg_received);
     sr_event_register_cb(SREV_NET_DATA_OUT, th_msg_sent);
I encountered the following issues:
- apparently the avp is never seen as being set in the th_msg_received 
function, even though if I print in from the config with xlog, it 
appears to be set.
- for some messages (180 ringing, and 200 ok), the avp is not seen as 
set in the th_msg_sent, but is seen on other requests (invite,bye) and 
replies (100 trying) messages. If I print it with xlog form config, on 
the onreply_route is appears set.

Is the function th_msg_received always called before avps are seen in 
the code?
Any idea why for the 180 and 200 messages the avp is not seen in the 
code inside th_msg_sent function?

Thanks and regards,
Claudiu Boriga




More information about the sr-dev mailing list