[sr-dev] [kamailio/kamailio] filter_body() fails when there isn't a space after "Content-Type:" (#2748)

duarterocha91 notifications at github.com
Wed Jun 2 17:29:03 CEST 2021


Sorry. 

This is my code for filtering : 

"request_route {

    xerr("Before filter_body");
    if (filter_body("application/sdp")) { xerr("Filtered with sucess"); }
    else { xerr("Filtering failed");}
"

The log is the following : 

"2021-06-02T16:13:53.396443+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <script>: Before filter_body
2021-06-02T16:13:53.396677+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:275]: parse_sip_header_name(): invalid end of header name for [--unique-bound]
2021-06-02T16:13:53.396886+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [pplication/sdp]
2021-06-02T16:13:53.397141+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:236]: parse_sip_header_name(): invalid start of header name for [#015#012v=0#015#012o=- 184]
2021-06-02T16:13:53.397337+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [v=0#015#012o=- 18454]
2021-06-02T16:13:53.397527+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [o=- 1845407145]
2021-06-02T16:13:53.397716+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [s=-#015#012c=IN IP4 ]
2021-06-02T16:13:53.397914+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [c=IN IP4 212.1]
2021-06-02T16:13:53.398154+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [t=0 0#015#012m=audio]
2021-06-02T16:13:53.398346+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [m=audio 22138 ]
2021-06-02T16:13:53.398548+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [a=rtpmap:101 t]
2021-06-02T16:13:53.398813+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [a=rtpmap:96 CL]
2021-06-02T16:13:53.399037+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:236]: parse_sip_header_name(): invalid start of header name for [#015#012--unique-bou]
2021-06-02T16:13:53.399230+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:275]: parse_sip_header_name(): invalid end of header name for [--unique-bound]
2021-06-02T16:13:53.399428+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:266]: parse_sip_header_name(): invalid header name for [pplication/ISU]
2021-06-02T16:13:53.399621+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:275]: parse_sip_header_name(): invalid end of header name for [Content-Dispos]
2021-06-02T16:13:53.399815+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:236]: parse_sip_header_name(): invalid start of header name for [#015#012#001]
2021-06-02T16:13:53.400028+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:236]: parse_sip_header_name(): invalid start of header name for [#001]
2021-06-02T16:13:53.400234+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <core> [core/parser/parse_hname2.c:275]: parse_sip_header_name(): invalid end of header name for [--unique-bound]
2021-06-02T16:13:53.400427+01:00 dev_sbc_a_vts01 /usr/local/kamailio-5.4/sbin/kamailio[2740]: ERROR: <script>: Filtering failed
"


I've also attached the packet body : 



    "Message Body
        MIME Multipart Media Encapsulation, Type: multipart/mixed, Boundary: "unique-boundary-1"
            [Type: multipart/mixed]
            First boundary: --unique-boundary-1\r\n
            Encapsulated multipart part:  (application/sdp)
                Content-Type:application/sdp\r\n\r\n
                Session Description Protocol
                    Session Description Protocol Version (v): 0
                    Owner/Creator, Session Id (o): - 1845407145 1 IN IP4 1.1.1.1
                    Session Name (s): -
                    Connection Information (c): IN IP4 1.1.1.1
                    Time Description, active time (t): 0 0
                    Media Description, name and address (m): audio 22138 RTP/AVP 8 0 18 3 13 101 96
                    Media Attribute (a): rtpmap:101 telephone-event/8000
                    Media Attribute (a): rtpmap:96 CLEARMODE/8000
            Boundary: \r\n--unique-boundary-1\r\n
            Encapsulated multipart part:  (application/isup)
                Content-Type:application/ISUP;base=itu-t92+;version=itu-t\r\n
                Content-Disposition:signal;handling=required\r\n\r\n
                ISDN User Part
                    Message Type: Initial address (1)
                    Nature of Connection Indicators : 0x0
                    Forward Call Indicators : 0x6001
                    Calling Party's category : 0xa (ordinary calling subscriber)
                    Transmission medium requirement : 0 (speech)
                    Called Party NumberCalled Party Number: 222222222
                    Pointer to start of optional part: 10
                    Parameter: (t=10, l=8) Calling party number: Calling party numberCalling Party Number: 333333333
                    Parameter: (t=192, l=9) Generic number: Generic numberGeneric Number: 333333333
                    End of optional parameters (0)
            Last boundary: \r\n--unique-boundary-1--\r\n"


If more info or testing is needed please let me know.




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2748#issuecomment-853125172
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210602/0c2c65bf/attachment-0001.htm>


More information about the sr-dev mailing list