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(a)gmail.com>
To: Juan Perez <jperezsip2008(a)yahoo.com>
Cc: kamailio <users(a)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