diff options
author | Jeff Peeler <jpeeler@digium.com> | 2010-09-15 19:23:56 +0000 |
---|---|---|
committer | Jeff Peeler <jpeeler@digium.com> | 2010-09-15 19:23:56 +0000 |
commit | 41b95ee88728d442d9adf1fc25401d8b4cdfaa13 (patch) | |
tree | eac807014078cdc6681fa76461861b01116785d4 /channels/chan_iax2.c | |
parent | b3fa5ec3be50368e0ad740641eee8ca2eeb0f19a (diff) |
Merged revisions 286931 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r286931 | jpeeler | 2010-09-15 14:22:15 -0500 (Wed, 15 Sep 2010) | 16 lines
Add parking extension for non-default parking lots.
This is a new feature that allows for parking to custom parking lots to be
accessed directly, rather than with channel variables or by changing the
default parking lot. The extension is set with the parkext option just as the
default parking lot is done. Also, the manager action has been updated to
optionally allow a specified parking lot.
(closes issue #14882)
Reported by: vmikhnevych
Patches:
patch_14882.txt uploaded by mnick (license 874)
modified by me
Review: https://reviewboard.asterisk.org/r/884/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@286939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index f28bb7fcc..9e6d4c6a5 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -9112,7 +9112,7 @@ static void dp_lookup(int callno, const char *context, const char *callednum, co memset(&ied1, 0, sizeof(ied1)); mm = ast_matchmore_extension(NULL, context, callednum, 1, callerid); /* Must be started */ - if (!strcmp(callednum, ast_parking_ext()) || ast_exists_extension(NULL, context, callednum, 1, callerid)) { + if (ast_parking_ext_valid(callednum, NULL, context) || ast_exists_extension(NULL, context, callednum, 1, callerid)) { dpstatus = IAX_DPSTATUS_EXISTS; } else if (ast_canmatch_extension(NULL, context, callednum, 1, callerid)) { dpstatus = IAX_DPSTATUS_CANEXIST; @@ -9167,6 +9167,7 @@ static void spawn_dp_lookup(int callno, const char *context, const char *calledn struct iax_dual { struct ast_channel *chan1; struct ast_channel *chan2; + const char *parkexten; }; static void *iax_park_thread(void *stuff) @@ -9183,13 +9184,13 @@ static void *iax_park_thread(void *stuff) f = ast_read(chan1); if (f) ast_frfree(f); - res = ast_park_call(chan1, chan2, 0, &ext); + res = ast_park_call(chan1, chan2, 0, d->parkexten, &ext); ast_hangup(chan2); ast_log(LOG_NOTICE, "Parked on extension '%d'\n", ext); return NULL; } -static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2) +static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2, const char *parkexten) { struct iax_dual *d; struct ast_channel *chan1m, *chan2m; @@ -9231,6 +9232,7 @@ static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2) if ((d = ast_calloc(1, sizeof(*d)))) { d->chan1 = chan1m; d->chan2 = chan2m; + d->parkexten = parkexten; if (!ast_pthread_create_detached_background(&th, NULL, iax_park_thread, d)) { return 0; } @@ -10604,10 +10606,10 @@ retryowner: } pbx_builtin_setvar_helper(bridged_chan, "BLINDTRANSFER", iaxs[fr->callno]->owner->name); - if (!strcmp(ies.called_number, ast_parking_ext())) { + if (ast_parking_ext_valid(ies.called_number, c, iaxs[fr->callno]->context)) { struct ast_channel *saved_channel = iaxs[fr->callno]->owner; ast_mutex_unlock(&iaxsl[fr->callno]); - if (iax_park(bridged_chan, saved_channel)) { + if (iax_park(bridged_chan, saved_channel, ies.called_number)) { ast_log(LOG_WARNING, "Failed to park call on '%s'\n", bridged_chan->name); } else { ast_debug(1, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name); |