Hi all,
I am attempting to only reply to NOTIFY when the request is originating from a user/device that is authenticated on kamailio already. There are 2 ways I've tried (below) but neither will work.
Any idea on what I am doing wrong or suggestions on how to do it right?
TIA, Skyler
if(is_method("NOTIFY") && is_registered("location")) { route(ROUTE_NOTIFY); }
OR ....
if(is_method("NOTIFY")) { # We only reply OK if coming from authenticated users or trusted peers if(!registered("location") || !from_any_gw("$avp(s:ip)")) { sl_send_reply("503", "Service Unavailable"); exit; }
xlog("L_INFO", "Friendly Peer Poke - M=$rm F=$fu R=$ru\n"); sl_send_reply("200", "OK"); exit; }
On 08/29/2011 07:28 PM, Skyler wrote:
Hi all,
I am attempting to only reply to NOTIFY when the request is originating from a user/device that is authenticated on kamailio already. There are 2 ways I've tried (below) but neither will work.
Any idea on what I am doing wrong or suggestions on how to do it right?
Are you certain that the target Request URI of the NOTIFY message is equivalent to the registered AOR, including both the user part and domain part of the URI?
It sounds like there might be a mismatch. For instance, if the registered AOR were 'sip:skyler@chopperguy.com' but the request line of the NOTIFY message said 'sip:skyler@1.2.3.4:5060', registered() wouldn't match.
Cheers,
-- Alex
Hi,
On Mon, 2011-08-29 at 19:32 -0400, Alex Balashov wrote:
It sounds like there might be a mismatch. For instance, if the registered AOR were 'sip:skyler@chopperguy.com' but the request line of the NOTIFY message said 'sip:skyler@1.2.3.4:5060', registered() wouldn't match.
Cheers,
-- Alex
That makes sense, though I'm not 100% certain which line is the AOR/request so I can check and determine the next course of action in the script. Could you point it out for me?
U 2011/08/28 09:52:43.214993 DEVICE_IP:1025 -> KAMAILIO_IP:5060 NOTIFY sip:skchopperguy.com SIP/2.0. Via: SIP/2.0/UDP DEVICE_IP:1025;branch=z9hG4bK-c3d932e1. From: "Test PAP2T" sip:14188881212@skchopperguy.com;tag=1ccb3c0d81a127co0. To: sip:skchopperguy.com. Call-ID: c66e93d0-d39b31ac@192.168.1.147. CSeq: 46 NOTIFY. Max-Forwards: 70. Event: keep-alive. User-Agent: Linksys/PAP2T-5.1.6(LS). Content-Length: 0.
Sorry, that was a stupid question. My question should be, how do I rewrite $fu so that registered can look it up successfully?
ie: strip sip: from $fu first?
On Mon, 2011-08-29 at 16:53 -0700, Skyler wrote:
Hi,
On Mon, 2011-08-29 at 19:32 -0400, Alex Balashov wrote:
It sounds like there might be a mismatch. For instance, if the registered AOR were 'sip:skyler@chopperguy.com' but the request line of the NOTIFY message said 'sip:skyler@1.2.3.4:5060', registered() wouldn't match.
Cheers,
-- Alex
That makes sense, though I'm not 100% certain which line is the AOR/request so I can check and determine the next course of action in the script. Could you point it out for me?
U 2011/08/28 09:52:43.214993 DEVICE_IP:1025 -> KAMAILIO_IP:5060 NOTIFY sip:skchopperguy.com SIP/2.0. Via: SIP/2.0/UDP DEVICE_IP:1025;branch=z9hG4bK-c3d932e1. From: "Test PAP2T" sip:14188881212@skchopperguy.com;tag=1ccb3c0d81a127co0. To: sip:skchopperguy.com. Call-ID: c66e93d0-d39b31ac@192.168.1.147. CSeq: 46 NOTIFY. Max-Forwards: 70. Event: keep-alive. User-Agent: Linksys/PAP2T-5.1.6(LS). Content-Length: 0.