[asterisk-addons-commits] mnicholson: trunk r903 - /trunk/channels/chan_mobile.c

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Fri May 8 10:40:06 CDT 2009


Author: mnicholson
Date: Fri May  8 10:40:01 2009
New Revision: 903

URL: http://svn.asterisk.org/svn-view/asterisk-addons?view=rev&rev=903
Log:
Accept SCO sockets even if there is no pvt->owner.  An owner may come later.

(closes issue #15037)
Reported by: hmld
Tested by: mnicholson, hmld, jongerenchaos

Modified:
    trunk/channels/chan_mobile.c

Modified: trunk/channels/chan_mobile.c
URL: http://svn.asterisk.org/svn-view/asterisk-addons/trunk/channels/chan_mobile.c?view=diff&rev=903&r1=902&r2=903
==============================================================================
--- trunk/channels/chan_mobile.c (original)
+++ trunk/channels/chan_mobile.c Fri May  8 10:40:01 2009
@@ -797,6 +797,10 @@
 	ast_string_field_set(chn, language, "en");
 	pvt->owner = chn;
 
+	if (pvt->sco_socket != -1) {
+		ast_channel_set_fd(chn, 0, pvt->sco_socket);
+	}
+
 	return chn;
 
 e_return:
@@ -1678,20 +1682,17 @@
 	}
 
 	ast_mutex_lock(&pvt->lock);
-	if (!pvt->owner) {
-		ast_mutex_unlock(&pvt->lock);
-		ast_log(LOG_ERROR, "incoming audio connection for pvt without owner\n");
-		close(sock);
-		return 1;
-	}
-
 	if (pvt->sco_socket != -1) {
 		close(pvt->sco_socket);
 		pvt->sco_socket = -1;
 	}
 
 	pvt->sco_socket = sock;
-	ast_channel_set_fd(pvt->owner, 0, sock);
+	if (pvt->owner) {
+		ast_channel_set_fd(pvt->owner, 0, sock);
+	} else {
+		ast_debug(1, "incoming audio connection for pvt without owner\n");
+	}
 
 	ast_mutex_unlock(&pvt->lock);
 




More information about the asterisk-addons-commits mailing list