]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make a debug message regarding subscription changes more accurate.
authorMark Michelson <mmichelson@digium.com>
Tue, 27 Mar 2012 18:23:11 +0000 (18:23 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 27 Mar 2012 18:23:11 +0000 (18:23 +0000)
I was getting confused during some testing why Asterisk was saying that
a subscription was being added when it was clearly being removed. This
fixes that confusion.
........

Merged revisions 360625 from http://svn.asterisk.org/svn/asterisk/branches/1.8

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

channels/chan_sip.c

index 99905ab8005e5ba81dbb0ecf84493bf23366728a..4733a3131636126a2cee66f73fd857094a1a187d 100644 (file)
@@ -25672,12 +25672,15 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                }
 
                if (sipdebug) {
+                       const char *action = p->expiry > 0 ? "Adding" : "Removing";
                        if (p->subscribed == MWI_NOTIFICATION && p->relatedpeer) {
-                               ast_debug(2, "Adding subscription for mailbox notification - peer %s\n", p->relatedpeer->name);
+                               ast_debug(2, "%s subscription for mailbox notification - peer %s\n",
+                                               action, p->relatedpeer->name);
                        } else if (p->subscribed == CALL_COMPLETION) {
-                               ast_debug(2, "Adding CC subscription for peer %s\n", p->username);
+                               ast_debug(2, "%s CC subscription for peer %s\n", action, p->username);
                        } else {
-                               ast_debug(2, "Adding subscription for extension %s context %s for peer %s\n", p->exten, p->context, p->username);
+                               ast_debug(2, "%s subscription for extension %s context %s for peer %s\n",
+                                               action, p->exten, p->context, p->username);
                        }
                }
                if (p->autokillid > -1 && sip_cancel_destroy(p))        /* Remove subscription expiry for renewals */