[asterisk-commits] branch crichter/0.3.0 r8796 - in /team/crichter/0.3.0: channels/ configs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 27 08:24:48 MST 2006


Author: crichter
Date: Fri Jan 27 09:24:45 2006
New Revision: 8796

URL: http://svn.digium.com/view/asterisk?rev=8796&view=rev
Log:
* SetCallerpres works again
* some formatting issues
* removed use_callerpres from configs and engine totally


Modified:
    team/crichter/0.3.0/channels/chan_misdn.c
    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=8796&r1=8795&r2=8796&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Fri Jan 27 09:24:45 2006
@@ -1053,6 +1053,87 @@
 /*** CLI END ***/
 
 
+static int update_config (struct chan_list *ch, int orig) 
+{
+	if (!ch) {
+		ast_log(LOG_WARNING, "Cannot configure without chanlist\n");
+		return -1;
+	}
+	
+	struct ast_channel *ast=ch->ast;
+	struct misdn_bchannel *bc=ch->bc;
+	if (! ast || ! bc ) {
+		ast_log(LOG_WARNING, "Cannot configure without ast || bc\n");
+		return -1;
+	}
+	
+	int port=bc->port;
+	
+	chan_misdn_log(1,port,"update_config: Getting Config\n");
+
+	
+	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, screen);
+		
+	if ( (pres + screen) < 0 ) {
+
+		chan_misdn_log(2,port," --> pres: %x\n", ast->cid.cid_pres);
+			
+		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_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){
+				
+		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;
+				
+		default:
+			bc->screen=0;
+			chan_misdn_log(2, port, " --> SCREEN: Unscreened (0x0)\n");
+		}
+
+			
+	} else {
+		bc->screen=screen;
+		bc->pres=pres;
+	}
+	
+}
+
 
 static int read_config(struct chan_list *ch, int orig) {
 
@@ -1233,68 +1314,7 @@
 		}
 
 		
-		/* Will be overridden by asterisk in head! */
-		{
-			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_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){
-				
-				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;
-				
-				default:
-					bc->screen=0;
-					chan_misdn_log(2, port, " --> SCREEN: Unscreened (0x0)\n");
-				}
-
-			
-			} else {
-				bc->screen=screen;
-				bc->pres=pres;
-			}
-		}
-
-		
 		
 	} else { /** ORIGINATOR MISDN **/
 		
@@ -1493,7 +1513,10 @@
 			chan_misdn_log(2, port, " --> * Call with flag Digital\n");
 		}
 		
-		
+
+		/* update screening and presentation */ 
+		update_config(ch,ORG_AST);
+	
 		/* Finally The Options Override Everything */
 		if (opts)
 			misdn_set_opt_exec(ast,opts);
@@ -1501,9 +1524,7 @@
 			chan_misdn_log(1,0,"NO OPTS GIVEN\n");
 		
 		
-		
 		ch->state=MISDN_CALLING;
-
 		
 		r=misdn_lib_send_event( newbc, EVENT_SETUP );
 		
@@ -1522,7 +1543,6 @@
 	chan_misdn_log(1, port, " --> * SEND: State Dialing pid:%d\n",newbc?newbc->pid:1);
 
 	ast_setstate(ast, AST_STATE_DIALING);
-	
 	ast->hangupcause=16;
 	return 0; 
 }

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=8796&r1=8795&r2=8796&view=diff
==============================================================================
--- team/crichter/0.3.0/configs/misdn.conf.sample (original)
+++ team/crichter/0.3.0/configs/misdn.conf.sample Fri Jan 27 09:24:45 2006
@@ -176,14 +176,6 @@
 ;
 dialplan=0
 localdialplan=0
-
-; This is only for asterisk head and will result in only considering 
-; misdn.confs and misdn_set_opts callingpresentation informations if set to no.
-; Otherwise asterisks callingpresentation overwrites misdn.confs settings.
-;
-; default value: yes
-;
-use_callingpres=yes
 
 
 



More information about the asterisk-commits mailing list