From 80ef9a21b9d91ff0bafc304923bc29effa230b00 Mon Sep 17 00:00:00 2001 From: Scott Griepentrog Date: Fri, 7 Mar 2014 15:47:55 +0000 Subject: 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 --- addons/chan_ooh323.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'addons/chan_ooh323.c') diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index 49821653b..bf465e20e 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -71,7 +71,7 @@ static struct ast_jb_conf global_jbconf; /* 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); @@ -363,7 +363,8 @@ static pthread_t monitor_thread = AST_PTHREADT_NULL; 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; @@ -378,7 +379,7 @@ static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state, 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); @@ -569,7 +570,7 @@ static struct ooh323_pvt *ooh323_alloc(int callref, char *callToken) Possible data values - peername, exten/peername, exten@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; @@ -718,7 +719,7 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca chan = ooh323_new(p, AST_STATE_DOWN, p->username, cap, - requestor ? ast_channel_linkedid(requestor) : NULL); + assignedids, requestor); ast_mutex_unlock(&p->lock); @@ -1918,7 +1919,7 @@ int ooh323_onReceivedSetup(ooCallData *call, Q931Message *pmsg) 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"); -- cgit v1.2.3