Hello Does anyone succeed in having openwengo SIP pings working with openser I've added the options module and the fonction below but openser isn't answering.
loadmodule "options.so"
......
if (uri==myself) { if ((method==OPTIONS) || ( uri=~"sip:ping[@]+.*")) { options_reply(); }; };
Thanks
Marc
Session Initiation Protocol Status-Line: SIP/2.0 404 Not Found Status-Code: 404 [Resent Packet: False] Message Header Via: SIP/2.0/UDP 192.168.95.109:5060;rport=5060;branch=z9hG4bK1170921213 From: sip.wifirst.fr sip:test@192.168.95.248;tag=62904156 To: sip:ping@192.168.95.248;tag=e9b225e6b81dc6124ee6640a10a59bf1.f647 Call-ID: 668195568@192.168.95.109 CSeq: 20 OPTIONS Sequence Number: 20 Method: OPTIONS Server: OpenSER (1.2.1-notls (i386/linux)) Content-Length: 0
if ( isflagset(4) && (!(uri=~"sip:.*@.*") || (uri=~"sip:ping@")) ) { #OPTIONS request for us xlog("L_INFO","$ci OPTIONS for me :-) --> options_reply\n"); if (!options_reply()) { sl_send_reply("200","keep alive"); } exit; }
flag(4) is set when is_uri_host_local()==TRUE
regards klaus
Marc LEURENT wrote:
Hello Does anyone succeed in having openwengo SIP pings working with openser I've added the options module and the fonction below but openser isn't answering.
loadmodule "options.so"
......
if (uri==myself) { if ((method==OPTIONS) || ( uri=~"sip:ping[@]+.*")) { options_reply(); }; };
Thanks
Marc
Session Initiation Protocol Status-Line: SIP/2.0 404 Not Found Status-Code: 404 [Resent Packet: False] Message Header Via: SIP/2.0/UDP 192.168.95.109:5060;rport=5060;branch=z9hG4bK1170921213 From: sip.wifirst.fr sip:test@192.168.95.248;tag=62904156 To: sip:ping@192.168.95.248;tag=e9b225e6b81dc6124ee6640a10a59bf1.f647 Call-ID: 668195568@192.168.95.109 CSeq: 20 OPTIONS Sequence Number: 20 Method: OPTIONS Server: OpenSER (1.2.1-notls (i386/linux)) Content-Length: 0
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
El Monday 16 July 2007 17:16:04 Marc LEURENT escribió:
Hello Does anyone succeed in having openwengo SIP pings working with openser I've added the options module and the fonction below but openser isn't answering.
loadmodule "options.so"
......
if (uri==myself) { if ((method==OPTIONS) || ( uri=~"sip:ping[@]+.*")) { options_reply(); }; };
that will not work since "options_reply()" needs a URI with NO username, so if you receive "ping@domain.org" then "options_reply()" will say you:
options_reply(): ruri contains username
If you want to response with a 200 OK to OPTIONS to ping@domain.org you need to rewrite the URI and take off the username:
if (uri==myself) { if ((method==OPTIONS) || ( uri=~"sip:ping[@]+.*")) { rewriteuri("sip:domain.org"); options_reply(); }; };
NOTE: This will not work in 1.2.1 version since a bug I reported few days ago, but it has a some dirty solution:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1753368...
PD: You should too accept OPTIONS to a username empty URI as openser.domain.org, because that is exactly the "common" and expected behaviour. Maybe something as:
if ((method==OPTIONS) || (( uri=~"sip:ping[@]+.*") || (uri==~"sip:domain.org"))) { ...
Regards.
PPD: Because I see you taking care about OPTIONS to ping@domain.org, maybe you are using wengophone?