Hi Brett,

Thank you for taking the time to respond.

The do_routing function adds the prefix of the pri_prefix function for  
the gateway the call is destined "to".

I would like to add the prefix based on the gateway the call is "from".

The function is_from_gw is able to strip based on the originating  
gateway. I would instead like to prepend / add a prefix - my question  
pertained to adding a prefix based on the "from" gateway.

So suppose I have:

gwid    type    address strip   pri_prefix      attrs   description
1       10      X.X.X.X 0               NULL    Internal gateway
2       20      1.2.3.4 0       101     NULL    External gateway 1
3       20      5.6.7.8 0       102     NULL    External gateway 2

If a call comes from 1.2.3.4 I would like to prepend "101" before  
sending the call to the "Internal gateway".
If on the other hand the call comes from 5.6.7.8 I would like to  
prepend "102" before sending the call to the "Internal gateway".

I hope that makes sense.


/Lasse




On 13 Jul 2009, at 16:25, Brett Nemeroff wrote:

> That should be done automatically by the do_routing function, unless  
> of course you are writing the output of that function to an AVP  
> instead of a RURI. Where it'll end up in the AVP.
>
> -Brett
>
>
> On Sun, Jul 12, 2009 at 7:40 PM, Lasse Johnsen <la...@freebsdcluster.org 
> > wrote:
> Hi,
>
> I use the is_from_gw function in drouting to authenticate what
> gateways are allowed to talk to my OpenSIPS server.
>
> I understand that I can strip something from the R-URI using this
> function. Is there anyway I can add the gateway db entry's pri_prefix
> in the same fashion.
>
> I essentially want to prepend the r-uri based on the originating
> gateway. What is the best way of doing this.
>
>
> /Lasse
>
> _______________________________________________
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Best regards,

Lasse L. Johnsen
CEO, VoIP-X Communications Limited

E           lasse.john...@voip-x.net
M          +44 7832 335 392
F           +44 2075 262 178





_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to