Patches item #3397848, was opened at 2011-08-25 14:01 Message generated for change (Tracker Item Submitted) made by mayamatakeshi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=3397848&group_id=232389
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: modules Group: 1.6.x Status: Open Resolution: None Priority: 5 Private: No Submitted By: takeshi (mayamatakeshi) Assigned to: Nobody/Anonymous (nobody) Summary: New function registered_from in module registrar Initial Comment: I have a requirement to only accept requests from UAs that are currently registered. And the ip:port from the request must be the same that was used in the registration (received_avp). So I have written a function registered_from (based on function registered) that will receive parameters location, AOR and URI-received (all required), and will return true if: - string received="scheme:ip:port" is found inside ucontact->path or - ucontact->received equals URI-received Examples of use: $var(received) = "sip:" + $si + ":" + $sp; if(!registered_from("location", "$fu", "$var(received)")) { sl_send_reply("404", "Request not from registered UA"); exit; } if(!registered_from("location", "$fu", "$hdr(User-Received)")) { sl_send_reply("404", "Request not from registered UA"); exit; } I have generated the patch from branch 1.6 which is the one I am currently using but I can regenerate it from trunk if necessary regards, Takeshi ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=3397848&group_id=232389 _______________________________________________ Devel mailing list Devel@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/devel