[OpenSIPS-Users] dynamic routing -prefixing on inbound

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Jul 22 10:58:49 CEST 2009


Hi Julian,

What you need to do is to create some rules to detect some IPs and to 
return the prefix to add to RURI. So, see the 1.4.1.2. String 
translation (regexp detection, replacement) in 
http://www.opensips.org/html/docs/modules/1.5.x/dialplan.html#id227206.

With the prefix returned in a variables (let;s say $var(prefix) ), do :
       $rU  =  $var(prefix) + $rU ;

Regards,
Bogdan

Julien Chavanton wrote:
> Do you have a suggestion on how to do this more dynamicaly ?
>  
>
> ------------------------------------------------------------------------
> *From:* Brett Nemeroff [mailto:brett at nemeroff.com]
> *Sent:* Tue 21/07/2009 3:12 PM
> *To:* Julien Chavanton
> *Cc:* Bogdan-Andrei Iancu; users at lists.opensips.org
> *Subject:* Re: [OpenSIPS-Users] dynamic routing -prefixing on inbound
>
> Once again.. another good use for the dialplan module. :)
>
> You really don't want to do this with a static subst I don't think.. 
> -Brett
>
>
> On Tue, Jul 21, 2009 at 8:30 AM, Julien Chavanton <jc at atlastelecom.com 
> <mailto:jc at atlastelecom.com>> wrote:
>
>     Thank you, we will move to 1.6.0 later.
>      
>     We have partner not sending tech prefix, we need to add it
>     ourselves, I found this fix, but I wanted to be able to do
>     everything from OpenSip control panel to keep things manageable.
>      
>      do_routing("0");
>      # happend prefix to keep track of originating trunk/gateway
>     (1.1.1.1==1111#)
>      if ( search("From:.*<sip:.*@1.1.1.1 <http://1.1.1.1/>>") ) {
>        xlog("L_NOTICE", "*****************call
>     from[1.1.1.1]*****************\n");
>        subst_uri('/^sip:([0-9]+)@(.*)$/sip:1111#\1@\2;/i');
>      };
>
>     ------------------------------------------------------------------------
>     *From:* Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro
>     <mailto:bogdan at voice-system.ro>]
>     *Sent:* Tue 21/07/2009 11:06 AM
>     *To:* Julien Chavanton
>     *Cc:* users at lists.opensips.org <mailto:users at lists.opensips.org>
>     *Subject:* Re: [OpenSIPS-Users] dynamic routing -prefixing on inbound
>
>     Hi Julien,
>
>     Yes it is, but only in 1.6.0 (current devel version) . See the
>     is_from_gw() function:
>        
>     http://www.opensips.org/html/docs/modules/1.6.x/drouting.html#id272676
>
>     The 1.5 version has no support for prefixing, but only for stripping:
>         
>     http://www.opensips.org/html/docs/modules/1.5.x/drouting.html#id272676
>
>     Regards,
>     Bogdan
>
>     Julien Chavanton wrote:
>     >
>     > I found this in the README of the source code :
>     >
>     >  * bidirectional behavior - inbound and outbound processing
>     >        (strip and prefixing when sending and receiving from a
>     >        destination/GW)
>     >
>     > I would like to happend a prefix when a call comes in from a certain
>     > gateway, I found that "PRI PREFIX" is currently applied on when call
>     > it outbound to the gateway but not when a call comes from a gateway.
>     >
>     > Is it already doable ?
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > Users mailing list
>     > Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>     > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>     >  
>
>
>     _______________________________________________
>     Users mailing list
>     Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>




More information about the Users mailing list