#189 New function registered_from in module registrar

1.6.x
open
modules (179)
3
2012-03-21
2011-08-25
takeshi
No

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

Discussion

  • Vladut-Stefan Paiu

    • priority: 5 --> 7
    • assigned_to: nobody --> vladut-paiu
     
  • Vladut-Stefan Paiu

    • priority: 7 --> 3
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks