Hello,
On 02/18/06 05:07, Lenir wrote:
Hey guys,
What is the best way to modify the SDP message to always include (if
not replace) the a= tags in a SDP message?
My problem is specifically with g729, according to the RFC, if the
parameter: “a=fmtp:18 annexb=yes” is present or missing then it is
assumed that g729b (g729 with VAD) and if “a=fmtp:18 annexb=no” is
present then the devices will use g729a (g729 with VAD Disabled). My
problem is that some cisco gateways and ATAs behave differently (of
course Cisco always doing it their way), if “a=fmtp:18 annexb=no” is
missing then it assumes that g729a will be used, instead of
following the RFC where it should negotiate g729b. Also, asterisk
doesn’t support g729b so I want to avoid using g729b everywhere in
my network.
So what is the best way or is there a way, to either:
a) insert “a=fmtp:18 annexb=no” if is not present
b) replace “a=fmtp:18 annexb=yes” for “a=fmtp:18 annexb=no” if it is
present
you can use textops module. You have functions to search a string and
replace it with another value (replace()). If the line does not exist
then you have to use search_append(). It is in roadmap to add
specific functions to search/replace only withing the body of the
message...
http://openser.org/docs/modules/1.0.x/textops.html
We would also need a function which counts the new body size and
updates the Content-Length header.