[OpenSIPS-Users] change a character in $rU

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Apr 20 12:27:45 CEST 2010


Hi Dimitri,

There are 2 options:

1) use transformations to split the string (L as separator):

$rU = $(rU{s.select,0,L}) + "P" + $(rU{s.select,1,L});

(see http://www.opensips.org/Resources/DocsCoreTran16#toc6)

2) use subst_uri()

subst_uri("/^sip:([0-9]+)L(.*)$/sip:\1P\2/i");

(see http://www.opensips.org/html/docs/modules/1.6.x/textops.html#id228563)

Regards,
Bogdan

Dmitri G. wrote:
> Hello List,
>
> I have a little problem at the moment, let me explain.
> One of the customers is sending calls to my Opensips box, and they 
> using a prefix.
> Basically they sending like this: 12345L99999999
>
> Basically the prefix ends with "L".
> How can I change the $rU to 12345P99999999? I have tried to play with 
> the subst functions, but I can't find the right regexp for this.
> So I would like to change only the "L" to "P" without touching the 
> other parts uf the $rU, so to send out the call with "P" instead of "L".
>
>
>
> Any help would be appreciated!
>
> Thanks,
>
> Dimitri
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list