Merged 207316 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.2-... .......... r207316 | rmudgett | 2009-07-17 23:05:05 -0500 (Fri, 17 Jul 2009) | 20 lines Fixed incoming calls being matched to MSNs without type-of-number prefix added. For an incoming ISDN call the dialed.number is incorrectly matched against the configured MSNs in misdn.conf. The numbers passed to the dialplan include the configured prefix for the dialed.number_type, whereas the check against the configured MSNs (to decide if the call is accepted at all), is executed without the configured prefix. e.g., dialed.number = 241168020, TON = national, configured national prefix is "0". (This is the TON which is used by ISDN providers in the Netherlands.) In chan_misdn.c:cb_events() in case EVENT_SETUP the call to misdn_cfg_is_msn_valid() uses the unnormalized number 241168020, but 57 lines later the call to read_config() adds the prefix, and the dialed.number is now 0241168020, which is then used in the dialplan. misdn_cfg_is_msn_valid() must use the normalized number, too. JIRA ABE-1912 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
98e4ab5716
commit
bcff592839
3
CHANGES
3
CHANGES
|
@ -120,7 +120,8 @@ mISDN channel driver (chan_misdn) changes
|
|||
used by the rest of the system.
|
||||
* Made use the nationalprefix and internationalprefix misdn.conf
|
||||
parameters to prefix any received number from the ISDN link if that
|
||||
number has the corresponding Type-Of-Number.
|
||||
number has the corresponding Type-Of-Number. NOTE: This includes
|
||||
comparing the incoming call's dialed number against the MSN list.
|
||||
* Added the following new parameters: unknownprefix, netspecificprefix,
|
||||
subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
|
||||
received number from the ISDN link if that number has the corresponding
|
||||
|
|
|
@ -9390,6 +9390,26 @@ static void misdn_facility_ie_handler(enum event_e event, struct misdn_bchannel
|
|||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
* \brief Determine if the given dialed party matches our MSN.
|
||||
* \since 1.6.3
|
||||
*
|
||||
* \param port ISDN port
|
||||
* \param dialed Dialed party information of incoming call.
|
||||
*
|
||||
* \retval non-zero if MSN is valid.
|
||||
* \retval 0 if MSN invalid.
|
||||
*/
|
||||
static int misdn_is_msn_valid(int port, const struct misdn_party_dialing *dialed)
|
||||
{
|
||||
char number[sizeof(dialed->number)];
|
||||
|
||||
ast_copy_string(number, dialed->number, sizeof(number));
|
||||
misdn_add_number_prefix(port, dialed->number_type, number, sizeof(number));
|
||||
return misdn_cfg_is_msn_valid(port, number);
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
/* Receive Events from isdn_lib here */
|
||||
/************************************************************/
|
||||
|
@ -9640,7 +9660,6 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
|
|||
case EVENT_SETUP:
|
||||
{
|
||||
struct chan_list *ch = find_chan_by_bc(cl_te, bc);
|
||||
int msn_valid = misdn_cfg_is_msn_valid(bc->port, bc->dialed.number);
|
||||
struct ast_channel *chan;
|
||||
int exceed;
|
||||
int ai;
|
||||
|
@ -9657,7 +9676,7 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
|
|||
}
|
||||
}
|
||||
|
||||
if (!bc->nt && ! msn_valid) {
|
||||
if (!bc->nt && !misdn_is_msn_valid(bc->port, &bc->dialed)) {
|
||||
chan_misdn_log(1, bc->port, " --> Ignoring Call, its not in our MSN List\n");
|
||||
return RESPONSE_IGNORE_SETUP; /* Ignore MSNs which are not in our List */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue