diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_console.c | 8 | ||||
-rw-r--r-- | channels/chan_gtalk.c | 12 | ||||
-rw-r--r-- | channels/chan_iax2.c | 19 | ||||
-rw-r--r-- | channels/chan_jingle.c | 4 | ||||
-rw-r--r-- | channels/chan_mgcp.c | 6 | ||||
-rw-r--r-- | channels/chan_sip.c | 12 | ||||
-rw-r--r-- | channels/chan_skinny.c | 5 | ||||
-rw-r--r-- | channels/chan_unistim.c | 4 | ||||
-rw-r--r-- | channels/chan_zap.c | 17 |
9 files changed, 85 insertions, 2 deletions
diff --git a/channels/chan_console.c b/channels/chan_console.c index 7d62e6235..0fe3cbef4 100644 --- a/channels/chan_console.c +++ b/channels/chan_console.c @@ -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)) diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c index fb58aa490..04ea60865 100644 --- a/channels/chan_gtalk.c +++ b/channels/chan_gtalk.c @@ -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")) { diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index d93034054..c11fa1cd7 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -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")) { diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c index 52a4693e0..728554916 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -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")) { diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index f18dac361..021999abd 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -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); } diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 79fc48399..31bd5763d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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")) { diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 198b46406..c4458ba04 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -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)); diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index 88f37fbec..7318e7353 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -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")) { 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); |