[asterisk-bugs] Fix chan_phone module unload

Richard Braun rbraun at proformatique.com
Wed Sep 5 04:35:11 CDT 2007


Hello,

Here is a patch that checks if cur_tech has been initialized before
unregistering it when chan_phone is unloaded, which happens if e.g.
there is no configuration file, in which case cur_tech is neither set
nor registered.

-- 
Richard Braun
-------------- next part --------------
Index: channels/chan_phone.c
===================================================================
--- channels/chan_phone.c	(revision 81491)
+++ channels/chan_phone.c	(working copy)
@@ -1284,7 +1284,8 @@
 {
 	struct phone_pvt *p, *pl;
 	/* First, take us out of the channel loop */
-	ast_channel_unregister(cur_tech);
+	if (cur_tech)
+		ast_channel_unregister(cur_tech);
 	if (!ast_mutex_lock(&iflock)) {
 		/* Hangup all interfaces if they have an owner */
 		p = iflist;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.digium.com/pipermail/asterisk-bugs/attachments/20070905/b23799f8/attachment.pgp 


More information about the asterisk-bugs mailing list