[Kamailio-Users] Question about manually manipulating RURI

Carlos A. Alvarez carlos.alvarez at commxinc.com
Fri Jun 19 21:47:51 CEST 2009


I don't know if this is what you are looking for, but I do something similar to process the From and To message based on a dialed prefix.  Please note below my if statement and feel free to modify it for your own use:

       if ( search("To: <[Ss][Ii][Pp]:56011") ) {
                subst('/^To:(.*)sip:56011([0-9]+)@(.*)$/To:\1sip:+\2@\3/ig');
                subst('/^From: "(.*)sip:([0-9]+)@(.*)$/From: "+\1sip:+\2@\3/ig');
        };


On Fri, 2009-06-19 at 15:43 +0000, Geoffrey Mina wrote:


Thanks, but I believe I just found the simpler way to strip, but I'm
still not sure how I would check for the existence of the "d".

http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:1.5.x#strip_int

I need to do something like:

if(left($ruri,1) == "d"){   //how do i write this statement?
   strip(1);
}

t_relay();

is that correct?

thanks,
Geoff



On Fri, Jun 19, 2009 at 3:23 PM, Pascal Maugeri<pascal.maugeri at gmail.com<mailto:pascal.maugeri at gmail.com>> wrote:
> Hi Geoffrey
>
> Why don't you try:
> http://www.kamailio.org/docs/modules/1.5.x/textops.html#id2467793
>
> Regards,
> Pascal
>
> On Fri, Jun 19, 2009 at 9:01 PM, Geoffrey Mina <geoffreymina at gmail.com<mailto:geoffreymina at gmail.com>>
> wrote:
>>
>> I have a need to perform some manipulation of the user part of the
>> RURI.  I have some dialers which send INVITES with the RURI in the
>> following format:
>>
>> d15555551212 at 123.345.123.345<mailto:d15555551212 at 123.345.123.345>:5060
>>
>> I need to check for the existence of the "d" and strip it off if it is
>> present.  Basically what I want is pseduo code is:
>>
>> if(left($ruri),1 == "d"){
>>  $ruri = right($ruri,len($ruri)-1);
>> }
>>
>> Thanks!
>>
>> _______________________________________________
>> Kamailio (OpenSER) - Users mailing list
>> Users at lists.kamailio.org<mailto:Users at lists.kamailio.org>
>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>
>

_______________________________________________
Kamailio (OpenSER) - Users mailing list
Users at lists.kamailio.org<mailto:Users at lists.kamailio.org>
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 5915 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20090619/34455470/attachment.bin>


More information about the sr-users mailing list