PJSIP not parsing History-Info header with index=1

When there is only a single History-Info header in the incoming SIP INVITE and that too with an index=1 then Asterisk’s res_pjsip_diversion module is not setting the redirection data from that header.
This happens because of the parsing logic inside get_history_info_header function, If index=1 is there then it ignores the header and goes on to look for another History-Info header which is not there in the SIP INVITE.

The following cases work:

  1. Only 1 History-Info header without any index param
  2. Only 1 History-Info header with an index param but for value anything other than 1
  3. More than 1 History-Info header with different index param values

The following cases do not work:

  1. Only 1 History-Info header with an index param having value 1.
  2. Multiple history “statements” clubbed in a single History-Info header.
    2.1 For example:
    History-Info: <sip:bob@example.com>;index=1;purpose=hop, <sip:alice@proxy1.example.net>;index=2;purpose=hop


  1. is the History-Info parsing implementation correct per the above-mentioned use cases?
  2. shouldn’t the single History-Info header with index=1 work? is this not a valid SIP header?

This support was an external contribution from almost 3 years ago. I don’t recall anything of History-Info so can’t really answer personally, but the RFC itself is 7544 which could possibly provide some answers as to whether it is correct or not.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.