diff options
author | Jonathan Rose <jrose@digium.com> | 2012-06-26 21:45:22 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2012-06-26 21:45:22 +0000 |
commit | 5eb94d7ebbc2c29d4de8201103bcb62ae8afcd31 (patch) | |
tree | 454a727e077efa3f74ea80469d0f863066f59c13 /channels/chan_local.c | |
parent | ee1111869585af74ea79a0bf45edcee49c00508b (diff) |
Unique Call ID logging Phases III and IV
Adds call ID logging changes to specific channel drivers that weren't handled
handled in phase II of Call ID Logging. Also covers logging for threads for
threads created by systems that may be involved with many different calls.
Extra special thanks to Richard for rigorous review of chan_dahdi and its
various signalling modules.
review: https://reviewboard.asterisk.org/r/1927/
review: https://reviewboard.asterisk.org/r/1950/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r-- | channels/chan_local.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 3c5fca5de..695949fdc 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -1161,7 +1161,7 @@ static struct local_pvt *local_alloc(const char *data, struct ast_format_cap *ca } /*! \brief Start new local channel */ -static struct ast_channel *local_new(struct local_pvt *p, int state, const char *linkedid) +static struct ast_channel *local_new(struct local_pvt *p, int state, const char *linkedid, struct ast_callid *callid) { struct ast_channel *tmp = NULL, *tmp2 = NULL; int randnum = ast_random() & 0xffff; @@ -1192,6 +1192,11 @@ static struct ast_channel *local_new(struct local_pvt *p, int state, const char return NULL; } + if (callid) { + ast_channel_callid_set(tmp, callid); + ast_channel_callid_set(tmp2, callid); + } + ast_channel_tech_set(tmp, &local_tech); ast_channel_tech_set(tmp2, &local_tech); @@ -1233,13 +1238,15 @@ static struct ast_channel *local_request(const char *type, struct ast_format_cap { struct local_pvt *p; struct ast_channel *chan; + struct ast_callid *callid = ast_read_threadstorage_callid(); /* Allocate a new private structure and then Asterisk channel */ p = local_alloc(data, cap); if (!p) { - return NULL; + chan = NULL; + goto local_request_end; } - chan = local_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL); + chan = local_new(p, AST_STATE_DOWN, requestor ? ast_channel_linkedid(requestor) : NULL, callid); if (!chan) { ao2_unlink(locals, p); } else if (ast_channel_cc_params_init(chan, requestor ? ast_channel_get_cc_config_params((struct ast_channel *)requestor) : NULL)) { @@ -1252,6 +1259,12 @@ static struct ast_channel *local_request(const char *type, struct ast_format_cap } ao2_ref(p, -1); /* kill the ref from the alloc */ +local_request_end: + + if (callid) { + ast_callid_unref(callid); + } + return chan; } |