[sr-dev] [tracker] Comment added: textops: add functions to convert and append multipart bodies. (Attachment added)

Victor Seva linuxmaniac at torreviejawireless.org
Sat Mar 22 07:53:56 CET 2014


2014-03-22 7:33 GMT+01:00 Victor Seva <linuxmaniac at torreviejawireless.org>:
> 2014-03-22 5:34 GMT+01:00 Juha Heinanen <jh at tutpro.com>:
>>> Any comments?
>>
>> does this include a function to remove a body part from a multipart body
>> and, if necessary, convert the body to non-multipart?
>
> No, it doesn't. Very good point. Starting to implement that.

It seems that you can already convert to non-multipart using filter_body.

http://www.kamailio.org/docs/modules/devel/modules/textops.html#textops.f.filter_body

...
if (has_body("multipart/mixed")) {
    if (filter_body("application/sdp") {
        remove_hf("Content-Type");
        append_hf("Content-Type: application/sdp\r\n");
    } else {
        xlog("Body part application/sdp not found\n");
    }
}
...



More information about the sr-dev mailing list