SIP Router Project
FS#170 - get_body_part2 (parse_body)
Opened by Luis Martin (lmartin) - Friday, 28 October 2011, 16:57 GMT
Last edited by Daniel-Constantin Mierla (miconda) - Tuesday, 26 February 2013, 15:40 GMT
I made a new function for the “parser/parse_body.c” module : get_body_part2
get_body_part allows you to pick the first multipart part of the SIP message which matches TYPE/SUBTYPE. It will return a pointer to the multipart structure as well as its length. The code it is not easy-readable but this function is working great. The point is, what if I would like to search a multipart part within a SIP message that matches TYPE/SUBTYPE but also the Content-ID header or the Content-Length header?
It returns the first multipart part of the SIP message which matches “TYPE/SUBTYPE” and/or the “Content-ID” and/or the “Content-Length”, and its length. If you want to be less restrictive, you can unflag the parameter by:
So setting Content-Length == NULL will make the function to skip the Content-Length from its filter and will give you back the first part which matches the TYPE/SUBTYPE and Content-ID, and its length.
Already tested and working fine.
See patch attached.
Luis Martin Gil
Tuesday, 26 February 2013, 15:40 GMT
Reason for closing: Implemented
Additional comments about closing: Done by commit 9365c5c19cb0b9d4300fa5b0a220bf19738c808f