Daniel, just a quick Q.<br><br>When you replace something on the Body using these module's functions, the Content-Length value is recalculated?<br><br>Thanks,<br>Uriel<br><br><div class="gmail_quote">On Thu, Apr 23, 2009 at 12:58 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<br>
On 04/23/2009 03:05 PM, Juan Perez wrote:<br>
> 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.<br>
> I fixed it and it works perfect.<br>
><br>
</div>ok, sounded very strange from first place, for a function that is pretty<br>
old and quite used. Thanks for reporting back.<br>
<br>
Cheers,<br>
<font color="#888888">Daniel<br>
</font><div><div></div><div class="h5"><br>
> thank you all<br>
> jp<br>
><br>
><br>
><br>
><br>
> ----- Original Message ----<br>
> From: Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>><br>
> To: Juan Perez <<a href="mailto:jperezsip2008@yahoo.com">jperezsip2008@yahoo.com</a>><br>
> Cc: kamailio <<a href="mailto:users@lists.kamailio.org">users@lists.kamailio.org</a>><br>
> Sent: Thursday, April 23, 2009 4:23:40 AM<br>
> Subject: Re: [Kamailio-Users] textops usage<br>
><br>
> Hello,<br>
><br>
> On 04/21/2009 05:07 PM, Juan Perez wrote:<br>
><br>
>> Hello<br>
>><br>
>> 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.<br>
>><br>
>> The calling party [linksys pa2p] apparently does not like the "1" and terminates the call.<br>
>><br>
>> 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:<br>
>><br>
>> if (search_body("g729/8000/1")) {<br>
>> xlog("L_INFO","mylog: On Reply 1 section. Found the string.\n");<br>
>> replace_body("g729/8000/1","g729/8000");<br>
>> }<br>
>><br>
>><br>
> just as note, you can do just replace_body(), now you do two times search.<br>
><br>
><br>
>> but it can not even find it. Is leaving me with several questions:<br>
>> 1- is the "re" that I am using right?<br>
>> 2- Do I have to escape the "/"?<br>
>> 3- does the replace and search function go "deep" enough in the SDP?<br>
>><br>
>><br>
> I had not time to test your snippet and see what is wrong, try with<br>
> other flavors from textops:<br>
> replace_body_all() or subst_body().<br>
><br>
> Cheers,<br>
> Daniel<br>
><br>
><br>
><br>
<br>
--<br>
Daniel-Constantin Mierla<br>
<a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
<br>
<br>
_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>