[OpenSIPS-Users] Dynamic routing .

Bogdan-Andrei Iancu bogdan at opensips.org
Tue May 3 17:47:40 CEST 2016


To eliminate both scripting error and provisioning error, just place an 
xlog() before that "if (is_from_gw() )" to print the source ip of the 
call (use $si) - in this case you will be sure your script get there and 
the IP is correct.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 03.05.2016 16:04, Sasmita Panda wrote:
> Thank you so much for your reply . I had solved my problem earlier .
>
>       But now I am facing a strange problem . I am trying to implement 
> the dynamic routing login in a machine which has two interface , one 
> public and one private .
>
> I have added listen as : listen=10.138.x.x:5508 AS 54.167.x.x:5508
>     First ip is the private ip and the second one is the public ip .
>
>      Now I have added a gateway in dr_gateways like bellow
>
> |  4 | 4    |    4 | 162.241.x.x:5080  |     0 | NULL | NULL  |       
>    0 |     0 | NULL   | inbound 1   |
>
>       And my opensips config is like bellow .
>
>     if (is_from_gw() )
>                         {
>                          xlog( "L_WARN", "from gateway do look up" );
>
>                             xlog( "L_WARN", "Source IP : $si To Uri : 
> $tu From : $fU Request URI: $oU Call ID:$ci" );
>                  #           alias_db_lookup("dbaliases");
>                             if ( !lookup("location")){
> sl_send_reply("404","NO Match Found");
>                             xlog( "L_WARN", "Source IP : $si To Uri : 
> $tu From : $fU Request URI: $oU Call ID:$ci: NO Match Found" );
>                                         exit;
>                             }
>                             #do lcr
>                             if ( !serialize_branches(1)){
>                                 t_on_failure("redirect");
>                             }else{
>                                     next_branches();
>                                     t_on_failure("3");
>                             route(1);
>                                 exit;
>                              }
>                         }
>
> But when I am dialing from the gateway IP , the call is not going 
> through this loop its directly going to the routing logic .
>
>   I am getting bellow error .
>
> * request domain,54.167.x.x*
> * WARNING:core:do_assign: no value in right expression on line 354*
> * translated to  <null>*
> * ERROR:drouting:do_routing: failed to get group id*
> * do_routing: No rules matching the URI*
>          The strange thing is . I have done the same setup in anothe 
> rmachine which has one public interface . And the logic is running 
> absolutely fine .
>
>           I am not getting where I am doing wrong in the case . I 
> think its not able to recognize the incoming gateway ip . What else I 
> should do to make this working .
>
>         Please help me . I have almost spent my entire day to resolve 
> this but still I am not able to fix this .
>
> */Thanks & Regards/*
> /Sasmita Panda/
> /Network Testing and Software Engineer/
> /3CLogic , ph:07827611765/
>
> On Tue, May 3, 2016 at 5:51 PM, Bogdan-Andrei Iancu 
> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>
>     Hi Sasmita,
>
>     Take a look at the carrier flags definition (1.1.4.2):
>     http://www.opensips.org/html/docs/modules/2.1.x/drouting.html#id293400
>
>     flags : 0x1 - use weight for sorting the list and not definition
>     order; 0x2 - use only the first gateway from the carrier
>     (depending on the sorting); 0x4 - disable the usage of this carrier
>
>     So, you need to have the flag 0x1 to do weight based selection
>     inside the carrier.
>
>     Best regards,
>
>     Bogdan-Andrei Iancu
>     OpenSIPS Founder and Developer
>     http://www.opensips-solutions.com
>
>     On 03.05.2016 10:57, Sasmita Panda wrote:
>>     Hi All ,
>>
>>          I am using opensips-1.11 and seting up the dynamic routing .
>>     I wanted to randomly distribute the call between two gateways .
>>              When I have added two gateways with weight 50% each in
>>     the dr_carriers table  and  set flags=2 , it didnt worked .
>>
>>          But when i just changed the flags=3 , it started working ,
>>     calls get distributed randomly between two gateways .
>>
>>         Is there any dependency of the call distribution with the
>>     flags parameter   of dr_carriers table ?
>>
>>     */Thanks & Regards/*
>>     /Sasmita Panda/
>>     /Network Testing and Software Engineer/
>>     /3CLogic , ph:07827611765/
>>
>>
>>     _______________________________________________
>>     Users mailing list
>>     Users at lists.opensips.org <mailto: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/20160503/94413f49/attachment-0001.htm>


More information about the Users mailing list