[svn-commits] sgriepentrog: branch 12 r410157 - in /branches/12: addons/ apps/ apps/confbri...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Mar 7 09:46:44 CST 2014


Author: sgriepentrog
Date: Fri Mar  7 09:46:32 2014
New Revision: 410157

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410157
Log:
uniqueid: channel linkedid, ami, ari object creation with id's

Much needed was a way to assign id to objects on creation, and
much change was necessary to accomplish it.  Channel uniqueids
and linkedids are split into separate string and creation time
components without breaking linkedid propgation.  This allowed
the uniqueid to be specified by the user interface - and those
values are now carried through to channel creation, adding the
assignedids value to every function in the chain including the
channel drivers. For local channels, the second channel can be
specified or left to default to a ;2 suffix of first.  In ARI,
bridge, playback, and snoop objects can also be created with a
specified uniqueid.

Along the way, the args order to allocating channels was fixed
in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
masquerade occurs.

(closes issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3191/


Modified:
    branches/12/addons/chan_mobile.c
    branches/12/addons/chan_ooh323.c
    branches/12/apps/app_agent_pool.c
    branches/12/apps/app_bridgewait.c
    branches/12/apps/app_chanisavail.c
    branches/12/apps/app_confbridge.c
    branches/12/apps/app_dial.c
    branches/12/apps/app_followme.c
    branches/12/apps/app_meetme.c
    branches/12/apps/app_originate.c
    branches/12/apps/app_page.c
    branches/12/apps/app_queue.c
    branches/12/apps/app_voicemail.c
    branches/12/apps/confbridge/conf_chan_announce.c
    branches/12/apps/confbridge/conf_chan_record.c
    branches/12/channels/chan_alsa.c
    branches/12/channels/chan_bridge_media.c
    branches/12/channels/chan_console.c
    branches/12/channels/chan_dahdi.c
    branches/12/channels/chan_gtalk.c
    branches/12/channels/chan_h323.c
    branches/12/channels/chan_iax2.c
    branches/12/channels/chan_jingle.c
    branches/12/channels/chan_mgcp.c
    branches/12/channels/chan_misdn.c
    branches/12/channels/chan_motif.c
    branches/12/channels/chan_multicast_rtp.c
    branches/12/channels/chan_nbs.c
    branches/12/channels/chan_oss.c
    branches/12/channels/chan_phone.c
    branches/12/channels/chan_pjsip.c
    branches/12/channels/chan_sip.c
    branches/12/channels/chan_skinny.c
    branches/12/channels/chan_unistim.c
    branches/12/channels/chan_vpb.cc
    branches/12/include/asterisk/bridge.h
    branches/12/include/asterisk/bridge_internal.h
    branches/12/include/asterisk/channel.h
    branches/12/include/asterisk/channel_internal.h
    branches/12/include/asterisk/core_unreal.h
    branches/12/include/asterisk/dial.h
    branches/12/include/asterisk/pbx.h
    branches/12/include/asterisk/stasis_app.h
    branches/12/include/asterisk/stasis_app_playback.h
    branches/12/include/asterisk/stasis_app_snoop.h
    branches/12/main/bridge.c
    branches/12/main/bridge_basic.c
    branches/12/main/bridge_channel.c
    branches/12/main/ccss.c
    branches/12/main/cel.c
    branches/12/main/channel.c
    branches/12/main/channel_internal_api.c
    branches/12/main/core_local.c
    branches/12/main/core_unreal.c
    branches/12/main/dial.c
    branches/12/main/manager.c
    branches/12/main/message.c
    branches/12/main/pbx.c
    branches/12/pbx/pbx_spool.c
    branches/12/res/ari/resource_bridges.c
    branches/12/res/ari/resource_bridges.h
    branches/12/res/ari/resource_channels.c
    branches/12/res/ari/resource_channels.h
    branches/12/res/parking/parking_applications.c
    branches/12/res/parking/parking_bridge.c
    branches/12/res/parking/parking_bridge_features.c
    branches/12/res/parking/parking_tests.c
    branches/12/res/res_ari_bridges.c
    branches/12/res/res_ari_channels.c
    branches/12/res/res_calendar.c
    branches/12/res/res_calendar_caldav.c
    branches/12/res/res_calendar_ews.c
    branches/12/res/res_calendar_exchange.c
    branches/12/res/res_calendar_icalendar.c
    branches/12/res/res_clioriginate.c
    branches/12/res/res_stasis.c
    branches/12/res/res_stasis_playback.c
    branches/12/res/res_stasis_snoop.c
    branches/12/res/stasis/control.c
    branches/12/rest-api/api-docs/bridges.json
    branches/12/rest-api/api-docs/channels.json
    branches/12/tests/test_app.c
    branches/12/tests/test_cdr.c
    branches/12/tests/test_cel.c
    branches/12/tests/test_stasis_channels.c
    branches/12/tests/test_stasis_endpoints.c
    branches/12/tests/test_substitution.c
    branches/12/tests/test_voicemail_api.c

Modified: branches/12/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/addons/chan_mobile.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/addons/chan_mobile.c (original)
+++ branches/12/addons/chan_mobile.c Fri Mar  7 09:46:32 2014
@@ -209,9 +209,9 @@
 "  Message - text of the message\n";
 
 static struct ast_channel *mbl_new(int state, struct mbl_pvt *pvt, char *cid_num,
-		const struct ast_channel *requestor);
+		const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor);
 static struct ast_channel *mbl_request(const char *type, struct ast_format_cap *cap,
-		const struct ast_channel *requestor, const char *data, int *cause);
+		const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);
 static int mbl_call(struct ast_channel *ast, const char *dest, int timeout);
 static int mbl_hangup(struct ast_channel *ast);
 static int mbl_answer(struct ast_channel *ast);
@@ -838,7 +838,7 @@
 */
 
 static struct ast_channel *mbl_new(int state, struct mbl_pvt *pvt, char *cid_num,
-		const struct ast_channel *requestor)
+		const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
 {
 
 	struct ast_channel *chn;
@@ -855,7 +855,7 @@
 	ast_dsp_digitreset(pvt->dsp);
 
 	chn = ast_channel_alloc(1, state, cid_num, pvt->id, 0, 0, pvt->context,
-			requestor ? ast_channel_linkedid(requestor) : "", 0,
+			assignedids, requestor, 0,
 			"Mobile/%s-%04lx", pvt->id, ast_random() & 0xffff);
 	if (!chn) {
 		goto e_return;
@@ -887,7 +887,7 @@
 }
 
 static struct ast_channel *mbl_request(const char *type, struct ast_format_cap *cap,
-		const struct ast_channel *requestor, const char *data, int *cause)
+		const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
 {
 
 	struct ast_channel *chn = NULL;
@@ -946,7 +946,7 @@
 	}
 
 	ast_mutex_lock(&pvt->lock);
-	chn = mbl_new(AST_STATE_DOWN, pvt, NULL, requestor);
+	chn = mbl_new(AST_STATE_DOWN, pvt, NULL, assignedids, requestor);
 	ast_mutex_unlock(&pvt->lock);
 	if (!chn) {
 		ast_log(LOG_WARNING, "Unable to allocate channel structure.\n");
@@ -3591,7 +3591,7 @@
 			ast_debug(1, "[%s] error parsing CLIP: %s\n", pvt->id, buf);
 		}
 
-		if (!(chan = mbl_new(AST_STATE_RING, pvt, clip, NULL))) {
+		if (!(chan = mbl_new(AST_STATE_RING, pvt, clip, NULL, NULL))) {
 			ast_log(LOG_ERROR, "[%s] unable to allocate channel for incoming call\n", pvt->id);
 			hfp_send_chup(pvt->hfp);
 			msg_queue_push(pvt, AT_OK, AT_CHUP);
@@ -3681,7 +3681,7 @@
 		pvt->incoming_sms = 0;
 
 		/* XXX this channel probably does not need to be associated with this pvt */
-		if (!(chan = mbl_new(AST_STATE_DOWN, pvt, NULL, NULL))) {
+		if (!(chan = mbl_new(AST_STATE_DOWN, pvt, NULL, NULL, NULL))) {
 			ast_debug(1, "[%s] error creating sms message channel, disconnecting\n", pvt->id);
 			return -1;
 		}
@@ -4140,7 +4140,7 @@
 
 				pvt->incoming = 1;
 
-				if (!(chan = mbl_new(AST_STATE_UP, pvt, NULL, NULL))) {
+				if (!(chan = mbl_new(AST_STATE_UP, pvt, NULL, NULL, NULL))) {
 					ast_log(LOG_ERROR, "[%s] unable to allocate channel for incoming call\n", pvt->id);
 					ast_mutex_unlock(&pvt->lock);
 					goto e_cleanup;

Modified: branches/12/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/addons/chan_ooh323.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/addons/chan_ooh323.c (original)
+++ branches/12/addons/chan_ooh323.c Fri Mar  7 09:46:32 2014
@@ -71,7 +71,7 @@
 
 /* Channel Definition */
 static struct ast_channel *ooh323_request(const char *type, struct ast_format_cap *cap,
-			const struct ast_channel *requestor,  const char *data, int *cause);
+			const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor,  const char *data, int *cause);
 static int ooh323_digit_begin(struct ast_channel *ast, char digit);
 static int ooh323_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
 static int ooh323_call(struct ast_channel *ast, const char *dest, int timeout);
@@ -360,7 +360,8 @@
 
 
 static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
-                                             const char *host, struct ast_format_cap *cap, const char *linkedid)
+                                             const char *host, struct ast_format_cap *cap, 
+											 const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
 {
 	struct ast_channel *ch = NULL;
 	struct ast_format tmpfmt;
@@ -375,7 +376,7 @@
 	ast_mutex_unlock(&i->lock);
    	ast_mutex_lock(&ooh323c_cn_lock);
    	ch = ast_channel_alloc(1, state, i->callerid_num, i->callerid_name, 
-				i->accountcode, i->exten, i->context, linkedid, i->amaflags,
+				i->accountcode, i->exten, i->context, assignedids, requestor, i->amaflags,
 				"OOH323/%s-%ld", host, callnumber);
    	callnumber++;
    	ast_mutex_unlock(&ooh323c_cn_lock);
@@ -564,7 +565,7 @@
 	Possible data values - peername, exten/peername, exten at ip
  */
 static struct ast_channel *ooh323_request(const char *type, struct ast_format_cap *cap,
-		const struct ast_channel *requestor, const char *data, int *cause)
+		const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
 
 {
 	struct ast_channel *chan = NULL;
@@ -713,7 +714,7 @@
 
 
 	chan = ooh323_new(p, AST_STATE_DOWN, p->username, cap,
-				 requestor ? ast_channel_linkedid(requestor) : NULL);
+				 assignedids, requestor);
 	
 	ast_mutex_unlock(&p->lock);
 
@@ -1910,7 +1911,7 @@
 	ooh323c_set_capability_for_call(call, &p->prefs, p->cap, p->dtmfmode, p->dtmfcodec,
 					 p->t38support, p->g729onlyA);
 /* Incoming call */
-  	c = ooh323_new(p, AST_STATE_RING, p->username, 0, NULL);
+  	c = ooh323_new(p, AST_STATE_RING, p->username, 0, NULL, NULL);
   	if(!c) {
    	ast_mutex_unlock(&p->lock);
    	ast_log(LOG_ERROR, "Could not create ast_channel\n");

Modified: branches/12/apps/app_agent_pool.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_agent_pool.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_agent_pool.c (original)
+++ branches/12/apps/app_agent_pool.c Fri Mar  7 09:46:32 2014
@@ -1367,7 +1367,7 @@
 	bridge = bridge_base_init(bridge, AST_BRIDGE_CAPABILITY_HOLDING,
 		AST_BRIDGE_FLAG_MERGE_INHIBIT_TO | AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM
 			| AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_TRANSFER_PROHIBITED,
-		"AgentPool", NULL);
+		"AgentPool", NULL, NULL);
 	bridge = bridge_register(bridge);
 	return bridge;
 }

Modified: branches/12/apps/app_bridgewait.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_bridgewait.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_bridgewait.c (original)
+++ branches/12/apps/app_bridgewait.c Fri Mar  7 09:46:32 2014
@@ -361,7 +361,7 @@
 		AST_BRIDGE_FLAG_MERGE_INHIBIT_TO | AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM
 		| AST_BRIDGE_FLAG_SWAP_INHIBIT_TO | AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM
 		| AST_BRIDGE_FLAG_TRANSFER_PROHIBITED | AST_BRIDGE_FLAG_DISSOLVE_EMPTY,
-		APP_NAME, bridge_name);
+		APP_NAME, bridge_name, NULL);
 
 	if (!bridge) {
 		return NULL;

Modified: branches/12/apps/app_chanisavail.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_chanisavail.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_chanisavail.c (original)
+++ branches/12/apps/app_chanisavail.c Fri Mar  7 09:46:32 2014
@@ -171,7 +171,7 @@
 			}
 			snprintf(tmp, sizeof(tmp), "%d", status);
 			ast_str_append(&tmp_availstat, 0, "%s%s", ast_str_strlen(tmp_availstat) ? "&" : "", tmp);
-			if ((inuse <= 1) && (tempchan = ast_request(tech, ast_channel_nativeformats(chan), chan, number, &status))) {
+			if ((inuse <= 1) && (tempchan = ast_request(tech, ast_channel_nativeformats(chan), NULL, chan, number, &status))) {
 					ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", ast_channel_name(tempchan));
 					
 					snprintf(tmp, sizeof(tmp), "%s/%s", tech, number);

Modified: branches/12/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_confbridge.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_confbridge.c (original)
+++ branches/12/apps/app_confbridge.c Fri Mar  7 09:46:32 2014
@@ -677,7 +677,7 @@
 
 	ast_format_cap_add(cap, ast_format_set(&format, AST_FORMAT_SLINEAR, 0));
 
-	conference->record_chan = ast_request("CBRec", cap, NULL,
+	conference->record_chan = ast_request("CBRec", cap, NULL, NULL,
 		conference->name, NULL);
 	cap = ast_format_cap_destroy(cap);
 	if (!conference->record_chan) {
@@ -1205,7 +1205,7 @@
 		/* Create an actual bridge that will do the audio mixing */
 		conference->bridge = ast_bridge_base_new(AST_BRIDGE_CAPABILITY_MULTIMIX,
 			AST_BRIDGE_FLAG_MASQUERADE_ONLY | AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY,
-			app, conference_name);
+			app, conference_name, NULL);
 		if (!conference->bridge) {
 			ao2_ref(conference, -1);
 			conference = NULL;
@@ -1357,7 +1357,7 @@
 		return -1;
 	}
 	ast_format_cap_add(cap, ast_format_set(&format, AST_FORMAT_SLINEAR, 0));
-	conference->playback_chan = ast_request("CBAnn", cap, NULL,
+	conference->playback_chan = ast_request("CBAnn", cap, NULL, NULL,
 		conference->name, NULL);
 	cap = ast_format_cap_destroy(cap);
 	if (!conference->playback_chan) {

Modified: branches/12/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_dial.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_dial.c (original)
+++ branches/12/apps/app_dial.c Fri Mar  7 09:46:32 2014
@@ -867,7 +867,7 @@
 		cause = AST_CAUSE_BUSY;
 	} else {
 		/* Setup parameters */
-		c = o->chan = ast_request(tech, ast_channel_nativeformats(in), in, stuff, &cause);
+		c = o->chan = ast_request(tech, ast_channel_nativeformats(in), NULL, in, stuff, &cause);
 		if (c) {
 			if (single && !caller_entertained) {
 				ast_channel_make_compatible(in, o->chan);
@@ -2422,7 +2422,7 @@
 			AST_LIST_UNLOCK(dialed_interfaces);
 		}
 
-		tc = ast_request(tmp->tech, ast_channel_nativeformats(chan), chan, tmp->number, &cause);
+		tc = ast_request(tmp->tech, ast_channel_nativeformats(chan), NULL, chan, tmp->number, &cause);
 		if (!tc) {
 			/* If we can't, just go on to the next call */
 			ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n",

Modified: branches/12/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_followme.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_followme.c (original)
+++ branches/12/apps/app_followme.c Fri Mar  7 09:46:32 2014
@@ -1056,7 +1056,7 @@
 						? "/n" : "/m");
 			}
 
-			outbound = ast_request("Local", ast_channel_nativeformats(caller), caller,
+			outbound = ast_request("Local", ast_channel_nativeformats(caller), NULL, caller,
 				tmpuser->dialarg, &dg);
 			if (!outbound) {
 				ast_log(LOG_WARNING, "Unable to allocate a channel for Local/%s cause: %s\n",

Modified: branches/12/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_meetme.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_meetme.c (original)
+++ branches/12/apps/app_meetme.c Fri Mar  7 09:46:32 2014
@@ -1667,7 +1667,7 @@
 	cnf->dahdiconf = dahdic.confno;
 
 	/* Setup a new channel for playback of audio files */
-	cnf->chan = ast_request("DAHDI", cap_slin, chan, "pseudo", NULL);
+	cnf->chan = ast_request("DAHDI", cap_slin, NULL, chan, "pseudo", NULL);
 	if (cnf->chan) {
 		ast_set_read_format_by_id(cnf->chan, AST_FORMAT_SLINEAR);
 		ast_set_write_format_by_id(cnf->chan, AST_FORMAT_SLINEAR);
@@ -3087,7 +3087,7 @@
 			}
 
 			ast_mutex_lock(&conf->recordthreadlock);
-			if ((conf->recordthread == AST_PTHREADT_NULL) && ast_test_flag64(confflags, CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("DAHDI", cap_slin, chan, "pseudo", NULL)))) {
+			if ((conf->recordthread == AST_PTHREADT_NULL) && ast_test_flag64(confflags, CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("DAHDI", cap_slin, NULL, chan, "pseudo", NULL)))) {
 				ast_set_read_format_by_id(conf->lchan, AST_FORMAT_SLINEAR);
 				ast_set_write_format_by_id(conf->lchan, AST_FORMAT_SLINEAR);
 				dahdic->chan = 0;
@@ -3341,7 +3341,7 @@
 
 	ast_mutex_lock(&conf->recordthreadlock);
 	if ((conf->recordthread == AST_PTHREADT_NULL) && ast_test_flag64(confflags, CONFFLAG_RECORDCONF) &&
-		((conf->lchan = ast_request("DAHDI", cap_slin, chan, "pseudo", NULL)))) {
+		((conf->lchan = ast_request("DAHDI", cap_slin, NULL, chan, "pseudo", NULL)))) {
 		ast_set_read_format_by_id(conf->lchan, AST_FORMAT_SLINEAR);
 		ast_set_write_format_by_id(conf->lchan, AST_FORMAT_SLINEAR);
 		dahdic.chan = 0;
@@ -6344,7 +6344,7 @@
 	tech_data = ast_strdupa(station->device);
 	tech = strsep(&tech_data, "/");
 
-	if (ast_dial_append(dial, tech, tech_data) == -1) {
+	if (ast_dial_append(dial, tech, tech_data, NULL) == -1) {
 		ast_dial_destroy(dial);
 		return -1;
 	}
@@ -6850,7 +6850,7 @@
 
 	tech_data = ast_strdupa(trunk_ref->trunk->device);
 	tech = strsep(&tech_data, "/");
-	if (ast_dial_append(dial, tech, tech_data) == -1) {
+	if (ast_dial_append(dial, tech, tech_data, NULL) == -1) {
 		ast_mutex_lock(args->cond_lock);
 		ast_cond_signal(args->cond);
 		ast_mutex_unlock(args->cond_lock);
@@ -8132,7 +8132,7 @@
 		break;
 	}
 
-	chan = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, NULL, NULL, 0, 0, "MeetMeTest");
+	chan = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, "MeetMeTest");
 	if (!chan) {
 		ast_test_status_update(test, "Channel allocation failed\n");
 		return AST_TEST_FAIL;

Modified: branches/12/apps/app_originate.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_originate.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_originate.c (original)
+++ branches/12/apps/app_originate.c Fri Mar  7 09:46:32 2014
@@ -178,14 +178,14 @@
 
 		ast_pbx_outgoing_exten(chantech, cap_slin, chandata,
 				timeout * 1000, args.arg1, exten, priority, &outgoing_status, 0, NULL,
-				NULL, NULL, NULL, NULL, 0);
+				NULL, NULL, NULL, NULL, 0, NULL);
 	} else if (!strcasecmp(args.type, "app")) {
 		ast_debug(1, "Originating call to '%s/%s' and connecting them to %s(%s)\n",
 				chantech, chandata, args.arg1, S_OR(args.arg2, ""));
 
 		ast_pbx_outgoing_app(chantech, cap_slin, chandata,
 				timeout * 1000, args.arg1, args.arg2, &outgoing_status, 0, NULL,
-				NULL, NULL, NULL, NULL);
+				NULL, NULL, NULL, NULL, NULL);
 	} else {
 		ast_log(LOG_ERROR, "Incorrect type, it should be 'exten' or 'app': %s\n",
 				args.type);

Modified: branches/12/apps/app_page.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_page.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_page.c (original)
+++ branches/12/apps/app_page.c Fri Mar  7 09:46:32 2014
@@ -318,7 +318,7 @@
 		}
 
 		/* Append technology and resource */
-		if (ast_dial_append(dial, tech, resource) == -1) {
+		if (ast_dial_append(dial, tech, resource, NULL) == -1) {
 			ast_log(LOG_ERROR, "Failed to add %s to outbound dial\n", tech);
 			ast_dial_destroy(dial);
 			continue;

Modified: branches/12/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_queue.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_queue.c (original)
+++ branches/12/apps/app_queue.c Fri Mar  7 09:46:32 2014
@@ -4058,7 +4058,7 @@
 	}
 
 	/* Request the peer */
-	tmp->chan = ast_request(tech, ast_channel_nativeformats(qe->chan), qe->chan, location, &status);
+	tmp->chan = ast_request(tech, ast_channel_nativeformats(qe->chan), NULL, qe->chan, location, &status);
 	if (!tmp->chan) {			/* If we can't, just go on to the next call */
 		ao2_lock(qe->parent);
 		qe->parent->rrpos++;
@@ -4586,7 +4586,7 @@
 
 					ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", inchan_name, tech, stuff, ochan_name);
 					/* Setup parameters */
-					o->chan = ast_request(tech, ast_channel_nativeformats(in), in, stuff, &status);
+					o->chan = ast_request(tech, ast_channel_nativeformats(in), NULL, in, stuff, &status);
 					if (!o->chan) {
 						ast_log(LOG_NOTICE,
 							"Forwarding failed to create channel to dial '%s/%s'\n",

Modified: branches/12/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_voicemail.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/app_voicemail.c (original)
+++ branches/12/apps/app_voicemail.c Fri Mar  7 09:46:32 2014
@@ -13779,7 +13779,7 @@
 		break;
 	}
 
-	if (!(test_channel1 = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL,
+	if (!(test_channel1 = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, NULL,
         NULL, NULL, 0, 0, "TestChannel1"))) {
 		goto exit_vmsayname_test;
 	}

Modified: branches/12/apps/confbridge/conf_chan_announce.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/confbridge/conf_chan_announce.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/confbridge/conf_chan_announce.c (original)
+++ branches/12/apps/confbridge/conf_chan_announce.c Fri Mar  7 09:46:32 2014
@@ -77,7 +77,7 @@
 	doomed->bridge = NULL;
 }
 
-static struct ast_channel *announce_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
+static struct ast_channel *announce_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
 {
 	struct ast_channel *chan;
 	const char *conf_name = data;
@@ -102,7 +102,7 @@
 	ao2_ref(pvt->bridge, +1);
 
 	chan = ast_unreal_new_channels(&pvt->base, conf_announce_get_tech(),
-		AST_STATE_UP, AST_STATE_UP, NULL, NULL, requestor, NULL);
+		AST_STATE_UP, AST_STATE_UP, NULL, NULL, assignedids, requestor, NULL);
 	if (chan) {
 		ast_answer(pvt->base.owner);
 		ast_answer(pvt->base.chan);

Modified: branches/12/apps/confbridge/conf_chan_record.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/confbridge/conf_chan_record.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/apps/confbridge/conf_chan_record.c (original)
+++ branches/12/apps/confbridge/conf_chan_record.c Fri Mar  7 09:46:32 2014
@@ -53,13 +53,13 @@
 	return 0;
 }
 
-static struct ast_channel *rec_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
+static struct ast_channel *rec_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
 {
 	struct ast_channel *chan;
 	struct ast_format format;
 	const char *conf_name = data;
 
-	chan = ast_channel_alloc(1, AST_STATE_UP, NULL, NULL, NULL, NULL, NULL, NULL, 0,
+	chan = ast_channel_alloc(1, AST_STATE_UP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0,
 		"CBRec/conf-%s-uid-%d",
 		conf_name, (int) ast_random());
 	if (!chan) {

Modified: branches/12/channels/chan_alsa.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_alsa.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/channels/chan_alsa.c (original)
+++ branches/12/channels/chan_alsa.c Fri Mar  7 09:46:32 2014
@@ -141,7 +141,7 @@
 static int mute = 0;
 static int noaudiocapture = 0;
 
-static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);
 static int alsa_digit(struct ast_channel *c, char digit, unsigned int duration);
 static int alsa_text(struct ast_channel *c, const char *text);
 static int alsa_hangup(struct ast_channel *c);
@@ -574,11 +574,11 @@
 	return res;
 }
 
-static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const char *linkedid)
+static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
 {
 	struct ast_channel *tmp = NULL;
 
-	if (!(tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, linkedid, 0, "ALSA/%s", indevname)))
+	if (!(tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, assignedids, requestor, 0, "ALSA/%s", indevname)))
 		return NULL;
 
 	ast_channel_stage_snapshot(tmp);
@@ -614,7 +614,7 @@
 	return tmp;
 }
 
-static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
+static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
 {
 	struct ast_format tmpfmt;
 	char buf[256];
@@ -632,7 +632,7 @@
 	if (alsa.owner) {
 		ast_log(LOG_NOTICE, "Already have a call on the ALSA channel\n");
 		*cause = AST_CAUSE_BUSY;
-	} else if (!(tmp = alsa_new(&alsa, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL))) {
+	} else if (!(tmp = alsa_new(&alsa, AST_STATE_DOWN, assignedids, requestor))) {
 		ast_log(LOG_WARNING, "Unable to create new ALSA channel\n");
 	}
 
@@ -881,7 +881,7 @@
 			ast_copy_string(alsa.exten, mye, sizeof(alsa.exten));
 			ast_copy_string(alsa.context, myc, sizeof(alsa.context));
 			hookstate = 1;
-			alsa_new(&alsa, AST_STATE_RINGING, NULL);
+			alsa_new(&alsa, AST_STATE_RINGING, NULL, NULL);
 		} else
 			ast_cli(a->fd, "No such extension '%s' in context '%s'\n", mye, myc);
 	}

Modified: branches/12/channels/chan_bridge_media.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_bridge_media.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/channels/chan_bridge_media.c (original)
+++ branches/12/channels/chan_bridge_media.c Fri Mar  7 09:46:32 2014
@@ -65,10 +65,10 @@
 }
 
 static struct ast_channel *announce_request(const char *type, struct ast_format_cap *cap,
-	const struct ast_channel *requestor, const char *data, int *cause);
+	const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);
 
 static struct ast_channel *record_request(const char *type, struct ast_format_cap *cap,
-	const struct ast_channel *requestor, const char *data, int *cause);
+	const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);
 
 static struct ast_channel_tech announce_tech = {
 	.type = "Announcer",
@@ -114,7 +114,7 @@
 	.properties = AST_CHAN_TP_INTERNAL,
 };
 
-static struct ast_channel *media_request_helper(struct ast_format_cap *cap,
+static struct ast_channel *media_request_helper(struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids,
 	const struct ast_channel *requestor, const char *data, struct ast_channel_tech *tech, const char *role)
 {
 	struct ast_channel *chan;
@@ -133,7 +133,7 @@
 	callid = ast_read_threadstorage_callid();
 
 	chan = ast_unreal_new_channels(pvt, tech,
-		AST_STATE_UP, AST_STATE_UP, NULL, NULL, requestor, callid);
+		AST_STATE_UP, AST_STATE_UP, NULL, NULL, assignedids, requestor, callid);
 	if (!chan) {
 		return NULL;
 	}
@@ -150,15 +150,15 @@
 }
 
 static struct ast_channel *announce_request(const char *type, struct ast_format_cap *cap,
-	const struct ast_channel *requestor, const char *data, int *cause)
-{
-	return media_request_helper(cap, requestor, data, &announce_tech, "announcer");
+	const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
+{
+	return media_request_helper(cap, assignedids, requestor, data, &announce_tech, "announcer");
 }
 
 static struct ast_channel *record_request(const char *type, struct ast_format_cap *cap,
-	const struct ast_channel *requestor, const char *data, int *cause)
-{
-	return media_request_helper(cap, requestor, data, &record_tech, "recorder");
+	const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
+{
+	return media_request_helper(cap, assignedids, requestor, data, &record_tech, "recorder");
 }
 
 static void cleanup_capabilities(void)

Modified: branches/12/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_console.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/channels/chan_console.c (original)
+++ branches/12/channels/chan_console.c Fri Mar  7 09:46:32 2014
@@ -195,7 +195,7 @@
 
 /*! Channel Technology Callbacks @{ */
 static struct ast_channel *console_request(const char *type, struct ast_format_cap *cap,
-	const struct ast_channel *requestor, const char *data, int *cause);
+	const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);
 static int console_digit_begin(struct ast_channel *c, char digit);
 static int console_digit_end(struct ast_channel *c, char digit, unsigned int duration);
 static int console_text(struct ast_channel *c, const char *text);
@@ -419,12 +419,12 @@
 /*!
  * \note Called with the pvt struct locked
  */
-static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext, const char *ctx, int state, const char *linkedid)
+static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext, const char *ctx, int state, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
 {
 	struct ast_channel *chan;
 
 	if (!(chan = ast_channel_alloc(1, state, pvt->cid_num, pvt->cid_name, NULL, 
-		ext, ctx, linkedid, 0, "Console/%s", pvt->name))) {
+		ext, ctx, assignedids, requestor, 0, "Console/%s", pvt->name))) {
 		return NULL;
 	}
 
@@ -458,7 +458,7 @@
 	return chan;
 }
 
-static struct ast_channel *console_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
+static struct ast_channel *console_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
 {
 	struct ast_channel *chan = NULL;
 	struct console_pvt *pvt;
@@ -481,7 +481,7 @@
 	}
 
 	console_pvt_lock(pvt);
-	chan = console_new(pvt, NULL, NULL, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL);
+	chan = console_new(pvt, NULL, NULL, AST_STATE_DOWN, assignedids, requestor);
 	console_pvt_unlock(pvt);
 
 	if (!chan)
@@ -844,7 +844,7 @@
 	if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
 		console_pvt_lock(pvt);
 		pvt->hookstate = 1;
-		console_new(pvt, mye, myc, AST_STATE_RINGING, NULL);
+		console_new(pvt, mye, myc, AST_STATE_RINGING, NULL, NULL);
 		console_pvt_unlock(pvt);
 	} else
 		ast_cli(a->fd, "No such extension '%s' in context '%s'\n", mye, myc);

Modified: branches/12/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_dahdi.c?view=diff&rev=410157&r1=410156&r2=410157
==============================================================================
--- branches/12/channels/chan_dahdi.c (original)
+++ branches/12/channels/chan_dahdi.c Fri Mar  7 09:46:32 2014
@@ -968,7 +968,7 @@
 }
 
 
-static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause);
 static int dahdi_digit_begin(struct ast_channel *ast, char digit);
 static int dahdi_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
 static int dahdi_sendtext(struct ast_channel *c, const char *text);
@@ -2102,9 +2102,9 @@
  *
  * \param callid_created value returned from ast_callid_threadstorage_auto()
  */
-static struct ast_channel *dahdi_new_callid_clean(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const char *linked, struct ast_callid *callid, int callid_created);
-
-static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const char *linkedid, struct ast_callid *callid);
+static struct ast_channel *dahdi_new_callid_clean(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, struct ast_callid *callid, int callid_created);
+
+static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, struct ast_callid *callid);
 
 static struct ast_channel *my_new_analog_ast_channel(void *pvt, int state, int startpbx, enum analog_sub sub, const struct ast_channel *requestor)
 {
@@ -2113,7 +2113,7 @@
 	struct dahdi_pvt *p = pvt;
 	int dsub = analogsub_to_dahdisub(sub);
 
-	return dahdi_new_callid_clean(p, state, startpbx, dsub, 0, requestor ? ast_channel_linkedid(requestor) : "", callid, callid_created);
+	return dahdi_new_callid_clean(p, state, startpbx, dsub, 0, NULL, requestor, callid, callid_created);
 }
 
 #if defined(HAVE_PRI) || defined(HAVE_SS7)
@@ -2128,7 +2128,7 @@
 #endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 
 #if defined(HAVE_PRI)
-static struct ast_channel *my_new_pri_ast_channel(void *pvt, int state, enum sig_pri_law law, char *exten, const struct ast_channel *requestor)
+static struct ast_channel *my_new_pri_ast_channel(void *pvt, int state, enum sig_pri_law law, char *exten, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
 {
 	struct dahdi_pvt *p = pvt;
 	int audio;
@@ -2171,7 +2171,7 @@
 			break;
 	}
 
-	return dahdi_new_callid_clean(p, state, 0, SUB_REAL, newlaw, requestor ? ast_channel_linkedid(requestor) : "", callid, callid_created);
+	return dahdi_new_callid_clean(p, state, 0, SUB_REAL, newlaw, assignedids, requestor, callid, callid_created);
 }
 #endif	/* defined(HAVE_PRI) */
 
@@ -3029,7 +3029,7 @@
  * \retval ast_channel on success.
  * \retval NULL on error.
  */
-static struct ast_channel *my_new_ss7_ast_channel(void *pvt, int state, enum sig_ss7_law law, char *exten, const struct ast_channel *requestor)
+static struct ast_channel *my_new_ss7_ast_channel(void *pvt, int state, enum sig_ss7_law law, char *exten, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
 {
 	struct dahdi_pvt *p = pvt;
 	int audio;
@@ -3062,7 +3062,7 @@
 		newlaw = DAHDI_LAW_MULAW;
 		break;
 	}
-	return dahdi_new_callid_clean(p, state, 0, SUB_REAL, newlaw, requestor ? ast_channel_linkedid(requestor) : "", callid, callid_created);
+	return dahdi_new_callid_clean(p, state, 0, SUB_REAL, newlaw, assignedids, requestor, callid, callid_created);
 }
 #endif	/* defined(HAVE_SS7) */
 
@@ -3552,7 +3552,7 @@
 	}
 	if (!p->mfcr2_accept_on_offer) {
 		/* The user wants us to start the PBX thread right away without accepting the call first */
-		c = dahdi_new(p, AST_STATE_RING, 1, SUB_REAL, DAHDI_LAW_ALAW, NULL, callid);
+		c = dahdi_new(p, AST_STATE_RING, 1, SUB_REAL, DAHDI_LAW_ALAW, NULL, NULL, callid);
 		if (c) {
 			/* Done here, don't disable reading now since we still need to generate MF tones to accept
 			   the call or reject it and detect the tone off condition of the other end, all of this
@@ -3606,7 +3606,7 @@
 			}
 			goto dahdi_r2_on_call_accepted_cleanup;
 		}
-		c = dahdi_new(p, AST_STATE_RING, 1, SUB_REAL, DAHDI_LAW_ALAW, NULL, callid);
+		c = dahdi_new(p, AST_STATE_RING, 1, SUB_REAL, DAHDI_LAW_ALAW, NULL, NULL, callid);
 		if (c) {
 			/* chan_dahdi will take care of reading from now on in the PBX thread, tell the
 			   library to forget about it */
@@ -7774,7 +7774,7 @@
 					 */
 					ast_mutex_unlock(&p->lock);
 					ast_channel_unlock(ast);
-					chan = dahdi_new(p, AST_STATE_RESERVED, 0, SUB_THREEWAY, 0, NULL, callid);
+					chan = dahdi_new(p, AST_STATE_RESERVED, 0, SUB_THREEWAY, 0, NULL, NULL, callid);
 					ast_channel_lock(ast);
 					ast_mutex_lock(&p->lock);
 					if (p->dahditrcallerid) {
@@ -8850,16 +8850,16 @@
 	return chan_name;
 }
 
-static struct ast_channel *dahdi_new_callid_clean(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const char *linkedid, struct ast_callid *callid, int callid_created)
-{
-	struct ast_channel *new_channel = dahdi_new(i, state, startpbx, idx, law, linkedid, callid);
+static struct ast_channel *dahdi_new_callid_clean(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, struct ast_callid *callid, int callid_created)
+{
+	struct ast_channel *new_channel = dahdi_new(i, state, startpbx, idx, law, assignedids, requestor, callid);
 
 	ast_callid_threadstorage_auto_clean(callid, callid_created);
 
 	return new_channel;
 }
 
-static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const char *linkedid, struct ast_callid *callid)
+static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, struct ast_callid *callid)
 {
 	struct ast_channel *tmp;
 	struct ast_format deflaw;
@@ -8889,7 +8889,7 @@
 		return NULL;
 	}
 
-	tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, linkedid, i->amaflags, "DAHDI/%s", ast_str_buffer(chan_name));
+	tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, assignedids, requestor, i->amaflags, "DAHDI/%s", ast_str_buffer(chan_name));
 	ast_free(chan_name);
 	if (!tmp) {
 		return NULL;
@@ -10492,7 +10492,7 @@
 				restore_gains(mtd->pvt);
 				mtd->pvt->ringt = mtd->pvt->ringt_base;
 

[... 5060 lines stripped ...]



More information about the svn-commits mailing list