[OpenSIPS-Users] Adding ptime to SDP
Donat Zenichev
donat.zenichev at gmail.com
Tue Dec 8 15:22:13 EST 2020
Good day Solarmon,
if to take a look at sipmsgops.so documentation here:
https://opensips.org/html/docs/modules/2.4.x/sipmsgops#func_add_body_part
(I just picked out the first appeared branch, which was 2.4, you can pick
out either 3.0 or one you need).
The quotation here:
"This function can be used to add a new body part to the message body. If
another part already exists, the body of the message will be converted to a
multi-part body automatically."
It looks like this definition clears out your question well. If not, please
let me know what is not clear for you here.
The same module (sipmsgops.so) has another functionality for SIP headers
insertions instead.
For an insertion of SIP headers, please refer to "insert_hf()" :
https://opensips.org/html/docs/modules/2.4.x/sipmsgops.html#func_insert_hf
(same function exists for 3.0 branch as well)
For an insertion of SDP headers, you might try to use
"search_append_body()" of textops.so:
https://opensips.org/html/docs/modules/2.4.x/textops.html#func_search_append_body
(same function exists for 3.0 branch as well)
For your case, I would try to use something like this:
"search_append_body("^a=.+$", "a=ptime:20\r\n");"
Otherwise, I don't see any function that could just simply insert one more
SDP header,
without pointing out - after which particular SDP header, your new header,
should be thrown in. Might be a case for a feature request.
I might be mistaken here. Please correct me, if I'm wrong.
On Tue, Dec 8, 2020 at 1:08 PM solarmon <solarmon at one-n.co.uk> wrote:
> Hi,
>
> How can I add/append a ptime value in the SDP packet?
>
> I've tried using:
>
> add_body_part("a=ptime:20", "application/sdp");
>
> However, this just creates an additional "application/sdp" section rather
> than add/append to the existing one.
>
> Is there not a sipmsgops or textops function to process the SDP
> headers/atttibutes?
>
> Thank you.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Best regards,
Donat Zenichev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20201208/926386cd/attachment.html>
More information about the Users
mailing list