Querying outbound SIP headers with CHANNEL()

Hello,

For various reasons, I would like to append two values to my CDR. Those are the values of From and P-Asserted-Identity headers, as these are either received from or sent to, the other endpoint.

Doing this is easy for inbound calls.
I don’t know how to do this for outbound calls.
I know I can log various forms of CALLERID function what I’m after is the values of both SIP headers as they are carried over the wire within the outbound INVITE.

I’ve tried using Hangup handlers without success (*).
I’ve also tried using Dial 's b option without success (**).

Any idea ?

(*) At the time the hangup handler runs, genuine INVITE is not available anymore.
(**) PJSIP_HEADER(read,From) or PJSIP_HEADER(read,P-Asserted-Identity) doesn’t output anything useful.

Best regards

After reading [1], I think that something like CHANNEL(pjsip,P-Asserted-Identity) or CHANNEL(pjsip,logged_header,From) would be very useful to improve dialplans (think of legal compliance).

Implementing this would be require Asterisk to store every PJSIP header.
Maybe a complementary mechanism to turn this on or off completely or the specify the list of SIP headers you’re interested in, would be necessary.

What do you think of this SIP header logging capability ?

[1] [asterisk-users] PJSIP: how to retrieve underlying SIP Call-ID

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