diff options
author | Joshua Colp <jcolp@digium.com> | 2007-05-28 23:28:52 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-05-28 23:28:52 +0000 |
commit | 4d03b4f26853d97590de761eecac47ff087a84b8 (patch) | |
tree | 66cebcae454c5eef346e7ab24d48e9ef0a4c4a71 /channels | |
parent | 39e9b3112c642835b0a4b3d0ee348c686215851b (diff) |
Don't try to unregister a peer using the sip unregister CLI command if they are not registered. (issue #9811 reported by eliel)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 223e2276c..fed98d486 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11121,8 +11121,12 @@ static int sip_unregister(int fd, int argc, char *argv[]) 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]); } |