[asterisk-commits] branch oej/codecnegotiation r25413 - in /team/oej/codecnegotiation: apps/ res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 8 03:44:00 MST 2006


Author: oej
Date: Mon May  8 05:44:00 2006
New Revision: 25413

URL: http://svn.digium.com/view/asterisk?rev=25413&view=rev
Log:
Fix from coder...

Modified:
    team/oej/codecnegotiation/apps/app_dial.c
    team/oej/codecnegotiation/res/res_features.c

Modified: team/oej/codecnegotiation/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/codecnegotiation/apps/app_dial.c?rev=25413&r1=25412&r2=25413&view=diff
==============================================================================
--- team/oej/codecnegotiation/apps/app_dial.c (original)
+++ team/oej/codecnegotiation/apps/app_dial.c Mon May  8 05:44:00 2006
@@ -466,7 +466,7 @@
 					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
 					/* Setup parameters */
-					c = o->chan = ast_request(tech, in->nativeformats, stuff, &cause);
+					c = o->chan = ast_request_inherit(in, tech, stuff, &cause);
 					if (!c)
 						ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
 				} else {
@@ -497,28 +497,11 @@
 						ast_string_field_set(c, accountcode, in->accountcode);
 						c->cdrflags = in->cdrflags;
 					}
-<<<<<<< .working
-					/* Before processing channel, go ahead and check for forwarding */
-					o->forwards++;
-					if (o->forwards < AST_MAX_FORWARDS) {
-						if (option_verbose > 2)
-							ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
-						/* Setup parameters */
-						o->chan = ast_request_inherit(in, tech, stuff, &cause);
-						if (!o->chan)
-							ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
-					} else {
-						if (option_verbose > 2)
-							ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", o->chan->name);
-						cause = AST_CAUSE_CONGESTION;
-						o->chan = NULL;
-=======
 
 					if (in->cid.cid_ani) {
 						if (c->cid.cid_ani)
 							free(c->cid.cid_ani);
 						c->cid.cid_ani = ast_strdup(in->cid.cid_ani);
->>>>>>> .merge-right.r22128
 					}
 					if (c->cid.cid_rdnis) 
 						free(c->cid.cid_rdnis);

Modified: team/oej/codecnegotiation/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/codecnegotiation/res/res_features.c?rev=25413&r1=25412&r2=25413&view=diff
==============================================================================
--- team/oej/codecnegotiation/res/res_features.c (original)
+++ team/oej/codecnegotiation/res/res_features.c Mon May  8 05:44:00 2006
@@ -673,69 +673,6 @@
 	}
 
 	/* valid extension, res == 1 */
-<<<<<<< .working
-	{
-		if (!ast_exists_extension(transferer, transferer_real_context,xferto, 1, transferer->cid.cid_num)) {
-			ast_log(LOG_WARNING, "Extension %s does not exist in context %s\n",xferto,transferer_real_context);
-			finishup(transferee);
-			if (stream_and_wait(transferer, "beeperr", transferer->language, ""))
-				return -1;
-		} else {
-			snprintf(dialstr, sizeof(dialstr), "%s@%s/n", xferto, transferer_real_context);
-			newchan = ast_feature_request_and_dial(transferer, "Local", ast_channel_best_codec(transferer), dialstr, 15000, &outstate, transferer->cid.cid_num, transferer->cid.cid_name);
-			ast_indicate(transferer, -1);
-			if (!newchan) {
-				finishup(transferee);
-				/* any reason besides user requested cancel and busy triggers the failed sound */
-				if (outstate != AST_CONTROL_UNHOLD && outstate != AST_CONTROL_BUSY &&
-						stream_and_wait(transferer, xferfailsound, transferer->language, ""))
-					return -1;
-				return FEATURE_RETURN_SUCCESS;
-			}
-			{
-				res = ast_channel_make_compatible(transferer, newchan);
-				if (res < 0) {
-					ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", transferer->name, newchan->name);
-					ast_hangup(newchan);
-					return -1;
-				}
-				memset(&bconfig,0,sizeof(struct ast_bridge_config));
-				ast_set_flag(&(bconfig.features_caller), AST_FEATURE_DISCONNECT);
-				ast_set_flag(&(bconfig.features_callee), AST_FEATURE_DISCONNECT);
-				res = ast_bridge_call(transferer,newchan,&bconfig);
-				if (newchan->_softhangup || newchan->_state != AST_STATE_UP || !transferer->_softhangup) {
-					ast_hangup(newchan);
-					if (f) {
-						ast_frfree(f);
-						f = NULL;
-					}
-					if (stream_and_wait(transferer, xfersound, transferer->language, ""))
-						ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
-					finishup(transferee);
-					transferer->_softhangup = 0;
-					return FEATURE_RETURN_SUCCESS;
-				}
-				
-				res = ast_channel_make_compatible(transferee, newchan);
-				if (res < 0) {
-					ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", transferee->name, newchan->name);
-					ast_hangup(newchan);
-					return -1;
-				}
-				
-				
-				ast_moh_stop(transferee);
-				
-				if ((ast_autoservice_stop(transferee) < 0)
-				   || (ast_waitfordigit(transferee, 100) < 0)
-				   || (ast_waitfordigit(newchan, 100) < 0) 
-				   || ast_check_hangup(transferee) 
-				   || ast_check_hangup(newchan)) {
-					ast_hangup(newchan);
-					res = -1;
-					return -1;
-				}
-=======
 	if (!ast_exists_extension(transferer, transferer_real_context, xferto, 1, transferer->cid.cid_num)) {
 		ast_log(LOG_WARNING, "Extension %s does not exist in context %s\n",xferto,transferer_real_context);
 		finishup(transferee);
@@ -743,23 +680,10 @@
 			return -1;
 		return FEATURE_RETURN_SUCCESS;
 	}
->>>>>>> .merge-right.r22128
-
-<<<<<<< .working
-				if ((xferchan = ast_channel_alloc(0))) {
-					ast_string_field_build(xferchan, name, "Transfered/%s", transferee->name);
-					/* Make formats okay */
-					xferchan->readformat = ast_get_read_format(transferee);
-					xferchan->writeformat = ast_get_write_format(transferee);
-					ast_channel_masquerade(xferchan, transferee);
-					ast_explicit_goto(xferchan, transferee->context, transferee->exten, transferee->priority);
-					xferchan->_state = AST_STATE_UP;
-					ast_clear_flag(xferchan, AST_FLAGS_ALL);	
-					xferchan->_softhangup = 0;
-=======
+
 	l = strlen(xferto);
 	snprintf(xferto + l, sizeof(xferto) - l, "@%s/n", transferer_real_context);	/* append context */
-	newchan = ast_feature_request_and_dial(transferer, "Local", ast_best_codec(transferer->nativeformats),
+	newchan = ast_feature_request_and_dial(transferer, "Local", ast_channel_best_codec(transferer),
 		xferto, 15000, &outstate, transferer->cid.cid_num, transferer->cid.cid_name);
 	ast_indicate(transferer, -1);
 	if (!newchan) {
@@ -770,7 +694,6 @@
 			return -1;
 		return FEATURE_RETURN_SUCCESS;
 	}
->>>>>>> .merge-right.r22128
 
 	if (check_compat(transferer, newchan))
 		return -1;



More information about the asterisk-commits mailing list