[OpenSIPS-Users] About L4 Swtich + 2 * opensips

Ali Pey alipey at gmail.com
Thu Jul 12 15:26:00 CEST 2012


Hello Nick,

You need to find out what has failed. I suggest you try these steps:

1- Register from both clients. Then query the location table in the DB to
make sure they both are registered. Something like this: select * from
location;

2- If they both are not registered, then you need to look at the opensips
log either in /var/log/messages or /var/log/opensips.log based on how you
have the logging setup. Make sure you have the logging enabled though. Set
debug=6 in your opensips.cfg file.

3- If they both are registered, make a call and then look at the opensips
logs. In the logs you should be able to see at what point it failed and
what the reason was. I also recommend to add your own xlog messages in your
script (opensips.cfg) to have a better handle on the message flow.

Are your clients registering over UDP or TCP? This setup would only work
with UDP.

Regards,
Ali Pey


On Thu, Jul 12, 2012 at 4:43 AM, Nick Chang <nick.chang at kland.com.tw> wrote:

> Hello Ali****
>
> ** **
>
> ** **
>
> I try save location after register.****
>
> Please saw this config. ****
>
> ** **
>
> But, It still failed.****
>
> Can you give me a suggest??****
>
> ** **
>
> Thanks for your help.****
>
> Nick****
>
> ** **
>
>         if (is_method("REGISTER")) {****
>
>                 if (!www_authorize("", "subscriber")) {****
>
>                         www_challenge("", "0");****
>
> save(“location”);****
>
>                         exit;****
>
>                 }****
>
>                 if (!db_check_to()) {****
>
>                         send_reply("403","Forbidden auth ID");****
>
>                         exit;****
>
>                 }****
>
>                 if (isflagset(5)) {****
>
>                         setbflag(6);****
>
>                         setbflag(7);****
>
>                 };****
>
>                 if (!save("location"))****
>
>                         sl_reply_error();****
>
>                 exit;****
>
>         }****
>
>         if ($rU==NULL) {****
>
>                 send_reply("484","Address Incomplete");****
>
>                 exit;****
>
>         }****
>
>         alias_db_lookup("dbaliases");****
>
>         if(!dp_translate("0","$ruri.user/$ruri.user")){****
>
>                 send_reply("420", "Invalid Destination");****
>
>                 exit;****
>
>         }****
>
>         xlog("$avp(dest)");****
>
>         $avp(callee) = $ru;****
>
>         if ($avp(dest)=="usrloc") {****
>
>                 #Route to usrloc****
>
>                 route(user_location);****
>
>         }****
>
>         send_reply("420", "Invalid Extension");****
>
>         exit;****
>
> }****
>
> route[generic_relay] {****
>
>         if (subst_uri('/((sip:.*)||(sip:.*:.*));nat=yes/\1/')){****
>
>                 setbflag(6);****
>
>         };****
>
>         if (isflagset(5)||isbflagset(6)) {****
>
>                 route(nat_fixups);****
>
>         };****
>
>         if (!t_relay()) {****
>
>                 sl_reply_error();****
>
>         };****
>
>         exit;****
>
> }****
>
> route[user_location]{****
>
>         if (!lookup("location", "m")) {****
>
>                 switch ($retcode) {****
>
>                         case -1:****
>
>                         case -3:****
>
>                                 t_newtran();****
>
>                                 send_reply("404", "Not Found");****
>
>                                 exit;****
>
>                         case -2:****
>
>                                 send_reply("405", "Method Not Allowed");**
> **
>
>                                 exit;****
>
>                 }****
>
>         }****
>
>         setflag(2); ****
>
>         t_on_failure("user_failure");****
>
>         route(generic_relay);****
>
> }****
>
> }****
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120712/91c5745e/attachment-0001.htm>


More information about the Users mailing list