[ opensips-Patches-2713792 ] New method in alias_db - alias_db_find

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ opensips-Patches-2713792 ] New method in alias_db - alias_db_find

SourceForge.net
Patches item #2713792, was opened at 2009-03-26 09:44
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2713792&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: trunk
>Status: Closed
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Vladimir Romanov (v-romanov)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: New method in alias_db - alias_db_find

Initial Comment:
I implement new  method in alias_db module – alias_db_find(“tablename”,”avp”). This method  similar to alias_db_lookup but use avp as instead of message RURI. Also some refactoring to remove repeated code.
I use this this new method in in this case:

if (uri==myself) {
        if (is_method("REGISTER")) {
            sl_send_reply("100", "Trying");
            $avp(s:alias):=$tu;
            if (alias_db_find("dbaliases","$avp(s:alias)")) {
                xlog("L_INFO", "Registration was aliased - $tu -> $avp(s:alias)\n");
            }

            if (!www_authorize("_SIP_DOMAIN", "subscriber")) {
                  www_challenge("_SIP_DOMAIN", "0");
                  return;
            };
            if (!check_to()) {
                 xlog("L_INFO", "Spoofed To-URI detected - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
                 sl_send_reply("403", "Spoofed To-URI Detected");
                 exit;
            };
            if (!save("location","0","$avp(s:alias)"))  {
                xlog("L_ERR", "Saving contact failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
                sl_reply_error();
            }
            exit;
        };



----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-05-05 12:52

Message:
Patched applied on trunk (opensips 1.6 version)

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2713792&group_id=232389

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel