summaryrefslogtreecommitdiff
path: root/channels/chan_vpb.cc
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 /channels/chan_vpb.cc
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 'channels/chan_vpb.cc')
-rw-r--r--channels/chan_vpb.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/channels/chan_vpb.cc b/channels/chan_vpb.cc
index 5ea24ccc1..f1a45ab63 100644
--- a/channels/chan_vpb.cc
+++ b/channels/chan_vpb.cc
@@ -347,9 +347,9 @@ static struct vpb_pvt {
} *iflist = NULL;
-static struct ast_channel *vpb_new(struct vpb_pvt *i, enum ast_channel_state state, const char *context, const char *linkedid);
+static struct ast_channel *vpb_new(struct vpb_pvt *i, enum ast_channel_state state, const char *context, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor);
static void *do_chanreads(void *pvt);
-static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static struct ast_channel *vpb_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 vpb_digit_begin(struct ast_channel *ast, char digit);
static int vpb_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
static int vpb_call(struct ast_channel *ast, const char *dest, int timeout);
@@ -1118,7 +1118,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
break;
case VPB_RING:
if (p->mode == MODE_FXO) /* FXO port ring, start * */ {
- vpb_new(p, AST_STATE_RING, p->context, NULL);
+ vpb_new(p, AST_STATE_RING, p->context, NULL, NULL);
if (UsePolarityCID != 1) {
if (p->callerid_type == 1) {
ast_verb(4, "Using VPB Caller ID\n");
@@ -1142,7 +1142,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
case VPB_STATION_OFFHOOK:
if (p->mode == MODE_IMMEDIATE) {
- vpb_new(p,AST_STATE_RING, p->context, NULL);
+ vpb_new(p,AST_STATE_RING, p->context, NULL, NULL);
} else {
ast_verb(4, "%s: handle_notowned: playing dialtone\n", p->dev);
playtone(p->handle, &Dialtone);
@@ -1187,7 +1187,7 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
if (ast_exists_extension(NULL, p->context, p->ext, 1, p->callerid)){
ast_verb(4, "%s: handle_notowned: DTMF IDD timer out, matching on [%s] in [%s]\n", p->dev, p->ext, p->context);
- vpb_new(p, AST_STATE_RING, p->context, NULL);
+ vpb_new(p, AST_STATE_RING, p->context, NULL, NULL);
}
} else if (e->data == p->ring_timer_id) {
/* We didnt get another ring in time! */
@@ -1263,11 +1263,11 @@ static inline int monitor_handle_notowned(struct vpb_pvt *p, VPB_EVENT *e)
vpb_timer_start(p->dtmfidd_timer);
} else {
ast_verb(4, "%s: handle_notowned: Matched on [%s] in [%s]\n", p->dev, p->ext , p->context);
- vpb_new(p, AST_STATE_UP, p->context, NULL);
+ vpb_new(p, AST_STATE_UP, p->context, NULL, NULL);
}
} else if (!ast_canmatch_extension(NULL, p->context, p->ext, 1, p->callerid)) {
if (ast_exists_extension(NULL, "default", p->ext, 1, p->callerid)) {
- vpb_new(p, AST_STATE_UP, "default", NULL);
+ vpb_new(p, AST_STATE_UP, "default", NULL, NULL);
} else if (!ast_canmatch_extension(NULL, "default", p->ext, 1, p->callerid)) {
ast_verb(4, "%s: handle_notowned: can't match anything in %s or default\n", p->dev, p->context);
playtone(p->handle, &Busytone);
@@ -2424,7 +2424,7 @@ static void *do_chanreads(void *pvt)
return NULL;
}
-static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state state, const char *context, const char *linkedid)
+static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state state, const char *context, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
{
struct ast_channel *tmp;
char cid_num[256];
@@ -2437,7 +2437,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st
}
ast_verb(4, "%s: New call for context [%s]\n", me->dev, context);
- tmp = ast_channel_alloc(1, state, 0, 0, "", me->ext, me->context, linkedid, AST_AMA_NONE, "%s", me->dev);
+ tmp = ast_channel_alloc(1, state, 0, 0, "", me->ext, me->context, assignedids, requestor, AST_AMA_NONE, "%s", me->dev);
if (tmp) {
if (use_ast_ind == 1){
ast_channel_tech_set(tmp, &vpb_tech_indicate);
@@ -2501,7 +2501,7 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st
return tmp;
}
-static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
+static struct ast_channel *vpb_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 vpb_pvt *p;
struct ast_channel *tmp = NULL;
@@ -2534,13 +2534,13 @@ static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *
if (group == -1) {
if (strncmp(s, p->dev + 4, sizeof p->dev) == 0) {
if (!p->owner) {
- tmp = vpb_new(p, AST_STATE_DOWN, p->context, requestor ? ast_channel_linkedid(requestor) : NULL);
+ tmp = vpb_new(p, AST_STATE_DOWN, p->context, assignedids, requestor);
break;
}
}
} else {
if ((p->group == group) && (!p->owner)) {
- tmp = vpb_new(p, AST_STATE_DOWN, p->context, requestor ? ast_channel_linkedid(requestor) : NULL);
+ tmp = vpb_new(p, AST_STATE_DOWN, p->context, assignedids, requestor);
break;
}
}