[svn-commits] russell: trunk r59216 - in /trunk: ./ apps/app_meetme.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Mar 26 11:29:10 MST 2007


Author: russell
Date: Mon Mar 26 13:29:10 2007
New Revision: 59216

URL: http://svn.digium.com/view/asterisk?view=rev&rev=59216
Log:
Merged revisions 59215 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r59215 | russell | 2007-03-26 13:28:29 -0500 (Mon, 26 Mar 2007) | 3 lines

Fix some codec negotiation problems when CallerID support is not enabled in SLA.
(issue #9308, reported by twilson)

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_meetme.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=59216&r1=59215&r2=59216
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Mon Mar 26 13:29:10 2007
@@ -3486,6 +3486,8 @@
 	char *tech, *tech_data;
 	struct ast_dial *dial;
 	struct sla_ringing_station *ringing_station;
+	const char *cid_name = NULL, *cid_num = NULL;
+	enum ast_dial_result res;
 
 	if (!(dial = ast_dial_create()))
 		return -1;
@@ -3499,8 +3501,25 @@
 		return -1;
 	}
 
-	if (ast_dial_run(dial, sla.attempt_callerid ? ringing_trunk->trunk->chan : NULL, 1) 
-		!= AST_DIAL_RESULT_TRYING) {
+	if (!sla.attempt_callerid && !ast_strlen_zero(ringing_trunk->trunk->chan->cid.cid_name)) {
+		cid_name = ast_strdupa(ringing_trunk->trunk->chan->cid.cid_name);
+		free(ringing_trunk->trunk->chan->cid.cid_name);
+		ringing_trunk->trunk->chan->cid.cid_name = NULL;
+	}
+	if (!sla.attempt_callerid && !ast_strlen_zero(ringing_trunk->trunk->chan->cid.cid_num)) {
+		cid_num = ast_strdupa(ringing_trunk->trunk->chan->cid.cid_num);
+		free(ringing_trunk->trunk->chan->cid.cid_num);
+		ringing_trunk->trunk->chan->cid.cid_num = NULL;
+	}
+
+	res = ast_dial_run(dial, ringing_trunk->trunk->chan, 1);
+	
+	if (cid_name)
+		ringing_trunk->trunk->chan->cid.cid_name = ast_strdup(cid_name);
+	if (cid_num)
+		ringing_trunk->trunk->chan->cid.cid_num = ast_strdup(cid_num);
+	
+	if (res != AST_DIAL_RESULT_TRYING) {
 		struct sla_failed_station *failed_station;
 		ast_dial_destroy(dial);
 		if (!(failed_station = ast_calloc(1, sizeof(*failed_station))))
@@ -3942,6 +3961,7 @@
 	struct ast_conference *conf;
 	struct ast_flags conf_flags = { 0 };
 	struct sla_trunk_ref *trunk_ref = args->trunk_ref;
+	const char *cid_name = NULL, *cid_num = NULL;
 
 	if (!(dial = ast_dial_create())) {
 		ast_mutex_lock(args->cond_lock);
@@ -3960,7 +3980,24 @@
 		return NULL;
 	}
 
-	dial_res = ast_dial_run(dial, sla.attempt_callerid ? trunk_ref->chan : NULL, 1);
+	if (!sla.attempt_callerid && !ast_strlen_zero(trunk_ref->chan->cid.cid_name)) {
+		cid_name = ast_strdupa(trunk_ref->chan->cid.cid_name);
+		free(trunk_ref->chan->cid.cid_name);
+		trunk_ref->chan->cid.cid_name = NULL;
+	}
+	if (!sla.attempt_callerid && !ast_strlen_zero(trunk_ref->chan->cid.cid_num)) {
+		cid_num = ast_strdupa(trunk_ref->chan->cid.cid_num);
+		free(trunk_ref->chan->cid.cid_num);
+		trunk_ref->chan->cid.cid_num = NULL;
+	}
+
+	dial_res = ast_dial_run(dial, trunk_ref->chan, 1);
+
+	if (cid_name)
+		trunk_ref->chan->cid.cid_name = ast_strdup(cid_name);
+	if (cid_num)
+		trunk_ref->chan->cid.cid_num = ast_strdup(cid_num);
+
 	if (dial_res != AST_DIAL_RESULT_TRYING) {
 		ast_mutex_lock(args->cond_lock);
 		ast_cond_signal(args->cond);



More information about the svn-commits mailing list