[asterisk-users] Respond to an out of call SIP MESSAGE

Matthew Jordan mjordan at digium.com
Tue Sep 29 07:15:04 CDT 2015


On Mon, Sep 28, 2015 at 11:38 AM, Emil Ohlsson <emo at svep.se> wrote:
> Ah, so I can use
>
> MessageSend(sip:alice)
>
> to send a message to Alice then (reusing the existing TLS session). That does seem to work. Thanks :-). I didn't know you could use users there.
>
> Is there a variable or some other method to see which user that did send the message? I'm thinking something in the lines of
>
> [context]
> exten => _X!,1,NoOp(Handling message from ${SENDER})
>
> I didn't see any useful information using dumpchan, so I'm guessing there isn't any variable for it. $CALLERID(name) didn't contain the name and $SIP_HEADER seems to be focused on calls.
>
> Since the information is in the SIP header it should be possible to get.
>

Since MESSAGE requests are serviced on a single, special channel that
is not a SIP channel, chan_sip specific functions/variables will not
work on that channel.

The MESSAGE_DATA function will read headers off of a received SIP
MESSAGE request:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_MESSAGE_DATA

You can also add headers to an outbound SIP MESSAGE request using that
same function.



More information about the asterisk-users mailing list