[asterisk-commits] rmudgett: branch group/issue8824 r143893 - in /team/group/issue8824: channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 22 13:19:01 CDT 2008


Author: rmudgett
Date: Mon Sep 22 13:19:01 2008
New Revision: 143893

URL: http://svn.digium.com/view/asterisk?view=rev&rev=143893
Log:
Put a display ie in the CONNECT message containing the following
information if it is available (nt port only):

0 - Do not put the connected line information in the display ie.
1 - Put the available connected line name in the display ie.
2 - Put the available connected line number in the display ie.
3 - Put the available connected line name and number in the display ie.


Modified:
    team/group/issue8824/channels/chan_misdn.c
    team/group/issue8824/channels/misdn/chan_misdn_config.h
    team/group/issue8824/channels/misdn/isdn_lib.c
    team/group/issue8824/channels/misdn/isdn_lib.h
    team/group/issue8824/channels/misdn/isdn_msg_parser.c
    team/group/issue8824/channels/misdn_config.c
    team/group/issue8824/configs/misdn.conf.sample

Modified: team/group/issue8824/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_misdn.c?view=diff&rev=143893&r1=143892&r2=143893
==============================================================================
--- team/group/issue8824/channels/chan_misdn.c (original)
+++ team/group/issue8824/channels/chan_misdn.c Mon Sep 22 13:19:01 2008
@@ -3045,7 +3045,9 @@
 
 	/* update screening and presentation */ 
 	update_config(ch);
-		
+
+	misdn_cfg_get(port, MISDN_CFG_DISPLAY_CONNECTED, &newbc->display_connected, sizeof(newbc->display_connected));
+
 	/* fill in some ies from channel dialplan variables */
 	import_ch(ast, newbc, ch);
 

Modified: team/group/issue8824/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/chan_misdn_config.h?view=diff&rev=143893&r1=143892&r2=143893
==============================================================================
--- team/group/issue8824/channels/misdn/chan_misdn_config.h (original)
+++ team/group/issue8824/channels/misdn/chan_misdn_config.h Mon Sep 22 13:19:01 2008
@@ -50,6 +50,7 @@
 	MISDN_CFG_INTERNATPREFIX,      /* char[] */
 	MISDN_CFG_PRES,                /* int */
 	MISDN_CFG_SCREEN,              /* int */
+	MISDN_CFG_DISPLAY_CONNECTED,   /* int */
 	MISDN_CFG_ALWAYS_IMMEDIATE,    /* int (bool) */
 	MISDN_CFG_NODIALTONE,    /* int (bool) */
 	MISDN_CFG_IMMEDIATE,           /* int (bool) */

Modified: team/group/issue8824/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/isdn_lib.c?view=diff&rev=143893&r1=143892&r2=143893
==============================================================================
--- team/group/issue8824/channels/misdn/isdn_lib.c (original)
+++ team/group/issue8824/channels/misdn/isdn_lib.c Mon Sep 22 13:19:01 2008
@@ -710,6 +710,8 @@
   
 	bc->cause = AST_CAUSE_NORMAL_CLEARING;
 	bc->out_cause = AST_CAUSE_NORMAL_CLEARING;
+
+	bc->display_connected = 0;	/* none */
 	
 	bc->presentation = 0;	/* allowed */
 	bc->set_presentation = 0;

Modified: team/group/issue8824/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/isdn_lib.h?view=diff&rev=143893&r1=143892&r2=143893
==============================================================================
--- team/group/issue8824/channels/misdn/isdn_lib.h (original)
+++ team/group/issue8824/channels/misdn/isdn_lib.h Mon Sep 22 13:19:01 2008
@@ -197,7 +197,7 @@
 	INFO_PI_INTERWORKING_NO_RELEASE_POST_ANSWER =0x13
 };
 
