SIP Headers In Outofcall Messages

Home » Asterisk Users » SIP Headers In Outofcall Messages
Asterisk Users No Comments


Our custom application sets some SIP headers that we want passed to the called party via asterisk in a simple proxy setup. It works fine for voice calls, but we also use SIP to send outofcall messages. I notice I
can’t use SIP_HEADER() to get those custom SIP headers in outofcall messages. Is this a bug?

I have this in sip.conf:

accept_outofcall_message=yes outofcall_message_context=astsms

We can send and receive messages between extensions with this without issue. In extensions.conf:

exten => _X.,1,Set(CHATNOSTORE=${SIP_HEADER(X-Semo-ChatNoStoreForward)})
exten => _X.,n,SIPAddHeader(X-Semo-ChatNoStoreForward: ${CHATNOSTORE})
[snip the parts that actually send on the message]

CHATNOSTORE gets set to “”, even though I can see the header in a packet trace:

0x0260: 654f 7267 3a20 6865 6c6c 6f0d 0a58 2d53 eOrg:.hello..X-S
0x0270: 656d 6f2d 4368 6174 4e6f 5374 6f72 6546 emo-ChatNoStoreF
0x0280: 6f72 7761 7264 3a20 666f 7277 6172 645f orward:.forward_
0x0290: 7661 6c75 650d 0a0d 0a54 6573 7420 6d65 value…
0x02a0: 7373 6167 6520 31 ssage.1

I’m not sure where to take this next… dive into the code for SIP_HEADER?