(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: https://origsvn.digium.com/svn/asterisk/trunk@114487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.1
Jeff Peeler 17 years ago
parent f773e294f1
commit 41fd7a6a21

@ -75,6 +75,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
"CallerIDName= %s\n"
"DNIDDigits= %s\n"
"RDNIS= %s\n"
"Parkinglot= %s\n"
"Language= %s\n"
"State= %s (%d)\n"
"Rings= %d\n"
@ -103,6 +104,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
S_OR(c->cid.cid_name, "(N/A)"),
S_OR(c->cid.cid_dnid, "(N/A)"),
S_OR(c->cid.cid_rdnis, "(N/A)"),
c->parkinglot,
c->language,
ast_state2str(c->_state),
c->_state,

@ -141,6 +141,8 @@ static struct console_pvt {
AST_STRING_FIELD(mohinterpret);
/*! Default language */
AST_STRING_FIELD(language);
/*! Default parkinglot */
AST_STRING_FIELD(parkinglot);
);
/*! Current channel for this device */
struct ast_channel *owner;
@ -1004,6 +1006,7 @@ static char *cli_list_devices(struct ast_cli_entry *e, int cmd, struct ast_cli_a
"=== ---> CallerID Name: %s\n"
"=== ---> MOH Interpret: %s\n"
"=== ---> Language: %s\n"
"=== ---> Parkinglot: %s\n"
"=== ---> Muted: %s\n"
"=== ---> Auto-Answer: %s\n"
"=== ---> Override Context: %s\n"
@ -1011,7 +1014,7 @@ static char *cli_list_devices(struct ast_cli_entry *e, int cmd, struct ast_cli_a
pvt->name, (pvt == active_pvt) ? "Yes" : "No",
pvt->input_device, pvt->output_device, pvt->context,
pvt->exten, pvt->cid_num, pvt->cid_name, pvt->mohinterpret,
pvt->language, pvt->muted ? "Yes" : "No", pvt->autoanswer ? "Yes" : "No",
pvt->language, pvt->parkinglot, pvt->muted ? "Yes" : "No", pvt->autoanswer ? "Yes" : "No",
pvt->overridecontext ? "Yes" : "No");
console_pvt_unlock(pvt);
@ -1236,6 +1239,7 @@ static void set_pvt_defaults(struct console_pvt *pvt)
ast_string_field_set(pvt, language, "");
ast_string_field_set(pvt, cid_num, "");
ast_string_field_set(pvt, cid_name, "");
ast_string_field_set(pvt, parkinglot, "");
pvt->overridecontext = 0;
pvt->autoanswer = 0;
@ -1248,6 +1252,7 @@ static void set_pvt_defaults(struct console_pvt *pvt)
ast_string_field_set(pvt, language, globals.language);
ast_string_field_set(pvt, cid_num, globals.cid_num);
ast_string_field_set(pvt, cid_name, globals.cid_name);
ast_string_field_set(pvt, parkinglot, globals.parkinglot);
pvt->overridecontext = globals.overridecontext;
pvt->autoanswer = globals.autoanswer;
@ -1287,6 +1292,7 @@ static void store_config_core(struct console_pvt *pvt, const char *var, const ch
CV_F("callerid", store_callerid(pvt, value));
CV_BOOL("overridecontext", pvt->overridecontext);
CV_BOOL("autoanswer", pvt->autoanswer);
CV_STRFIELD("parkinglot", pvt, parkinglot);
if (pvt != &globals) {
CV_F("active", set_active(pvt, value))

@ -142,6 +142,7 @@ struct gtalk {
int amaflags; /*!< AMA Flags */
char user[AJI_MAX_JIDLEN];
char context[AST_MAX_CONTEXT];
char parkinglot[AST_MAX_CONTEXT]; /*!< Parkinglot */
char accountcode[AST_MAX_ACCOUNT_CODE]; /*!< Account code */
int capability;
ast_group_t callgroup; /*!< Call group */
@ -1024,6 +1025,8 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i,
ast_string_field_set(tmp, language, client->language);
if (!ast_strlen_zero(client->musicclass))
ast_string_field_set(tmp, musicclass, client->musicclass);
if (!ast_strlen_zero(client->parkinglot))
ast_string_field_set(tmp, parkinglot, client->parkinglot);
i->owner = tmp;
ast_module_ref(ast_module_info->self);
ast_copy_string(tmp->context, client->context, sizeof(tmp->context));
@ -1794,6 +1797,8 @@ static int gtalk_create_member(char *label, struct ast_variable *var, int allowg
ast_parse_allow_disallow(&member->prefs, &member->capability, var->value, 1);
else if (!strcasecmp(var->name, "context"))
ast_copy_string(member->context, var->value, sizeof(member->context));
else if (!strcasecmp(var->name, "parkinglot"))
ast_copy_string(member->parkinglot, var->value, sizeof(member->parkinglot));
#if 0
else if (!strcasecmp(var->name, "candidate")) {
candidate = gtalk_create_candidate(var->value);
@ -1832,6 +1837,7 @@ static int gtalk_load_config(void)
char *cat = NULL;
struct ast_config *cfg = NULL;
char context[AST_MAX_CONTEXT];
char parkinglot[AST_MAX_CONTEXT];
int allowguest = 1;
struct ast_variable *var;
struct gtalk *member;
@ -1864,6 +1870,8 @@ static int gtalk_load_config(void)
ast_parse_allow_disallow(&prefs, &global_capability, var->value, 1);
else if (!strcasecmp(var->name, "context"))
ast_copy_string(context, var->value, sizeof(context));
else if (!strcasecmp(var->name, "parkinglot"))
ast_copy_string(parkinglot, var->value, sizeof(parkinglot));
else if (!strcasecmp(var->name, "bindaddr")) {
if (!(hp = ast_gethostbyname(var->value, &ahp))) {
ast_log(LOG_WARNING, "Invalid address: %s\n", var->value);
@ -1892,6 +1900,7 @@ static int gtalk_load_config(void)
ast_copy_string(member->name, "guest", sizeof(member->name));
ast_copy_string(member->user, "guest", sizeof(member->user));
ast_copy_string(member->context, context, sizeof(member->context));
ast_copy_string(member->parkinglot, parkinglot, sizeof(member->parkinglot));
member->allowguest = allowguest;
member->prefs = prefs;
while (var) {
@ -1904,6 +1913,9 @@ static int gtalk_load_config(void)
else if (!strcasecmp(var->name, "context"))
ast_copy_string(member->context, var->value,
sizeof(member->context));
else if (!strcasecmp(var->name, "parkinglot"))
ast_copy_string(member->parkinglot, var->value,
sizeof(member->parkinglot));
/* Idea to allow for custom candidates */
/*
else if (!strcasecmp(var->name, "candidate")) {

@ -26,6 +26,8 @@
* \arg \ref Config_iax
*
* \ingroup channel_drivers
*
* \todo Implement musicclass settings for IAX2 devices
*/
/*** MODULEINFO
@ -140,6 +142,7 @@ static int trunk_timed, trunk_untimed, trunk_maxmtu, trunk_nmaxmtu ; /*!< Trunk
static char context[80] = "default";
static char default_parkinglot[AST_MAX_CONTEXT];
static char language[MAX_LANGUAGE] = "";
static char regcontext[AST_MAX_CONTEXT] = "";
@ -298,6 +301,7 @@ struct iax2_user {
AST_STRING_FIELD(language);
AST_STRING_FIELD(cid_num);
AST_STRING_FIELD(cid_name);
AST_STRING_FIELD(parkinglot); /*!< Default parkinglot for device */
);
int authmethods;
@ -333,6 +337,7 @@ struct iax2_peer {
AST_STRING_FIELD(cid_num); /*!< Default context (for transfer really) */
AST_STRING_FIELD(cid_name); /*!< Default context (for transfer really) */
AST_STRING_FIELD(zonetag); /*!< Time Zone */
AST_STRING_FIELD(parkinglot); /*!< Default parkinglot for device */
);
struct ast_codec_pref prefs;
struct ast_dnsmgr_entry *dnsmgr; /*!< DNS refresh manager */
@ -580,6 +585,8 @@ struct chan_iax2_pvt {
AST_STRING_FIELD(mohsuggest);
/*! received OSP token */
AST_STRING_FIELD(osptoken);
/*! Default parkinglot */
AST_STRING_FIELD(parkinglot);
);
/*! permitted authentication methods */
@ -1555,6 +1562,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s
ast_string_field_set(iaxs[x], accountcode, accountcode);
ast_string_field_set(iaxs[x], mohinterpret, mohinterpret);
ast_string_field_set(iaxs[x], mohsuggest, mohsuggest);
ast_string_field_set(iaxs[x], parkinglot, default_parkinglot);
} else {
ast_log(LOG_WARNING, "Out of resources\n");
ast_mutex_unlock(&iaxsl[x]);
@ -2437,6 +2445,7 @@ static char *handle_cli_iax2_show_peer(struct ast_cli_entry *e, int cmd, struct
ast_cli(a->fd, " * Name : %s\n", peer->name);
ast_cli(a->fd, " Secret : %s\n", ast_strlen_zero(peer->secret) ? "<Not set>" : "<Set>");
ast_cli(a->fd, " Context : %s\n", peer->context);
ast_cli(a->fd, " Parking lot : %s\n", peer->parkinglot);
ast_cli(a->fd, " Mailbox : %s\n", peer->mailbox);
ast_cli(a->fd, " Dynamic : %s\n", ast_test_flag(peer, IAX_DYNAMIC) ? "Yes" : "No");
ast_cli(a->fd, " Callerid : %s\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, "<unspecified>"));
@ -3916,6 +3925,8 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
tmp->writeformat = ast_best_codec(capability);
tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
if (!ast_strlen_zero(i->parkinglot))
ast_string_field_set(tmp, parkinglot, i->parkinglot);
/* Don't use ast_set_callerid() here because it will
* generate a NewCallerID event before the NewChannel event */
if (!ast_strlen_zero(i->ani))
@ -5739,6 +5750,8 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies
ast_string_field_set(iaxs[callno], mohinterpret, user->mohinterpret);
if (!ast_strlen_zero(user->mohsuggest))
ast_string_field_set(iaxs[callno], mohsuggest, user->mohsuggest);
if (!ast_strlen_zero(user->parkinglot))
ast_string_field_set(iaxs[callno], parkinglot, user->parkinglot);
if (user->amaflags)
iaxs[callno]->amaflags = user->amaflags;
if (!ast_strlen_zero(user->language))
@ -10421,6 +10434,8 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, st
ast_string_field_set(user, mohinterpret, v->value);
} else if (!strcasecmp(v->name, "mohsuggest")) {
ast_string_field_set(user, mohsuggest, v->value);
} else if (!strcasecmp(v->name, "parkinglot")) {
ast_string_field_set(user, parkinglot, v->value);
} else if (!strcasecmp(v->name, "language")) {
ast_string_field_set(user, language, v->value);
} else if (!strcasecmp(v->name, "amaflags")) {
@ -10622,6 +10637,8 @@ static int set_config(char *config_file, int reload)
#ifdef SO_NO_CHECK
nochecksums = 0;
#endif
/* Reset default parking lot */
default_parkinglot[0] = '\0';
min_reg_expire = IAX_DEFAULT_REG_EXPIRE;
max_reg_expire = IAX_DEFAULT_REG_EXPIRE;
@ -10818,6 +10835,8 @@ static int set_config(char *config_file, int reload)
} else if (!strcasecmp(v->name, "cos")) {
if (ast_str2cos(v->value, &cos))
ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "parkinglot")) {
ast_copy_string(default_parkinglot, v->value, sizeof(default_parkinglot));
} else if (!strcasecmp(v->name, "accountcode")) {
ast_copy_string(accountcode, v->value, sizeof(accountcode));
} else if (!strcasecmp(v->name, "mohinterpret")) {

@ -151,6 +151,7 @@ struct jingle {
int allowguest;
char language[MAX_LANGUAGE]; /*!< Default language for prompts */
char musicclass[MAX_MUSICCLASS]; /*!< Music on Hold class */
char parkinglot[AST_MAX_CONTEXT]; /*!< Parkinglot */
};
struct jingle_container {
@ -1741,6 +1742,9 @@ static int jingle_load_config(void)
else if (!strcasecmp(var->name, "context"))
ast_copy_string(member->context, var->value,
sizeof(member->context));
else if (!strcasecmp(var->name, "parkinglot"))
ast_copy_string(member->parkinglot, var->value,
sizeof(member->parkinglot));
/* Idea to allow for custom candidates */
/*
else if (!strcasecmp(var->name, "candidate")) {

@ -143,6 +143,7 @@ static char context[AST_MAX_EXTENSION] = "default";
static char language[MAX_LANGUAGE] = "";
static char musicclass[MAX_MUSICCLASS] = "";
static char parkinglot[AST_MAX_CONTEXT];
static char cid_num[AST_MAX_EXTENSION] = "";
static char cid_name[AST_MAX_EXTENSION] = "";
@ -317,6 +318,7 @@ struct mgcp_endpoint {
char musicclass[MAX_MUSICCLASS];
char curtone[80]; /*!< Current tone */
char mailbox[AST_MAX_EXTENSION];
char parkinglot[AST_MAX_CONTEXT]; /*!< Parkinglot */
struct ast_event_sub *mwi_event_sub;
ast_group_t callgroup;
ast_group_t pickupgroup;
@ -3685,6 +3687,8 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
}
} else if (!strcasecmp(v->name, "musiconhold")) {
ast_copy_string(musicclass, v->value, sizeof(musicclass));
} else if (!strcasecmp(v->name, "parkinglot")) {
ast_copy_string(parkinglot, v->value, sizeof(parkinglot));
} else if (!strcasecmp(v->name, "callgroup")) {
cur_callergroup = ast_get_group(v->value);
} else if (!strcasecmp(v->name, "pickupgroup")) {
@ -3748,6 +3752,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
ast_copy_string(e->language, language, sizeof(e->language));
ast_copy_string(e->musicclass, musicclass, sizeof(e->musicclass));
ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox));
ast_copy_string(e->parkinglot, parkinglot, sizeof(e->parkinglot));
if (!ast_strlen_zero(e->mailbox)) {
char *mailbox, *context;
context = mailbox = ast_strdupa(e->mailbox);
@ -3856,6 +3861,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
ast_copy_string(e->language, language, sizeof(e->language));
ast_copy_string(e->musicclass, musicclass, sizeof(e->musicclass));
ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox));
ast_copy_string(e->parkinglot, parkinglot, sizeof(e->parkinglot));
if (!ast_strlen_zero(mailbox)) {
ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, gw->name, e->name);
}

@ -663,6 +663,7 @@ static char default_vmexten[AST_MAX_EXTENSION];
static char default_mohinterpret[MAX_MUSICCLASS]; /*!< Global setting for moh class to use when put on hold */
static char default_mohsuggest[MAX_MUSICCLASS]; /*!< Global setting for moh class to suggest when putting
* a bridged channel on hold */
static char default_parkinglot[AST_MAX_CONTEXT]; /*!< Parkinglot */
static int default_maxcallbitrate; /*!< Maximum bitrate for call */
static struct ast_codec_pref default_prefs; /*!< Default codec prefs */
@ -1219,6 +1220,7 @@ struct sip_pvt {
AST_STRING_FIELD(rpid); /*!< Our RPID header */
AST_STRING_FIELD(rpid_from); /*!< Our RPID From header */
AST_STRING_FIELD(url); /*!< URL to be sent with next message to peer */
AST_STRING_FIELD(parkinglot); /*!< Parkinglot */
);
struct sip_socket socket; /*!< The socket used for this dialog */
unsigned int ocseq; /*!< Current outgoing seqno */
@ -1405,6 +1407,7 @@ struct sip_user {
char language[MAX_LANGUAGE]; /*!< Default language for this user */
char mohinterpret[MAX_MUSICCLASS];/*!< Music on Hold class */
char mohsuggest[MAX_MUSICCLASS];/*!< Music on Hold class */
char parkinglot[AST_MAX_CONTEXT];/*!< Parkinglot */
char useragent[256]; /*!< User agent in SIP request */
struct ast_codec_pref prefs; /*!< codec prefs */
ast_group_t callgroup; /*!< Call group */
@ -1474,6 +1477,7 @@ struct sip_peer {
char language[MAX_LANGUAGE]; /*!< Default language for prompts */
char mohinterpret[MAX_MUSICCLASS];/*!< Music on Hold class */
char mohsuggest[MAX_MUSICCLASS];/*!< Music on Hold class */
char parkinglot[AST_MAX_CONTEXT];/*!< Parkinglot */
char useragent[256]; /*!< User agent in SIP request (saved from registration) */
struct ast_codec_pref prefs; /*!< codec prefs */
int lastmsgssent;
@ -4246,6 +4250,7 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
ast_string_field_set(dialog, tohost, peer->tohost);
ast_string_field_set(dialog, fullcontact, peer->fullcontact);
ast_string_field_set(dialog, context, peer->context);
ast_string_field_set(dialog, parkinglot, peer->parkinglot);
dialog->outboundproxy = obproxy_get(dialog, peer);
dialog->callgroup = peer->callgroup;
dialog->pickupgroup = peer->pickupgroup;
@ -6076,6 +6081,7 @@ static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *si
p->t38.jointcapability = p->t38.capability;
}
ast_string_field_set(p, context, default_context);
ast_string_field_set(p, parkinglot, default_parkinglot);
/* Add to active dialog list */
@ -11578,6 +11584,7 @@ static enum check_auth_result check_user_ok(struct sip_pvt *p, char *of,
ast_string_field_set(p, language, user->language);
ast_string_field_set(p, mohsuggest, user->mohsuggest);
ast_string_field_set(p, mohinterpret, user->mohinterpret);
ast_string_field_set(p, parkinglot, user->parkinglot);
p->allowtransfer = user->allowtransfer;
p->amaflags = user->amaflags;
p->callgroup = user->callgroup;
@ -11665,6 +11672,7 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
ast_string_field_set(p, subscribecontext, peer->subscribecontext);
ast_string_field_set(p, mohinterpret, peer->mohinterpret);
ast_string_field_set(p, mohsuggest, peer->mohsuggest);
ast_string_field_set(p, parkinglot, peer->parkinglot);
if (peer->callingpres) /* Peer calling pres setting will override RPID */
p->callingpres = peer->callingpres;
if (peer->maxms && peer->lastms)
@ -20484,6 +20492,8 @@ static struct sip_user *build_user(const char *name, struct ast_variable *v, str
user->callgroup = ast_get_group(v->value);
} else if (!strcasecmp(v->name, "pickupgroup")) {
user->pickupgroup = ast_get_group(v->value);
} else if (!strcasecmp(v->name, "parkinglot")) {
ast_copy_string(user->parkinglot, v->value, sizeof(user->parkinglot));
} else if (!strcasecmp(v->name, "language")) {
ast_copy_string(user->language, v->value, sizeof(user->language));
} else if (!strcasecmp(v->name, "mohinterpret")) {
@ -20861,6 +20871,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
ast_copy_string(peer->mohinterpret, v->value, sizeof(peer->mohinterpret));
} else if (!strcasecmp(v->name, "mohsuggest")) {
ast_copy_string(peer->mohsuggest, v->value, sizeof(peer->mohsuggest));
} else if (!strcasecmp(v->name, "parkinglot")) {
ast_copy_string(peer->parkinglot, v->value, sizeof(peer->parkinglot));
} else if (!strcasecmp(v->name, "mailbox")) {
add_peer_mailboxes(peer, v->value);
} else if (!strcasecmp(v->name, "subscribemwi")) {

@ -968,6 +968,7 @@ static char mohsuggest[MAX_MUSICCLASS] = "";
static char cid_num[AST_MAX_EXTENSION] = "";
static char cid_name[AST_MAX_EXTENSION] = "";
static char linelabel[AST_MAX_EXTENSION] ="";
static char parkinglot[AST_MAX_CONTEXT] ="";
static int nat = 0;
static ast_group_t cur_callergroup = 0;
static ast_group_t cur_pickupgroup = 0;
@ -1162,6 +1163,7 @@ struct skinny_line {
char vmexten[AST_MAX_EXTENSION];
char regexten[AST_MAX_EXTENSION]; /* Extension for auto-extensions */
char regcontext[AST_MAX_CONTEXT]; /* Context for auto-extensions */
char parkinglot[AST_MAX_CONTEXT]; /* Parkinglot for parkedcalls */
char mohinterpret[MAX_MUSICCLASS];
char mohsuggest[MAX_MUSICCLASS];
char lastnumberdialed[AST_MAX_EXTENSION]; /* Last number that was dialed - used for redial */
@ -3024,6 +3026,8 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
ast_copy_string(linelabel, v->value, sizeof(linelabel));
} else if (!strcasecmp(v->name, "setvar")) {
chanvars = add_var(v->value, chanvars);
} else if ( !strcasecmp(v->name, "parkinglot")) {
ast_copy_string(parkinglot, v->value, sizeof(parkinglot));
} else if (!strcasecmp(v->name, "speeddial")) {
if (!(sd = ast_calloc(1, sizeof(*sd)))) {
return NULL;
@ -3077,6 +3081,7 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
ast_copy_string(l->cid_num, cid_num, sizeof(l->cid_num));
ast_copy_string(l->cid_name, cid_name, sizeof(l->cid_name));
ast_copy_string(l->label, linelabel, sizeof(l->label));
ast_copy_string(l->parkinglot, parkinglot, sizeof(l->parkinglot));
ast_copy_string(l->language, language, sizeof(l->language));
ast_copy_string(l->mohinterpret, mohinterpret, sizeof(l->mohinterpret));
ast_copy_string(l->mohsuggest, mohsuggest, sizeof(l->mohsuggest));

@ -404,6 +404,8 @@ struct unistim_line {
int amaflags;
/*! Codec supported */
int capability;
/*! Parkinglot */
char parkinglot[AST_MAX_CONTEXT];
struct unistim_line *next;
struct unistim_device *parent;
};
@ -5111,6 +5113,8 @@ static struct unistim_device *build_device(const char *cat, const struct ast_var
l->pickupgroup = ast_get_group(v->value);
else if (!strcasecmp(v->name, "mailbox"))
ast_copy_string(l->mailbox, v->value, sizeof(l->mailbox));
else if (!strcasecmp(v->name, "parkinglot"))
ast_copy_string(l->parkinglot, v->value, sizeof(l->parkinglot));
else if (!strcasecmp(v->name, "linelabel"))
unquote(linelabel, v->value, sizeof(linelabel) - 1);
else if (!strcasecmp(v->name, "extension")) {

@ -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);

@ -3,10 +3,11 @@
;
[general]
parkext => 700 ; What extension to dial to park
parkpos => 701-720 ; What extensions to park calls on. These needs to be
; numeric, as Asterisk starts from the start position
parkext => 700 ; What extension to dial to park (all parking lots)
parkpos => 701-720 ; What extensions to park calls on. (defafult parking lot)
; These needs to be numeric, as Asterisk starts from the start position
; and increments with one for the next parked call.
context => parkedcalls ; Which context parked calls are in (default parking lot)
context => parkedcalls ; Which context parked calls are in
;parkingtime => 45 ; Number of seconds a call can be parked for
; (default is 45 seconds)
@ -46,6 +47,7 @@ context => parkedcalls ; Which context parked calls are in
; They can not be used while the remote party is ringing or in progress. If you require this feature you can use
; chan_local in combination with Answer to accomplish it.
[featuremap]
;blindxfer => #1 ; Blind transfer (default is #)
;disconnect => *0 ; Disconnect (default is *)
@ -87,6 +89,7 @@ context => parkedcalls ; Which context parked calls are in
; channel waits for the feature to complete. If left blank,
; no music will be played.
;
;
; IMPORTANT NOTE: The applicationmap is not intended to be used for all Asterisk
; applications. When applications are used in extensions.conf, they are executed
@ -108,20 +111,21 @@ context => parkedcalls ; Which context parked calls are in
;unpauseMonitor => #3,self/callee,UnPauseMonitor ;Allow the callee to unpause monitoring
; ;on their channel
;
;*** Define another parking lot
;
; You can set parkinglot with the CHANNEL dialplan function
; or configure it in the device configuration in the channel
;
;[parkinglot_edvina]
;context => edvinapark
;parkpos => 800-850
;findslot => next
; GROUPS
; Groups are groupings of features defined in [applicationmap]
; that can have their own key mappings.
;
; Groups are defined as a configuration section,
; and can be set as part of DYNAMIC_FEATURES in
; the same way that a normal feature can...
; etc:
;
; Set(DYNAMIC_FEATURES=myGroupName);
;
; example:
; [myGroupName] ; defines the group named myGroupName
; testfeature => #9 ; associates testfeature with the group and the keycode #9
; pauseMonitor ; associates pauseMonitor with the group and the keycode
; ; defined in [applicationmap]

@ -286,6 +286,10 @@ autokill=yes
; has expired based on its registration interval, used the stored
; address information regardless. (yes|no)
;parkinglot=edvina ; Default parkinglot for IAX peers and users
; This can also be configured per device
; Parkinglots are defined in features.conf
; Guest sections for unauthenticated connection attempts. Just specify an
; empty secret, or provide no secret section.
;

@ -195,6 +195,9 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;
;mohsuggest=default
;
;parkinglot=plaza ; Sets the default parking lot for call parking
; This may also be set for individual users/peers
; Parkinglots are configured in features.conf
;language=en ; Default language setting for all users/peers
; This may also be set for individual users/peers
;relaxdtmf=yes ; Relax dtmf handling

@ -84,6 +84,8 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
locked_copy_string(chan, buf, chan->language, len);
else if (!strcasecmp(data, "musicclass"))
locked_copy_string(chan, buf, chan->musicclass, len);
else if (!strcasecmp(data, "parkinglot"))
locked_copy_string(chan, buf, chan->parkinglot, len);
else if (!strcasecmp(data, "state"))
locked_copy_string(chan, buf, ast_state2str(chan->_state), len);
else if (!strcasecmp(data, "channeltype"))
@ -110,6 +112,8 @@ static int func_channel_write(struct ast_channel *chan, const char *function,
if (!strcasecmp(data, "language"))
locked_string_field_set(chan, language, value);
else if (!strcasecmp(data, "parkinglot"))
locked_string_field_set(chan, parkinglot, value);
else if (!strcasecmp(data, "musicclass"))
locked_string_field_set(chan, musicclass, value);
#ifdef CHANNEL_TRACE
@ -172,6 +176,7 @@ static struct ast_custom_function channel_function = {
"R/O channeltype technology used for channel\n"
"R/W language language for sounds played\n"
"R/W musicclass class (from musiconhold.conf) for hold music\n"
"R/W parkinglot parkinglot for parking\n"
"R/W rxgain set rxgain level on channel drivers that support it\n"
"R/O state state for channel\n"
"R/W tonezone zone for indications played\n"

@ -434,6 +434,7 @@ struct ast_channel {
AST_STRING_FIELD(accountcode); /*!< Account code for billing */
AST_STRING_FIELD(call_forward); /*!< Where to forward to if asked to dial on this interface */
AST_STRING_FIELD(uniqueid); /*!< Unique Channel Identifier */
AST_STRING_FIELD(parkinglot); /*! Default parking lot, if empty, default parking lot */
);
int fds[AST_MAX_FDS]; /*!< File descriptors for channel -- Drivers will poll on

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save