Hi!
I’m trying to use replace function, but got strange results. Idea - modify Contact header
What I got as start packet. (202 Accepted on onreply_route) … Contact: sip:*97@10.0.20.81:5060 … I give a command
replace("Contact: <.*>», "Contact: <" + $fu + ">"); $fu = sip:11@master.rufan.at
And, as a result I got
Contact: sip:11@master.rufan.atsip:*97@10.0.20.81:5060
Why it’s adding old Contact part at the end? What can cause this? On onreply_route I have only this command. Thanks!
Igor,
It might be simpler to do this:
remove_hf("Contact") append_hf("Contact: <$fu>\r\n");
-- Alex
Also tried to do this.
Got as result … CSeq: 58923 SUBSCRIBE Contact: sip:11@master.rufan.at sip:*97@10.0.20.81:5060Expires: 80 …
2016-09-26 3:52 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
Igor,
It might be simpler to do this:
remove_hf("Contact") append_hf("Contact: <$fu>\r\n");
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.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
You have another function that is changing the contact header (like fix_nated_contact() or add_contact_alias()). If you want to keep both, then you have to use msg_apply_changes() after the first one that changes the contact.
Cheers, Daniel
On 26/09/16 08:53, Igor Olhovskiy wrote:
Also tried to do this.
Got as result … CSeq: 58923 SUBSCRIBE Contact: <sip:11@master.rufan.at mailto:sip%3A11@master.rufan.at> sip:*97@10.0.20.81:5060 http://97@10.0.20.81:5060/Expires: 80 …
2016-09-26 3:52 GMT+03:00 Alex Balashov <abalashov@evaristesys.com mailto:abalashov@evaristesys.com>:
Igor, It might be simpler to do this: remove_hf("Contact") append_hf("Contact: <$fu>\r\n"); -- Alex -- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States Tel: +1-800-250-5920 <tel:%2B1-800-250-5920> (toll-free) / +1-678-954-0671 <tel:%2B1-678-954-0671> (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/ _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users <http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users>
-- Best regards, Igor
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
Thanks, that is definitely what I need :)
понедельник, 26 сентября 2016 г. пользователь Daniel-Constantin Mierla написал:
You have another function that is changing the contact header (like fix_nated_contact() or add_contact_alias()). If you want to keep both, then you have to use msg_apply_changes() after the first one that changes the contact. Cheers, Daniel
On 26/09/16 08:53, Igor Olhovskiy wrote:
Also tried to do this.
Got as result … CSeq: 58923 SUBSCRIBE Contact: sip:11@master.rufan.at sip:*97@10.0.20.81:5060Expires: 80 …
2016-09-26 3:52 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
Igor,
It might be simpler to do this:
remove_hf("Contact") append_hf("Contact: <$fu>\r\n");
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.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
-- Best regards, Igor
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Oct 24-26, 2016 - http://www.asipto.com