[asterisk-commits] may: branch 12 r415602 - in /branches/12: ./ addons/chan_ooh323.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 10 04:18:24 CDT 2014


Author: may
Date: Tue Jun 10 04:18:20 2014
New Revision: 415602

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=415602
Log:
chan_ooh323: fix loading module failure if there no accessible h323_log or ooh323 config file

change return 1 to return AST_MODULE_LOAD_FAILURE on module load routine
few cosmetic changes

ASTERISK-23814 #close

(closes issue ASTERISK-23814)

Reported by: Igor Goncharovsky
Patches:
	ASTERISK-23814-ast11.patch
........

Merged revisions 415599 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/addons/chan_ooh323.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/addons/chan_ooh323.c?view=diff&rev=415602&r1=415601&r2=415602
==============================================================================
--- branches/12/addons/chan_ooh323.c (original)
+++ branches/12/addons/chan_ooh323.c Tue Jun 10 04:18:20 2014
@@ -735,10 +735,8 @@
        			return NULL;
       		}
 
-      		ast_mutex_unlock(&p->lock);
 		ast_cond_init(&p->rtpcond, NULL);
       		ooMakeCall(data, p->callToken, AST_MAX_EXTENSION, NULL);
-		ast_mutex_lock(&p->lock);
 		if (!p->rtp) {
 			ast_cond_wait(&p->rtpcond, &p->lock);
 		}
@@ -3741,10 +3739,10 @@
 		.onMediaChanged = (cb_OnMediaChanged) setup_rtp_remote,
 	};
 	if (!(gCap = ast_format_cap_alloc(0))) {
-		return 1; 
+		return AST_MODULE_LOAD_FAILURE; 
 	}
 	if (!(ooh323_tech.capabilities = ast_format_cap_alloc(0))) {
-		return 1;
+		return AST_MODULE_LOAD_FAILURE;
 	}
 	ast_format_cap_add(gCap, ast_format_set(&tmpfmt, AST_FORMAT_ULAW, 0));
 	ast_format_cap_add_all(ooh323_tech.capabilities);
@@ -3771,20 +3769,21 @@
 
 
 	if (!reload_config(0)) {
+
+		/* fire up the H.323 Endpoint */		 
+		if (OO_OK != ooH323EpInitialize(OO_CALLMODE_AUDIOCALL, gLogFile)) {
+         		ast_log(LOG_ERROR, "Failed to initialize OOH323 endpoint-"
+                            "OOH323 Disabled\n");
+			return AST_MODULE_LOAD_FAILURE;
+		}
+
 		/* Make sure we can register our OOH323 channel type */
 		if (ast_channel_register(&ooh323_tech)) {
 			ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
-			return 0;
+			return AST_MODULE_LOAD_FAILURE;
 		}
 		ast_rtp_glue_register(&ooh323_rtp);
 		ast_cli_register_multiple(cli_ooh323, sizeof(cli_ooh323) / sizeof(struct ast_cli_entry));
-
-		 /* fire up the H.323 Endpoint */		 
-		if (OO_OK != ooH323EpInitialize(OO_CALLMODE_AUDIOCALL, gLogFile)) {
-         ast_log(LOG_ERROR, "Failed to initialize OOH323 endpoint-"
-                            "OOH323 Disabled\n");
-			return 1;
-		}
 
 		if (gIsGateway)
 			ooH323EpSetAsGateway();
@@ -3800,10 +3799,9 @@
 		}
 		ooH323EpSetCallerID(gCallerID);
  
-      if(ooH323EpSetTCPPortRange(ooconfig.mTCPPortStart, 
-                                 ooconfig.mTCPPortEnd) == OO_FAILED) {
-         ast_log(LOG_ERROR, "h225portrange: Failed to set range\n");
-      }
+		if(ooH323EpSetTCPPortRange(ooconfig.mTCPPortStart, ooconfig.mTCPPortEnd) == OO_FAILED) {
+			ast_log(LOG_ERROR, "h225portrange: Failed to set range\n");
+		}
 
 		/* Set aliases if any */
 		for (pNewAlias = gAliasList; pNewAlias; pNewAlias = pNewAlias->next) {
@@ -3817,8 +3815,8 @@
 			case T_H225AliasAddress_email_ID:	
 				ooH323EpAddAliasEmailID(pNewAlias->value);
 				break;
-         default:
-            ;
+			default:
+				;
 			}
 		}
 
@@ -3885,6 +3883,9 @@
 		}
 		/* And start the monitor for the first time */
 		restart_monitor();
+	} else {
+		ast_log(LOG_ERROR, "Can't load ooh323 config file, OOH323 Disabled\n");
+		return AST_MODULE_LOAD_FAILURE;
 	}
 
 	return 0;




More information about the asterisk-commits mailing list