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
}
}
+/*!
+ * \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 */
/************************************************************/
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;
}
}
- 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 */
}