[svn-commits] branch crichter/0.3.0 - r8183 in /team/crichter/0.3.0: channels/ channels/mis...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Jan 18 01:46:16 MST 2006


Author: crichter
Date: Wed Jan 18 02:46:08 2006
New Revision: 8183

URL: http://svn.digium.com/view/asterisk?rev=8183&view=rev
Log:
added support to set default presentation/screening in misdn.conf. This changes the behaviour of the presentation setting\!

Modified:
    team/crichter/0.3.0/channels/chan_misdn.c
    team/crichter/0.3.0/channels/chan_misdn_config.c
    team/crichter/0.3.0/channels/misdn/chan_misdn_config.h
    team/crichter/0.3.0/configs/misdn.conf.sample

Modified: team/crichter/0.3.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn.c?rev=8183&r1=8182&r2=8183&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Wed Jan 18 02:46:08 2006
@@ -1233,71 +1233,63 @@
 		
 		/* Will be overridden by asterisk in head! */
 		{
-			char pres[128];
-			
-			misdn_cfg_get( port, MISDN_CFG_PRES, &pres, 128);
-			ast_log(LOG_NOTICE,"pres: %s\n",pres);
-			if (!strcasecmp("not_screened",pres)) {
-				bc->pres=1;
-				bc->screen=1;
-				ast_log(LOG_NOTICE,"pres: NOT SCREENED!\n");
-			} else {
-				bc->pres=0;
-				bc->screen=0;
-				ast_log(LOG_NOTICE,"pres: allowed!\n");
-			}
-			
-		}
-		
-		int def_callingpres;
-		misdn_cfg_get( port, MISDN_CFG_USE_CALLINGPRES, &def_callingpres, sizeof(int));
-		if ( def_callingpres) {
-			
-			switch (ast->cid.cid_pres & 0x60){
+			int pres, screen;
+			
+			misdn_cfg_get( port, MISDN_CFG_PRES, &pres, sizeof(int));
+			misdn_cfg_get( port, MISDN_CFG_SCREEN, &screen, sizeof(int));
+			chan_misdn_log(2,port," --> pres: %d screen: %d\n",pres);
+		
+			if ( (pres + screen) < 0 ) {
+			
+				switch (ast->cid.cid_pres & 0x60){
 				
-			case AST_PRES_RESTRICTED:
-				bc->pres=1;
-				chan_misdn_log(2, port, " --> PRES: Restricted (0x1)\n");
-				break;
+				case AST_PRES_RESTRICTED:
+					bc->pres=1;
+					chan_misdn_log(2, port, " --> PRES: Restricted (0x1)\n");
+					break;
 				
 				
-			case AST_PRES_UNAVAILABLE:
-				bc->pres=2;
-				chan_misdn_log(2, port, " --> PRES: Unavailable (0x2)\n");
-				break;
+				case AST_PRES_UNAVAILABLE:
+					bc->pres=2;
+					chan_misdn_log(2, port, " --> PRES: Unavailable (0x2)\n");
+					break;
 				
-			default:
-				bc->pres=0;
-				chan_misdn_log(2, port, " --> PRES: Allowed (0x0)\n");
-			}
-			
-			switch (ast->cid.cid_pres & 0x3){
+				default:
+					bc->pres=0;
+					chan_misdn_log(2, port, " --> PRES: Allowed (0x0)\n");
+				}
+			
+				switch (ast->cid.cid_pres & 0x3){
 				
-			case AST_PRES_USER_NUMBER_UNSCREENED:
-				bc->screen=0;
-				chan_misdn_log(2, port, " --> SCREEN: Unscreened (0x0)\n");
-				break;
-
-			case AST_PRES_USER_NUMBER_PASSED_SCREEN:
-				bc->screen=1;
-				chan_misdn_log(2, port, " --> SCREEN: Passed Screen (0x1)\n");
-				break;
-			case AST_PRES_USER_NUMBER_FAILED_SCREEN:
-				bc->screen=2;
-				chan_misdn_log(2, port, " --> SCREEN: Failed Screen (0x2)\n");
-				break;
+				case AST_PRES_USER_NUMBER_UNSCREENED:
+					bc->screen=0;
+					chan_misdn_log(2, port, " --> SCREEN: Unscreened (0x0)\n");
+					break;
+
+				case AST_PRES_USER_NUMBER_PASSED_SCREEN:
+					bc->screen=1;
+					chan_misdn_log(2, port, " --> SCREEN: Passed Screen (0x1)\n");
+					break;
+				case AST_PRES_USER_NUMBER_FAILED_SCREEN:
+					bc->screen=2;
+					chan_misdn_log(2, port, " --> SCREEN: Failed Screen (0x2)\n");
+					break;
 				
-			case AST_PRES_NETWORK_NUMBER:
-				bc->screen=3;
-				chan_misdn_log(2, port, " --> SCREEN: Network Nr. (0x3)\n");
-				break;
+				case AST_PRES_NETWORK_NUMBER:
+					bc->screen=3;
+					chan_misdn_log(2, port, " --> SCREEN: Network Nr. (0x3)\n");
+					break;
 				
-			default:
-				bc->screen=0;
-				chan_misdn_log(2, port, " --> SCREEN: Unscreened (0x0)\n");
-			}
-
-			
+				default:
+					bc->screen=0;
+					chan_misdn_log(2, port, " --> SCREEN: Unscreened (0x0)\n");
+				}
+
+			
+			} else {
+				bc->screen=screen;
+				bc->pres=pres;
+			}
 		}
 
 		

