I need to read some SIP headers from an outbound call created with Dial dialplan command using PJSIP channel driver, but I cannot find a way.
I already tried using PJSIP_HEADERS function in a macro invoked on answer (option M of Dial command), but it is returning an empty string for all headers.
Looking at the docs I found that this is the expected behaviour of PJSIP_HEADERS function, so is there a way to read SIP headers from an estabilished outbound call? Specifically I need to get the from-tag and to-tag from the From and To headers.
Using the old chan_sip I could read those data easily using the SIP_HEADERS function.
P.S. I’m using asterisk 13.15