Save the address on which a MESSAGE was received, so it can be used in MESSAGE()
authorJason Parker <jparker@digium.com>
Wed, 2 May 2012 15:59:43 +0000 (15:59 +0000)
committerJason Parker <jparker@digium.com>
Wed, 2 May 2012 15:59:43 +0000 (15:59 +0000)
This is useful in cases where chan_sip may be listening on multiple addresses.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365011 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index a05baac..8579a96 100644 (file)
@@ -16977,6 +16977,7 @@ static void receive_message(struct sip_pvt *p, struct sip_request *req, struct a
        res |= ast_msg_set_body(msg, "%s", ast_str_buffer(buf));
        res |= ast_msg_set_context(msg, "%s", p->context);
 
+       res |= ast_msg_set_var(msg, "SIP_RECVADDR", ast_sockaddr_stringify(&p->recv));
        if (!ast_strlen_zero(p->peername)) {
                res |= ast_msg_set_var(msg, "SIP_PEERNAME", p->peername);
        }