Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.270 diff -u -r1.270 chan_sip.c --- channels/chan_sip.c 11 Jan 2004 21:37:50 -0000 1.270 +++ channels/chan_sip.c 12 Jan 2004 05:38:08 -0000 @@ -6545,6 +6545,15 @@ /* First, take us out of the channel loop */ ast_channel_unregister(type); ast_unregister_application(app_dtmfmode); + ast_cli_unregister(&cli_show_users); + ast_cli_unregister(&cli_show_channels); + ast_cli_unregister(&cli_show_channel); + ast_cli_unregister(&cli_show_peers); + ast_cli_unregister(&cli_show_registry); + ast_cli_unregister(&cli_debug); + ast_cli_unregister(&cli_no_debug); + ast_cli_unregister(&cli_inuse_show); + ast_rtp_proto_unregister(&sip_rtp); if (!ast_mutex_lock(&iflock)) { /* Hangup all interfaces if they have an owner */ p = iflist; @@ -6560,7 +6569,7 @@ return -1; } if (!ast_mutex_lock(&monlock)) { - if (monitor_thread) { + if (monitor_thread && (monitor_thread != -2)) { pthread_cancel(monitor_thread); pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL);