summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorScott Griepentrog <sgriepentrog@digium.com>2014-03-07 15:47:55 +0000
committerScott Griepentrog <sgriepentrog@digium.com>2014-03-07 15:47:55 +0000
commit80ef9a21b9d91ff0bafc304923bc29effa230b00 (patch)
treea67db39a4c17a4b01a87201ef37ffdc43189c119 /apps
parentd3ac8b8a0e70049af7b5552c4dfd8adc2cc5df11 (diff)
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/ ........ Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_agent_pool.c2
-rw-r--r--apps/app_bridgewait.c2
-rw-r--r--apps/app_chanisavail.c2
-rw-r--r--apps/app_confbridge.c6
-rw-r--r--apps/app_dial.c4
-rw-r--r--apps/app_followme.c2
-rw-r--r--apps/app_meetme.c12
-rw-r--r--apps/app_originate.c4
-rw-r--r--apps/app_page.c2
-rw-r--r--apps/app_queue.c4
-rw-r--r--apps/app_voicemail.c2
-rw-r--r--apps/confbridge/conf_chan_announce.c4
-rw-r--r--apps/confbridge/conf_chan_record.c4
13 files changed, 25 insertions, 25 deletions
diff --git a/apps/app_agent_pool.c b/apps/app_agent_pool.c
index a44c75d46..699be5845 100644
--- a/apps/app_agent_pool.c
+++ b/apps/app_agent_pool.c
@@ -1367,7 +1367,7 @@ static struct ast_bridge *bridge_agent_hold_new(void)
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;
}
diff --git a/apps/app_bridgewait.c b/apps/app_bridgewait.c
index aa83e0b70..222c9d9be 100644
--- a/apps/app_bridgewait.c
+++ b/apps/app_bridgewait.c
@@ -361,7 +361,7 @@ static struct wait_bridge_wrapper *get_wait_bridge_wrapper(const char *bridge_na
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;
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index 8eef4caaa..afc763b23 100644
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -171,7 +171,7 @@ static int chanavail_exec(struct ast_channel *chan, const char *data)
}
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);
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 10cfb096f..d2e38bd7f 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -691,7 +691,7 @@ static int conf_start_record(struct confbridge_conference *conference)
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) {
@@ -1219,7 +1219,7 @@ static struct confbridge_conference *join_conference_bridge(const char *conferen
/* 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;
@@ -1371,7 +1371,7 @@ static int alloc_playback_chan(struct confbridge_conference *conference)
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) {
diff --git a/apps/app_dial.c b/apps/app_dial.c
index ce73e9a19..3b7434608 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -873,7 +873,7 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
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);
@@ -2429,7 +2429,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
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",
diff --git a/apps/app_followme.c b/apps/app_followme.c
index 317100106..1fb22b185 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -1056,7 +1056,7 @@ static struct ast_channel *findmeexec(struct fm_args *tpargs, struct ast_channel
? "/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",
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 37053b3e6..9198ea654 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -1667,7 +1667,7 @@ static struct ast_conference *build_conf(const char *confno, const char *pin,
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 @@ static void meetme_menu_admin_extended(enum menu_modes *menu_mode, int *dtmf, st
}
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 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
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 @@ static int sla_ring_station(struct sla_ringing_trunk *ringing_trunk, struct sla_
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 @@ static void *dial_trunk(void *data)
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 @@ AST_TEST_DEFINE(test_meetme_data_provider)
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;
diff --git a/apps/app_originate.c b/apps/app_originate.c
index f924921d4..b196194e4 100644
--- a/apps/app_originate.c
+++ b/apps/app_originate.c
@@ -178,14 +178,14 @@ static int originate_exec(struct ast_channel *chan, const char *data)
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);
diff --git a/apps/app_page.c b/apps/app_page.c
index 31e75e445..f5e1460ed 100644
--- a/apps/app_page.c
+++ b/apps/app_page.c
@@ -351,7 +351,7 @@ static int page_exec(struct ast_channel *chan, const char *data)
}
/* 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;
diff --git a/apps/app_queue.c b/apps/app_queue.c
index cfd81b106..425ed89e9 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4058,7 +4058,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
}
/* 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 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
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",
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 44e88cb40..f86e4c1f9 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -13779,7 +13779,7 @@ AST_TEST_DEFINE(test_voicemail_vmsayname)
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;
}
diff --git a/apps/confbridge/conf_chan_announce.c b/apps/confbridge/conf_chan_announce.c
index 952ef988e..189a63218 100644
--- a/apps/confbridge/conf_chan_announce.c
+++ b/apps/confbridge/conf_chan_announce.c
@@ -77,7 +77,7 @@ static void announce_pvt_destructor(void *vdoomed)
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 @@ static struct ast_channel *announce_request(const char *type, struct ast_format_
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);
diff --git a/apps/confbridge/conf_chan_record.c b/apps/confbridge/conf_chan_record.c
index 78d1f272c..34de5af3b 100644
--- a/apps/confbridge/conf_chan_record.c
+++ b/apps/confbridge/conf_chan_record.c
@@ -53,13 +53,13 @@ static int rec_write(struct ast_channel *ast, struct ast_frame *f)
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) {