Fix a bug where the sip unregister CLI command did not completely unregister the...
authorJoshua Colp <jcolp@digium.com>
Tue, 26 May 2009 13:43:13 +0000 (13:43 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 26 May 2009 13:43:13 +0000 (13:43 +0000)
(closes issue #15118)
Reported by: alecdavis
Patches:
      chan_sip_unregister.diff2.txt uploaded by alecdavis (license 585)

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

channels/chan_sip.c

index ef4f08d..c6b1801 100644 (file)
@@ -15533,6 +15533,8 @@ static char *sip_unregister(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
        
        if ((peer = find_peer(a->argv[2], NULL, load_realtime, FINDPEERS, TRUE))) {
                if (peer->expire > 0) {
+                       AST_SCHED_DEL_UNREF(sched, peer->expire,
+                               unref_peer(peer, "remove register expire ref"));
                        expire_register(ref_peer(peer, "ref for expire_register"));
                        ast_cli(a->fd, "Unregistered peer \'%s\'\n\n", a->argv[2]);
                } else {