aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-21 23:42:45 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-21 23:42:45 +0000
commit11ee51ef7d28a6019c81983cfda30d09a9d1064f (patch)
tree5ea0c0e4501835ff0a5f3ba5d5857d07de851abb /channels/chan_zap.c
parent78694457f4e5ac131cea1b30ae1c47c1554e0817 (diff)
(closes issue #6113)
Reported by: oej Tested by: jpeeler This patch implements multiple parking lots for parked calls. The default parkinglot is used by default, however setting the channel variable PARKINGLOT in the dialplan will allow use of any other configured parkinglot. See configs/features.conf.sample for more details on setting up another non-default parkinglot. Also, one can (currently) set the default parkinglot to use in the driver configuration file via the parkinglot option. Patch initially written by oej, brought up to date and finalized by mvanbaak, and then stabilized and converted to astobj2 by me. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114487 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index def1015f8..927275d8b 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -237,6 +237,8 @@ static const char config[] = "zapata.conf";
static char defaultcic[64] = "";
static char defaultozz[64] = "";
+static char parkinglot[AST_MAX_EXTENSION] = ""; /*!< Default parking lot for this channel */
+
/*! Run this script when the MWI state changes on an FXO line, if mwimonitor is enabled */
static char mwimonitornotify[PATH_MAX] = "";
@@ -595,6 +597,7 @@ static struct zt_pvt {
char language[MAX_LANGUAGE];
char mohinterpret[MAX_MUSICCLASS];
char mohsuggest[MAX_MUSICCLASS];
+ char parkinglot[AST_MAX_EXTENSION]; /*!< Parking lot for this channel */
#if defined(PRI_ANI) || defined(HAVE_SS7)
char cid_ani[AST_MAX_EXTENSION];
#endif
@@ -777,6 +780,7 @@ static struct zt_chan_conf zt_chan_conf_default(void) {
.cid_name = "",
.mohinterpret = "default",
.mohsuggest = "",
+ .parkinglot = "",
.transfertobusy = 1,
.cid_signalling = CID_SIG_BELL,
@@ -5963,6 +5967,8 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
tmp->callgroup = i->callgroup;
tmp->pickupgroup = i->pickupgroup;
}
+ if (!ast_strlen_zero(i->parkinglot))
+ ast_string_field_set(tmp, parkinglot, i->parkinglot);
if (!ast_strlen_zero(i->language))
ast_string_field_set(tmp, language, i->language);
if (!i->owner)
@@ -8077,6 +8083,7 @@ static struct zt_pvt *mkintf(int channel, struct zt_chan_conf conf, struct zt_pr
struct zt_bufferinfo bi;
#endif
struct zt_spaninfo si;
+
int res;
int span=0;
int here = 0;
@@ -8493,6 +8500,7 @@ static struct zt_pvt *mkintf(int channel, struct zt_chan_conf conf, struct zt_pr
ast_copy_string(tmp->mohsuggest, conf.chan.mohsuggest, sizeof(tmp->mohsuggest));
ast_copy_string(tmp->context, conf.chan.context, sizeof(tmp->context));
ast_copy_string(tmp->cid_num, conf.chan.cid_num, sizeof(tmp->cid_num));
+ ast_copy_string(tmp->parkinglot, conf.chan.parkinglot, sizeof(tmp->parkinglot));
tmp->cid_ton = 0;
ast_copy_string(tmp->cid_name, conf.chan.cid_name, sizeof(tmp->cid_name));
ast_copy_string(tmp->mailbox, conf.chan.mailbox, sizeof(tmp->mailbox));
@@ -13258,12 +13266,17 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r
const char *ringc; /* temporary string for parsing the dring number. */
int y;
int found_pseudo = 0;
- char zapchan[MAX_CHANLIST_LEN] = {};
+ char zapchan[MAX_CHANLIST_LEN] = {};
for (; v; v = v->next) {
if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
continue;
+ /* must have parkinglot in confp before build_channels is called */
+ if (!strcasecmp(v->name, "parkinglot")) {
+ ast_copy_string(confp->chan.parkinglot, v->value, sizeof(confp->chan.parkinglot));
+ }
+
/* Create the interface list */
if (!strcasecmp(v->name, "channel")
#ifdef HAVE_PRI
@@ -13424,6 +13437,8 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r
ast_copy_string(confp->chan.mohinterpret, v->value, sizeof(confp->chan.mohinterpret));
} else if (!strcasecmp(v->name, "mohsuggest")) {
ast_copy_string(confp->chan.mohsuggest, v->value, sizeof(confp->chan.mohsuggest));
+ } else if (!strcasecmp(v->name, "parkinglot")) {
+ ast_copy_string(parkinglot, v->value, sizeof(parkinglot));
} else if (!strcasecmp(v->name, "stripmsd")) {
ast_log(LOG_NOTICE, "Configuration option \"%s\" has been deprecated. Please use dialplan instead\n", v->name);
confp->chan.stripmsd = atoi(v->value);