Thanks again Daniel
I've been reading deeply the module info and learning a lot. Your easy solution worked thou, using the subst_hf function instead of the normal subst the alias is added correctly and then the following bye is also correctly handled. The final line I use is: subst_hf("Contact", "/>.*$/>/", "a"); Thanks again for this great user mailing list! And for the kamailio itself BR, Helena From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] Sent: viernes, 30 de agosto de 2013 9:48 To: Helena Garcia-Nieto; 'Kamailio (SER) - Users Mailing List' Subject: Re: [SR-Users] Server silently droping Bye message. Hello, On 8/29/13 5:24 PM, Helena Garcia-Nieto wrote: Thanks! Thank you very very much for your help. I'll add the ngrep next time! I'm absolutely new at kamailio and I'm doing the Subs on the main config file (/usr/local/etc/kamailio/kamailio.cfg) on the PSTN call detection route[PSTN] {: if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$")) return; # only local users allowed to call if(from_uri!=myself) { sl_send_reply("403", "Not Allowed"); exit; } if (strempty($sel(cfg_get.pstn.gw_port))) { $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip); } else { $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":" + $sel(cfg_get.pstn.gw_port); } # modifications to acces env5 subst_uri('/^sip:00(.*)/sip:\1/i'); #append delete the 00 subst('/^Contact: (.*)>.*$/Contact: \1>/i');#delete the parameter that is anoying env5 on contact header And I cannot find the msg_apply_changes(); part on that file, can you tell me where I can better do the subs, in which file? msg_apply_changes() is not used in default config file, you have to add it yourself -- it is part of textopsx module which is loaded in default config file -- see its readme for more details. I'm not actually moving the > just droping everything after it. Better said, you remove the contact header and then add only the part up to >, but the operations done inside are a bit different than people would might expect, by using data lumps (if you search in mailing list archive you can find more details). I'm sure there is a better option to change the contact header, would you have any suggestion? You can give a try with: subst_hf("Contact", ">.*$", ">"); but might result in same troubles, because alias parameter is added after this operation. So you have to use msg_apply_changes(). But don't forget to move the record_route() after msg_apply_changes(). Cheers, Daniel -- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013 - more details about Kamailio trainings at http://www.asipto.com -
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users