[asterisk-commits] rmudgett: branch rmudgett/misdn_facility r161944 - in /team/rmudgett/misdn_fa...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 8 18:39:36 CST 2008
Author: rmudgett
Date: Mon Dec 8 18:39:35 2008
New Revision: 161944
URL: http://svn.digium.com/view/asterisk?view=rev&rev=161944
Log:
Resolve conflict and restart automerge.
Merged revisions 161905,161917 via svnmerge from
https://origsvn.digium.com/svn/asterisk/team/group/issue8824
................
r161905 | rmudgett | 2008-12-08 16:13:04 -0600 (Mon, 08 Dec 2008) | 5 lines
* Addresses JIRA ABE-1747
mISDN now uses 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.
................
r161917 | root | 2008-12-08 17:56:12 -0600 (Mon, 08 Dec 2008) | 10 lines
Merged revisions 161911 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk
........
r161911 | bkruse | 2008-12-08 17:04:49 -0600 (Mon, 08 Dec 2008) | 2 lines
Note that the recently changed waittime parameter is in milliseconds.
........
................
Modified:
team/rmudgett/misdn_facility/ (props changed)
team/rmudgett/misdn_facility/CHANGES
team/rmudgett/misdn_facility/channels/chan_misdn.c
team/rmudgett/misdn_facility/configs/misdn.conf.sample
team/rmudgett/misdn_facility/main/pbx.c
Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
automerge = *
Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- misdn-facility (original)
+++ misdn-facility Mon Dec 8 18:39:35 2008
@@ -1,1 +1,1 @@
-/team/group/issue8824:1-161891
+/team/group/issue8824:1-161943
Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Dec 8 18:39:35 2008
@@ -1,1 +1,1 @@
-/trunk:1-161875
+/trunk:1-161916
Modified: team/rmudgett/misdn_facility/CHANGES
URL: http://svn.digium.com/view/asterisk/team/rmudgett/misdn_facility/CHANGES?view=diff&rev=161944&r1=161943&r2=161944
==============================================================================
--- team/rmudgett/misdn_facility/CHANGES (original)
+++ team/rmudgett/misdn_facility/CHANGES Mon Dec 8 18:39:35 2008
@@ -36,12 +36,15 @@
channel.
* Made misdn.conf parameter callerid accept the "name" <number> format
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.
SIP channel driver (chan_sip) changes
-------------------------------------------
* The sendrpid parameter has been expanded to include the options
'rpid' and 'pai'. Setting sendrpid to 'rpid' will cause Remote-Party-ID
- header to be sent (equivalent to setting sendrpid=yes) and setting
+ header to be sent (equivalent to setting sendrpid=yes) and setting
sendrpid to 'pai' will cause P-Asserted-Identity header to be sent.
------------------------------------------------------------------------------
Modified: team/rmudgett/misdn_facility/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/rmudgett/misdn_facility/channels/chan_misdn.c?view=diff&rev=161944&r1=161943&r2=161944
==============================================================================
--- team/rmudgett/misdn_facility/channels/chan_misdn.c (original)
+++ team/rmudgett/misdn_facility/channels/chan_misdn.c Mon Dec 8 18:39:35 2008
@@ -2394,6 +2394,41 @@
break;
}
}
+
+
+
+
+/* ******************************************************************* */
+/*!
+ * \internal
+ * \brief Add a confiured prefix to the given number.
+ *
+ * \param port Logical port number
+ * \param number_type Type-of-number passed in.
+ * \param number Given number string to add prefix
+ * \param size Buffer size number string occupies.
+ *
+ * \return Nothing
+ */
+static void misdn_add_number_prefix(int port, enum mISDN_NUMBER_TYPE number_type, char *number, size_t size)
+{
+ char prefix[MISDN_MAX_NUMBER_LEN];
+ char saved_number[MISDN_MAX_NUMBER_LEN];
+
+ prefix[0] = 0;
+ switch (number_type) {
+ case NUMTYPE_INTERNATIONAL:
+ misdn_cfg_get(port, MISDN_CFG_INTERNATPREFIX, prefix, sizeof(prefix));
+ break;
+ case NUMTYPE_NATIONAL:
+ misdn_cfg_get(port, MISDN_CFG_NATPREFIX, prefix, sizeof(prefix));
+ break;
+ default:
+ return;
+ }
+ ast_copy_string(saved_number, number, sizeof(saved_number));
+ snprintf(number, size, "%s%s", prefix, saved_number);
+} /* end misdn_add_number_prefix() */
static void export_aoc_vars(int originator, struct ast_channel *ast, struct misdn_bchannel *bc)
{
@@ -4376,12 +4411,11 @@
misdn_cfg_get(bc->port, MISDN_CFG_EARLY_BCONNECT, &bc->early_bconnect, sizeof(bc->early_bconnect));
+ misdn_cfg_get(port, MISDN_CFG_DISPLAY_CONNECTED, &bc->display_connected, sizeof(bc->display_connected));
+ misdn_cfg_get(port, MISDN_CFG_DISPLAY_SETUP, &bc->display_setup, sizeof(bc->display_setup));
+
misdn_cfg_get(port, MISDN_CFG_PICKUPGROUP, &pg, sizeof(pg));
misdn_cfg_get(port, MISDN_CFG_CALLGROUP, &cg, sizeof(cg));
-
- misdn_cfg_get(port, MISDN_CFG_DISPLAY_CONNECTED, &bc->display_connected, sizeof(bc->display_connected));
- misdn_cfg_get(port, MISDN_CFG_DISPLAY_SETUP, &bc->display_setup, sizeof(bc->display_setup));
-
chan_misdn_log(5, port, " --> * CallGrp:%s PickupGrp:%s\n", ast_print_group(buf, sizeof(buf), cg), ast_print_group(buf2, sizeof(buf2), pg));
ast->pickupgroup = pg;
ast->callgroup = cg;
@@ -4425,8 +4459,6 @@
ch->overlap_dial = 0;
} else {
- char prefix[BUFFERSIZE + 1];
-
/* ORIGINATOR MISDN (incoming call) */
if (strstr(faxdetect, "incoming") || strstr(faxdetect, "both")) {
@@ -4437,42 +4469,16 @@
}
/* Add configured prefix to caller.number */
- prefix[0] = 0;
- switch (bc->caller.number_type) {
- case NUMTYPE_INTERNATIONAL:
- misdn_cfg_get(bc->port, MISDN_CFG_INTERNATPREFIX, prefix, sizeof(prefix));
- break;
- case NUMTYPE_NATIONAL:
- misdn_cfg_get(bc->port, MISDN_CFG_NATPREFIX, prefix, sizeof(prefix));
- break;
- default:
- break;
- }
- ast_copy_string(buf, bc->caller.number, sizeof(buf));
- snprintf(bc->caller.number, sizeof(bc->caller.number), "%s%s", prefix, buf);
-
- if ( ast_strlen_zero(bc->dialed.number) && !ast_strlen_zero(bc->keypad)) {
+ misdn_add_number_prefix(bc->port, bc->caller.number_type, bc->caller.number, sizeof(bc->caller.number));
+
+ if (ast_strlen_zero(bc->dialed.number) && !ast_strlen_zero(bc->keypad)) {
ast_copy_string(bc->dialed.number, bc->keypad, sizeof(bc->dialed.number));
}
/* Add configured prefix to dialed.number */
- prefix[0] = 0;
- switch (bc->dialed.number_type) {
- case NUMTYPE_INTERNATIONAL:
- misdn_cfg_get(bc->port, MISDN_CFG_INTERNATPREFIX, prefix, sizeof(prefix));
- break;
- case NUMTYPE_NATIONAL:
- misdn_cfg_get(bc->port, MISDN_CFG_NATPREFIX, prefix, sizeof(prefix));
- break;
- default:
- break;
- }
- ast_copy_string(buf, bc->dialed.number, sizeof(buf));
- snprintf(bc->dialed.number, sizeof(bc->dialed.number), "%s%s", prefix, buf);
-
- if (strcmp(bc->dialed.number, ast->exten)) {
- ast_copy_string(ast->exten, bc->dialed.number, sizeof(ast->exten));
- }
+ misdn_add_number_prefix(bc->port, bc->dialed.number_type, bc->dialed.number, sizeof(bc->dialed.number));
+
+ ast_copy_string(ast->exten, bc->dialed.number, sizeof(ast->exten));
misdn_cfg_get(bc->port, MISDN_CFG_OVERLAP_DIAL, &ch->overlap_dial, sizeof(ch->overlap_dial));
ast_mutex_init(&ch->overlap_tv_lock);
@@ -7325,6 +7331,9 @@
if (!ast_strlen_zero(bc->redirecting.from.number)) {
struct ast_party_redirecting redirecting;
+ /* Add configured prefix to redirecting.from.number */
+ misdn_add_number_prefix(bc->port, bc->redirecting.from.number_type, bc->redirecting.from.number, sizeof(bc->redirecting.from.number));
+
/* Update asterisk channel redirecting information */
ast_party_redirecting_set_init(&redirecting, &chan->redirecting);
redirecting.from.number = bc->redirecting.from.number;
@@ -7628,6 +7637,9 @@
}
}
#endif /* defined(AST_MISDN_ENHANCEMENTS) */
+
+ /* Add configured prefix to connected.number */
+ misdn_add_number_prefix(bc->port, bc->connected.number_type, bc->connected.number, sizeof(bc->connected.number));
/* Update the connected line information on the other channel */
ast_party_connected_line_init(&connected);
Modified: team/rmudgett/misdn_facility/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/rmudgett/misdn_facility/configs/misdn.conf.sample?view=diff&rev=161944&r1=161943&r2=161944
==============================================================================
--- team/rmudgett/misdn_facility/configs/misdn.conf.sample (original)
+++ team/rmudgett/misdn_facility/configs/misdn.conf.sample Mon Dec 8 18:39:35 2008
@@ -190,10 +190,11 @@
;
allowed_bearers=all
-; Prefixes for national and international Type-Of-Number, these are
-; put before the caller number and dialed number if a corresponding
-; dialplan is set for incoming calls. See the dialplan and localdialplan
-; options.
+; Prefixes for national and international Type-Of-Number. These are
+; inserted before any number (caller, dialed, connected, redirecting,
+; redirection) received from the ISDN link if that number has the
+; correspondng Type-Of-Number.
+; See the dialplan options.
;
; default values: nationalprefix : 0
; internationalprefix : 00
Modified: team/rmudgett/misdn_facility/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/rmudgett/misdn_facility/main/pbx.c?view=diff&rev=161944&r1=161943&r2=161944
==============================================================================
--- team/rmudgett/misdn_facility/main/pbx.c (original)
+++ team/rmudgett/misdn_facility/main/pbx.c Mon Dec 8 18:39:35 2008
@@ -4105,6 +4105,7 @@
/*!
* \brief collect digits from the channel into the buffer.
+ * \param waittime is in milliseconds
* \retval 0 on timeout or done.
* \retval -1 on error.
*/
More information about the asterisk-commits
mailing list