From 096540c2c0f1c445ce9ff48e67282ad7f41d000d Mon Sep 17 00:00:00 2001
From: Automerge script <automerge@asterisk.org>
Date: Tue, 13 Nov 2012 20:19:49 +0000
Subject: [PATCH] Merged revisions 376219 via svnmerge from
 file:///srv/subversion/repos/asterisk/trunk

........
  r376219 | jrose | 2012-11-13 13:42:13 -0600 (Tue, 13 Nov 2012) | 12 lines

  chan_sip: Add SubscribeContext field to SIPshowpeer AMI response

  The new field is will show up within the response if the requested peer has a
  subscribe context set.

  (closes issue ASTERISK-20626)
  Reported by: Jaco Kroon
  Patches:
      asterisk-sip-ami-SubscrContext.patch uploaded by jkroon (license 5671)
          -with modifications by jrose to conform to style guidelines
  Review: https://reviewboard.asterisk.org/r/2195/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 CHANGES             | 3 +++
 channels/chan_sip.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/CHANGES b/CHANGES
index 54665e5092..4da4fd9b13 100644
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,9 @@
 
 AMI (Asterisk Manager Interface)
 ------------------
+ * The SIPshowpeer action will now include a 'SubscribeContext' field for a peer
+   in its response if the peer has a subscribe context set.
+
  * The SIPqualifypeer action now acknowledges the request once it has established
    that the request is against a known peer. It also issues a new event,
    'SIPqualifypeerdone', once the qualify action has been completed.
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c939df955b..a0b1c2ff0e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -19876,6 +19876,9 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct
 		astman_append(s, "RemoteSecretExist: %s\r\n", ast_strlen_zero(peer->remotesecret)?"N":"Y");
 		astman_append(s, "MD5SecretExist: %s\r\n", ast_strlen_zero(peer->md5secret)?"N":"Y");
 		astman_append(s, "Context: %s\r\n", peer->context);
+		if (!ast_strlen_zero(peer->subscribecontext)) {
+			astman_append(s, "SubscribeContext: %s\r\n", peer->subscribecontext);
+		}
 		astman_append(s, "Language: %s\r\n", peer->language);
 		astman_append(s, "ToneZone: %s\r\n", peer->zone[0] != '\0' ? peer->zone : "<Not set>");
 		if (!ast_strlen_zero(peer->accountcode))
-- 
GitLab