[asterisk-commits] file: trunk r66315 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 28 16:28:52 MST 2007


Author: file
Date: Mon May 28 18:28:52 2007
New Revision: 66315

URL: http://svn.digium.com/view/asterisk?view=rev&rev=66315
Log:
Don't try to unregister a peer using the sip unregister CLI command if they are not registered. (issue #9811 reported by eliel)

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=66315&r1=66314&r2=66315
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon May 28 18:28:52 2007
@@ -11121,8 +11121,12 @@
 		return RESULT_SHOWUSAGE;
 	
 	if ((peer = find_peer(argv[2], NULL, load_realtime))) {
-		expire_register(peer);
-		ast_cli(fd, "Unregistered peer \'%s\'\n\n", argv[2]);
+		if (peer->expire > 0) {
+			expire_register(peer);
+			ast_cli(fd, "Unregistered peer \'%s\'\n\n", argv[2]);
+		} else {
+			ast_cli(fd, "Peer %s not registered\n", argv[2]);
+		}
 	} else {
 		ast_cli(fd, "Peer unknown: \'%s\'. Not unregistered.\n", argv[2]);
 	}



More information about the asterisk-commits mailing list