Hi, Yes the real question is asking why the sender put this character there ? Anyway, thanks for explanation, I keep you posted when I solve this bug. Best Regards Adel -----Message d'origine----- De : pjsip-bounces at lists.pjsip.org [mailto:pjsip-bounces at lists.pjsip.org] De la part de Benny Prijono Envoy? : jeudi 2 septembre 2010 03:10 ? : pjsip list Objet : Re: [pjsip] Bug in on parsing the via header sip message Hi, The fix in https://trac.pjsip.org/repos/ticket/1116 is a workaround and it may not solve all problems indeed, depending on what the escaped character is (as noted by the two digits following the "%" character). In general, I think the other agent is asking for trouble by putting "%" character there, and here's why. As we know, the "% HEX HEX" format is used to represent a character that is not allowed to appear in a particular location. This is called escaping. And according to the spec, a "% HEX HEX" format is equivalent to the character that it represents, so for example the following are equivalent (see RFC 3261 Section 19.1.4): sip:%61lice at atlanta.com sip:alice at atlanta.com So if an UAC sends "branch=%61lice", UAS may reply use "branch=alice" in the reply, since the character "a" which %61 represents is not a reserved character, thus it is allowed to appear there. People may argue that branch is a special parameter which value should not altered, but IMO this is incorrect. The special treatment only happens at the much higher layer, i.e. the transaction layer, and there is nothing special about this parameter at all at the syntax/parsing layer. I'm also aware that "%" character is included in the BNF reproduction for "token", but I still think that it's a bad idea to send "%" character when you don't mean to escape thing, for the reason above. Best regards, Benny On Wed, Sep 1, 2010 at 4:00 PM, Ferguen Adel <aferguen at neotilus.com> wrote: > > Hello benny , > > I follow your modification in sip_msg.c , but the problem still here, we don't have the '%' in the branch of 200 ok on responding to notiy > > Best regards > > -----Message d'origine----- > De : pjsip-bounces at lists.pjsip.org [mailto:pjsip-bounces at lists.pjsip.org] De la part de Benny Prijono > Envoy? : mardi 31 ao?t 2010 18:48 > ? : pjsip list > Objet : Re: [pjsip] Bug in on parsing the via header sip message > > I just comitted a workaround for this in > https://trac.pjsip.org/repos/ticket/1116 > > Thanks for the report! > > Best regards, > Benny > > > 2010/8/31 Ferguen Adel <aferguen at neotilus.com>: >> >> >> Hello, >> >> >> >> I m using psjsip , I think this stack have a bug : (Follow the description >> )? >> >> >> >> - When I receive message SIP and the value of branch in VIA header >> contain the character %, the parser don?t recognize it take it for another >> think >> >> - By ex: when I receive 145%1458 the parser read value like this >> 145058 >> >> - >> >> - Then the 200 OK SIP message will be send with different VIA >> header branch value >> >> - >> >> - The function responsible for this parse is >> int_parse_via_param( pjsip_via_hdr *hdr, pj_scanner *scanner, >> >> - >> pj_pool_t *pool) >> >> - Did any have the same pb ? >> >> >> >> >> >> Thanks for response >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip at lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip at lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org