Store sip peer name as var data on a outofcall msg.
authorDavid Vossel <dvossel@digium.com>
Tue, 14 Jun 2011 14:37:41 +0000 (14:37 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 14 Jun 2011 14:37:41 +0000 (14:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323325 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index a16684a..4f00acf 100644 (file)
@@ -16095,6 +16095,7 @@ static void receive_message(struct sip_pvt *p, struct sip_request *req, struct a
                        if (!ast_strlen_zero(peer->messagecontext)) {
                                ast_string_field_set(p, messagecontext, peer->messagecontext);
                        }
+                       ast_string_field_set(p, peername, peer->name);
                        peer = unref_peer(peer, "from find_peer() in receive_message");
                }
        }
@@ -16124,6 +16125,10 @@ static void receive_message(struct sip_pvt *p, struct sip_request *req, struct a
                res |= ast_msg_set_context(msg, "%s", p->context);
        }
 
+       if (!ast_strlen_zero(p->peername)) {
+               res |= ast_msg_set_var(msg, "SIP_PEERNAME", p->peername);
+       }
+
        res |= ast_msg_set_exten(msg, "%s", p->exten);
 
        if (res) {