Modified: team/crichter/0.3.0/channels/chan_misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn_config.c?rev=8183&r1=8182&r2=8183&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn_config.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn_config.c Wed Jan 18 02:46:08 2006
@@ -96,7 +96,8 @@
 	{ "localdialplan", MISDN_CFG_LOCALDIALPLAN, MISDN_CTYPE_INT, "0", NONE },
 	{ "nationalprefix", MISDN_CFG_NATPREFIX, MISDN_CTYPE_STR, "0", NONE },
 	{ "internationalprefix", MISDN_CFG_INTERNATPREFIX, MISDN_CTYPE_STR, "00", NONE },
-	{ "presentation", MISDN_CFG_PRES, MISDN_CTYPE_STR, "allowed", NONE },
+	{ "presentation", MISDN_CFG_PRES, MISDN_CTYPE_INT, "-1", NONE },
+	{ "screen", MISDN_CFG_SCREEN, MISDN_CTYPE_INT, "-1", NONE },
 	{ "always_immediate", MISDN_CFG_ALWAYS_IMMEDIATE, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "immediate", MISDN_CFG_IMMEDIATE, MISDN_CTYPE_BOOL, "no", NONE },
 	{ "senddtmf", MISDN_CFG_SENDDTMF, MISDN_CTYPE_BOOL, "no", NONE },

Modified: team/crichter/0.3.0/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/chan_misdn_config.h?rev=8183&r1=8182&r2=8183&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/chan_misdn_config.h (original)
+++ team/crichter/0.3.0/channels/misdn/chan_misdn_config.h Wed Jan 18 02:46:08 2006
@@ -35,7 +35,8 @@
 	MISDN_CFG_LOCALDIALPLAN,       /* int */
 	MISDN_CFG_NATPREFIX,           /* char[] */
 	MISDN_CFG_INTERNATPREFIX,      /* char[] */
-	MISDN_CFG_PRES,                /* int (bool) */
+	MISDN_CFG_PRES,                /* int */
+	MISDN_CFG_SCREEN,              /* int */
 	MISDN_CFG_ALWAYS_IMMEDIATE,    /* int (bool) */
 	MISDN_CFG_IMMEDIATE,           /* int (bool) */
 	MISDN_CFG_SENDDTMF,           /* int (bool) */

Modified: team/crichter/0.3.0/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/configs/misdn.conf.sample?rev=8183&r1=8182&r2=8183&view=diff
==============================================================================
--- team/crichter/0.3.0/configs/misdn.conf.sample (original)
+++ team/crichter/0.3.0/configs/misdn.conf.sample Wed Jan 18 02:46:08 2006
@@ -213,17 +213,17 @@
 ;callgroup=1
 ;pickupgroup=1
 
-; Allows/Screens Callerid
-;
-; possible values: allowed,not_screened
-;
-; be aware, if you set to allowed you need to set a correct 
-; callerid in the dialplan or set it here in the misdn.conf
-; Some Telcos don't care about wrong callerids, others do !
-;
-; default value: allowed
-;
-;presentation=not_screened
+
+;
+; these are the exact isdn screening and presentation indicators
+; if -1 is given for both values the presentation indicators are used
+; from asterisks SetCallerPres application.
+; s=0, p=0 -> callerid presented not screened
+; s=1, p=1 -> callerid presented but screened (the remote end does not see it!)
+; 
+; defaule values s=-1, p=-1
+presentation=-1
+screen=-1
 
 ; this enables echocancellation, with the given number of taps
 ; be aware, move this setting only to outgoing portgroups!



More information about the svn-commits mailing list