2008/12/22 Della Betta Filippo <filippo.dellabe...@telecomitalia.it>: > Dear Pekka, all > We are trying to implement a MSRP (RFC 4975) parser. > We are evaluating the possibility to use sofia-sip built-in parser, since > MSRP is quite similar to SIP/HTTP protocols. > We successfully used msg_parser.awk to generate the MSRP message class and > MSRP header classes. > The only problem we faced is regarding the parsing of first line of MSRP > message. > Requests and responses in MSRP begins with the token MSRP followed by a > space, but the current implementation of extract_first called by msg_extract > function, relies on the presence of '/' char after the first token to > distinguish between request or response(status). > Can you suggest us how to cope with this issue ? > Do you think that we should use always mc_request as first line , and choose > later the right class ? > Do you think there is a chance to add , for instance, a function pointer to > the msg_class_s structure to be used by extract_first for choosing between > request and/or response(status), or something similar ?
Unfortunately the msg_class_s is not very easy to extend in that manner. Using mc_request always as first line, and choosing the right class later (like, in mc_extract_body) seems to be the best way. Perhaps extract_first() could be patched so that mc_request->hr_class->hc_parse could change the header class (but then you have to be extra careful with the structure sizes...) -- Pekka.Pessi mail at nokia.com ------------------------------------------------------------------------------ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel