[Kamailio-Users] textops usage

Daniel-Constantin Mierla miconda at gmail.com
Fri Apr 24 15:28:33 CEST 2009


Hello,

On 04/24/2009 03:01 PM, Uriel Rozenbaum wrote:
> Daniel, just a quick Q.
>
> When you replace something on the Body using these module's functions, 
> the Content-Length value is recalculated?
yes. But at forward time, you cannot get the new Content-Length value 
while in config processing.

Cheers,
Daniel

>
> Thanks,
> Uriel
>
> On Thu, Apr 23, 2009 at 12:58 PM, Daniel-Constantin Mierla 
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
>
>
>     On 04/23/2009 03:05 PM, Juan Perez wrote:
>     > actually I found out what the prob was, the call was not taking
>     the route where that piece of code is and that is why it was not
>     replacing the character.
>     > I fixed it and it works perfect.
>     >
>     ok, sounded very strange from first place, for a function that is
>     pretty
>     old and quite used. Thanks for reporting back.
>
>     Cheers,
>     Daniel
>
>     > thank you all
>     > jp
>     >
>     >
>     >
>     >
>     > ----- Original Message ----
>     > From: Daniel-Constantin Mierla <miconda at gmail.com
>     <mailto:miconda at gmail.com>>
>     > To: Juan Perez <jperezsip2008 at yahoo.com
>     <mailto:jperezsip2008 at yahoo.com>>
>     > Cc: kamailio <users at lists.kamailio.org
>     <mailto:users at lists.kamailio.org>>
>     > Sent: Thursday, April 23, 2009 4:23:40 AM
>     > Subject: Re: [Kamailio-Users] textops usage
>     >
>     > Hello,
>     >
>     > On 04/21/2009 05:07 PM, Juan Perez wrote:
>     >
>     >> Hello
>     >>
>     >> I am receiving the SDP from a provider with this format:
>     g729/8000/1, which I interpret as codec g729, sampling rate 8000
>     and the number of channels is 1.
>     >>
>     >> The calling party [linksys pa2p] apparently does not like the
>     "1" and terminates the call.
>     >>
>     >> I want to strip it using textops module and pass back the SDP
>     w/o the "1" and do this in the On_Reply and the Route sections:
>     >>
>     >>         if (search_body("g729/8000/1")) {
>     >>          xlog("L_INFO","mylog: On Reply 1 section. Found the
>     string.\n");
>     >>         replace_body("g729/8000/1","g729/8000");
>     >>         }
>     >>
>     >>
>     > just as note, you can do just replace_body(), now you do two
>     times search.
>     >
>     >
>     >> but it can not even find it. Is leaving me with several questions:
>     >> 1- is the "re" that I am using right?
>     >> 2- Do I have to escape the "/"?
>     >> 3- does the replace and search function go "deep" enough in the
>     SDP?
>     >>
>     >>
>     > I had not time to test your snippet and see what is wrong, try with
>     > other flavors from textops:
>     > replace_body_all() or subst_body().
>     >
>     > Cheers,
>     > Daniel
>     >
>     >
>     >
>
>     --
>     Daniel-Constantin Mierla
>     http://www.asipto.com/
>
>
>     _______________________________________________
>     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
>
>

-- 
Daniel-Constantin Mierla
http://www.asipto.com/





More information about the sr-users mailing list