aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-15 19:22:15 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-15 19:22:15 +0000
commit70546b85ab7d34d156bf3107ddc7eb52e016ab69 (patch)
tree8fc9b889f36af46092a7469f154dce801bd4b697 /channels/chan_iax2.c
parent875423271150e62e0c6d568fd54abb1c87f5c3f8 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.8@286931 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index e4ff58773..b5eee3ba8 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);