-/*! 
+/*!
  * \brief Q.931 encoded redirecting reason
  */
 enum mISDN_REDIRECTING_REASON {
@@ -491,6 +491,18 @@
 	 */
 	int stack_holder;
 
+	/*!
+	 * \brief Put a display ie in the CONNECT message
+	 * \details
+	 * Put a display ie in the CONNECT message containing the following
+	 * information if it is available (nt port only):
+	 * 0 - Do not put the connected line information in the display ie.
+	 * 1 - Put the available connected line name in the display ie.
+	 * 2 - Put the available connected line number in the display ie.
+	 * 3 - Put the available connected line name and number in the display ie.
+	 */
+	int display_connected;
+
 	/*! \brief User set presentation restriction code
 	 * 0=Allowed, 1=Restricted, 2=Unavailable
 	 * \note It is settable by the misdn_set_opt() application.

Modified: team/group/issue8824/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/isdn_msg_parser.c?view=diff&rev=143893&r1=143892&r2=143893
==============================================================================
--- team/group/issue8824/channels/misdn/isdn_msg_parser.c (original)
+++ team/group/issue8824/channels/misdn/isdn_msg_parser.c Mon Sep 22 13:19:01 2008
@@ -24,6 +24,46 @@
 #include "isdn_lib.h"
 
 #include "ie.c"
+
+
+
+
+/* ******************************************************************* */
+/*!
+ * \internal
+ * \brief Build the name, number, name/number display message string
+ *
+ * \param display Display buffer to fill in
+ * \param display_length Length of the display buffer to fill in
+ * \param display_format Display format enumeration
+ * \param name Name string to use
+ * \param number Number string to use
+ *
+ * \return Nothing
+ */
+static void build_display_str(char *display, size_t display_length, int display_format, const char *name, const char *number)
+{
+	display[0] = 0;
+	switch (display_format) {
+	default:
+	case 0:		/* none */
+		break;
+
+	case 1:		/* name */
+		snprintf(display, display_length, "%s", name);
+		break;
+
+	case 2:		/* number */
+		snprintf(display, display_length, "%s", number);
+		break;
+
+	case 3:		/* both */
+		if (name[0] || number[0]) {
+			snprintf(display, display_length, "\"%s\" <%s>", name, number);
+		}
+		break;
+	}	/* end switch */
+}	/* end build_display_str() */
 
 
 static void set_channel(struct misdn_bchannel *bc, int channel)
@@ -432,6 +472,16 @@
   
 	enc_ie_connected_pn(&connect->CONNECT_PN, msg, bc->connected.number_type, bc->connected.number_plan,
 		bc->connected.presentation, bc->connected.screening, bc->connected.number, nt, bc);
+
+	if (nt && bc->connected.presentation == 0) {
+		char display[sizeof(bc->display)];
+
+		/* Presentation is allowed */
+		build_display_str(display, sizeof(display), bc->display_connected, bc->connected.name, bc->connected.number);
+		if (display[0]) {
+			enc_ie_display(&connect->DISPLAY, msg, display, nt, bc);
+		}
+	}
 
 #ifdef DEBUG 
 	printf("Building CONNECT Msg\n"); 

Modified: team/group/issue8824/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn_config.c?view=diff&rev=143893&r1=143892&r2=143893
==============================================================================
--- team/group/issue8824/channels/misdn_config.c (original)
+++ team/group/issue8824/channels/misdn_config.c Mon Sep 22 13:19:01 2008
@@ -211,6 +211,14 @@
 		"\n"
 		"\tscreen=0, presentation=0 -> callerid presented\n"
 		"\tscreen=1, presentation=1 -> callerid restricted (the remote end doesn't see it!)" },
+	{ "display_connected", MISDN_CFG_DISPLAY_CONNECTED, MISDN_CTYPE_INT, "0", NONE,
+		"Put a display ie in the CONNECT message containing the following\n"
+		"\tinformation if it is available (nt port only):\n"
+		"\n"
+		"\t0 - Do not put the connected line information in the display ie.\n"
+		"\t1 - Put the available connected line name in the display ie.\n"
+		"\t2 - Put the available connected line number in the display ie.\n"
+		"\t3 - Put the available connected line name and number in the display ie.\n" },
 	{ "always_immediate", MISDN_CFG_ALWAYS_IMMEDIATE, MISDN_CTYPE_BOOL, "no", NONE,
 		"Enable this to get into the s dialplan-extension.\n"
 		"\tThere you can use DigitTimeout if you can't or don't want to use\n"

Modified: team/group/issue8824/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/configs/misdn.conf.sample?view=diff&rev=143893&r1=143892&r2=143893
==============================================================================
--- team/group/issue8824/configs/misdn.conf.sample (original)
+++ team/group/issue8824/configs/misdn.conf.sample Mon Sep 22 13:19:01 2008
@@ -380,6 +380,16 @@
 presentation=-1
 screen=-1
 
+; Put a display ie in the CONNECT message containing the following
+; information if it is available (nt port only):
+;
+; 0 - Do not put the connected line information in the display ie.
+; 1 - Put the available connected line name in the display ie.
+; 2 - Put the available connected line number in the display ie.
+; 3 - Put the available connected line name and number in the display ie.
+;
+display_connected=0
+
 ; This enables echo cancellation with the given number of taps.
 ; Be aware: Move this setting only to outgoing portgroups!
 ; A value of zero turns echo cancellation off.




More information about the asterisk-commits mailing list