[SR-Users] registered("location") not working

Skyler skchopperguy at gmail.com
Tue Aug 30 01:28:08 CEST 2011


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;
	}




More information about the sr-users mailing list