Hi Vladimir. It looks useful; please submit a patch on tracker, so that developers can review it.
Thanks and regards. Sergio 2009/3/25 Romanov Vladimir <[email protected]> > Hi! > > 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. > > 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; > > }; > > > > This method implementationin main part is copypaste from alias_db_lookup. > Is this interesting to OpenSips users? > > ----------------- > > Vladimir Romanov > > Scartel Star Lab > > CTO > > +7 (960) 239-0853 > > > > _______________________________________________ > Users mailing list > [email protected] > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > -- Sergio Gutiérrez
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
