summaryrefslogtreecommitdiff
path: root/res/res_ari_channels.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-12-09 15:45:19 +0000
committerJoshua Colp <jcolp@digium.com>2014-12-09 15:45:19 +0000
commit60ab564ad2aa326fddb3fb5e8ec582ef3d1db666 (patch)
treefd6336471df3225d81eaf2cdcbb057f84bac24f2 /res/res_ari_channels.c
parentb6e18cae5ca7f3aedc313849d15573c2ea21f3cb (diff)
ari: Add support for specifying an originator channel when originating.
If an originator channel is specified when originating a channel the linked ID of it will be applied to the newly originated outgoing channel. This allows an association to be made between the two so it is known that the originator has dialed the originated channel. ASTERISK-24552 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/4243/ ........ Merged revisions 429153 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_ari_channels.c')
-rw-r--r--res/res_ari_channels.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/res/res_ari_channels.c b/res/res_ari_channels.c
index 08edc64dc..8cc25f1d8 100644
--- a/res/res_ari_channels.c
+++ b/res/res_ari_channels.c
@@ -148,6 +148,10 @@ int ast_ari_channels_originate_parse_body(
if (field) {
args->other_channel_id = ast_json_string_get(field);
}
+ field = ast_json_object_get(body, "originator");
+ if (field) {
+ args->originator = ast_json_string_get(field);
+ }
return 0;
}
@@ -202,6 +206,9 @@ static void ast_ari_channels_originate_cb(
if (strcmp(i->name, "otherChannelId") == 0) {
args.other_channel_id = (i->value);
} else
+ if (strcmp(i->name, "originator") == 0) {
+ args.originator = (i->value);
+ } else
{}
}
/* Look for a JSON request entity */
@@ -354,6 +361,10 @@ int ast_ari_channels_originate_with_id_parse_body(
if (field) {
args->other_channel_id = ast_json_string_get(field);
}
+ field = ast_json_object_get(body, "originator");
+ if (field) {
+ args->originator = ast_json_string_get(field);
+ }
return 0;
}
@@ -405,6 +416,9 @@ static void ast_ari_channels_originate_with_id_cb(
if (strcmp(i->name, "otherChannelId") == 0) {
args.other_channel_id = (i->value);
} else
+ if (strcmp(i->name, "originator") == 0) {
+ args.originator = (i->value);
+ } else
{}
}
for (i = path_vars; i; i = i->next) {