[asterisk-commits] branch group/autoconf_and_menuselect r10764 - in /team/group/autoconf_and_men...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 22 12:15:47 MST 2006


Author: russell
Date: Wed Feb 22 13:15:42 2006
New Revision: 10764

URL: http://svn.digium.com/view/asterisk?rev=10764&view=rev
Log:
Merged revisions 10691,10713,10737 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r10691 | tilghman | 2006-02-21 22:04:42 -0500 (Tue, 21 Feb 2006) | 2 lines

Updating skel application to use current parsing constructs

................
r10713 | crichter | 2006-02-22 11:48:25 -0500 (Wed, 22 Feb 2006) | 1 line

fixed a ETSI violation (after RELEASE we need to RELEASE_COMPLETE (network side) one needs to upgread mISDNuser for that fix as well. also fixed the reload issue #6547
................
r10737 | kpfleming | 2006-02-22 12:33:38 -0500 (Wed, 22 Feb 2006) | 10 lines

Merged revisions 10511,10535,10736 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r10736 | kpfleming | 2006-02-22 11:32:15 -0600 (Wed, 22 Feb 2006) | 2 lines

add comment warning people about trying to use hostnames/IPs in the sample config

........

................

Modified:
    team/group/autoconf_and_menuselect/   (props changed)
    team/group/autoconf_and_menuselect/apps/app_skel.c
    team/group/autoconf_and_menuselect/channels/chan_misdn.c
    team/group/autoconf_and_menuselect/channels/misdn/isdn_lib.c
    team/group/autoconf_and_menuselect/channels/misdn/isdn_msg_parser.c
    team/group/autoconf_and_menuselect/configs/iax.conf.sample

Propchange: team/group/autoconf_and_menuselect/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/autoconf_and_menuselect/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/group/autoconf_and_menuselect/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/autoconf_and_menuselect/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Feb 22 13:15:42 2006
@@ -1,1 +1,1 @@
-/trunk:1-10665
+/trunk:1-10763

Modified: team/group/autoconf_and_menuselect/apps/app_skel.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_skel.c?rev=10764&r1=10763&r2=10764&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_skel.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_skel.c Wed Feb 22 13:15:42 2006
@@ -50,15 +50,23 @@
 static char *descrip = "This application is a template to build other applications from.\n"
  " It shows you the basic structure to create your own Asterisk applications.\n";
 
-#define OPTION_A	(1 << 0)	/* Option A */
-#define OPTION_B	(1 << 1)	/* Option B(n) */
-#define OPTION_C	(1 << 2)	/* Option C(str) */
-#define OPTION_NULL	(1 << 3)	/* Dummy Termination */
+enum {
+	OPTION_A = (1 << 0),
+	OPTION_B = (1 << 1),
+	OPTION_C = (1 << 2),
+} option_flags;
 
-AST_DECLARE_OPTIONS(app_opts,{
-	['a'] = { OPTION_A },
-	['b'] = { OPTION_B, 1 },
-	['c'] = { OPTION_C, 2 }
+enum {
+	OPTION_ARG_B = 0,
+	OPTION_ARG_C = 1,
+	/* This *must* be the last value in this enum! */
+	OPTION_ARG_ARRAY_SIZE = 2,
+} option_args;
+
+AST_APP_OPTIONS(app_opts,{
+	AST_APP_OPTION('a', OPTION_A),
+	AST_APP_OPTION_ARG('b', OPTION_B, OPTION_ARG_B),
+	AST_APP_OPTION_ARG('c', OPTION_C, OPTION_ARG_C),
 });
 
 LOCAL_USER_DECL;
@@ -68,15 +76,14 @@
 	int res = 0;
 	struct ast_flags flags;
 	struct localuser *u;
-	char *options = NULL;
-	char *dummy = NULL;
-	char *args;
-	int argc = 0;
-	char *opts[2];
-	char *argv[2];
+	char *parse, *opts[OPTION_ARG_ARRAY_SIZE];
+	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(dummy);
+		AST_APP_ARG(options);
+	);
 
 	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "%s requires an argument (dummy|[options])\n",app);
+		ast_log(LOG_WARNING, "%s requires an argument (dummy|[options])\n", app);
 		return -1;
 	}
 
@@ -85,28 +92,27 @@
 	/* Do our thing here */
 
 	/* We need to make a copy of the input string if we are going to modify it! */
-	if (!(args = ast_strdupa(data))) {
+	if (!(parse = ast_strdupa(data))) {
 		LOCAL_USER_REMOVE(u);
 		return -1;
 	}
-	
-	if ((argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
-		dummy = argv[0];
-		options = argv[1];
-		ast_parseoptions(app_opts, &flags, opts, options);
-	}
 
-	if (!ast_strlen_zero(dummy)) 
-		ast_log(LOG_NOTICE, "Dummy value is : %s\n", dummy);
+	AST_STANDARD_APP_ARGS(args, parse);
+
+	if (args.argc == 2)
+		ast_app_parse_options(app_opts, &flags, opts, args.options);
+
+	if (!ast_strlen_zero(args.dummy)) 
+		ast_log(LOG_NOTICE, "Dummy value is : %s\n", args.dummy);
 
 	if (ast_test_flag(&flags, OPTION_A))
 		ast_log(LOG_NOTICE, "Option A is set\n");
 
 	if (ast_test_flag(&flags, OPTION_B))
-		ast_log(LOG_NOTICE,"Option B is set with : %s\n", opts[0] ? opts[0] : "<unspecified>");
+		ast_log(LOG_NOTICE, "Option B is set with : %s\n", opts[OPTION_ARG_B] ? opts[OPTION_ARG_B] : "<unspecified>");
 
 	if (ast_test_flag(&flags, OPTION_C))
-		ast_log(LOG_NOTICE,"Option C is set with : %s\n", opts[1] ? opts[1] : "<unspecified>");
+		ast_log(LOG_NOTICE, "Option C is set with : %s\n", opts[OPTION_ARG_C] ? opts[OPTION_ARG_C] : "<unspecified>");
 
 	LOCAL_USER_REMOVE(u);
 

Modified: team/group/autoconf_and_menuselect/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/chan_misdn.c?rev=10764&r1=10763&r2=10764&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/chan_misdn.c (original)
+++ team/group/autoconf_and_menuselect/channels/chan_misdn.c Wed Feb 22 13:15:42 2006
@@ -1915,14 +1915,16 @@
 			chan_misdn_log(1, bc->port, " --> cause %d\n",bc->cause);
 			chan_misdn_log(1, bc->port, " --> out_cause %d\n",bc->out_cause);
 			
+			bc->out_cause=-1;
 			misdn_lib_send_event(bc,EVENT_RELEASE);
 			break;
 		default:
 			/*  Alerting or Disconect */
 
-			if (bc->nt)
+			if (bc->nt) {
+				bc->out_cause=-1;
 				misdn_lib_send_event(bc, EVENT_RELEASE);
-			else
+			} else
 				misdn_lib_send_event(bc, EVENT_DISCONNECT);
 			p->state=MISDN_CLEANING; /* MISDN_HUNGUP_FROM_AST; */
 		}
@@ -3377,12 +3379,14 @@
 		}
 		
 		stop_bc_tones(ch);
-		bc->out_cause=16;
-		
-		//if (ch->state == MISDN_CONNECTED) 
-		//misdn_lib_send_event(bc,EVENT_RELEASE);
-		//else
-		//misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
+		/*bc->out_cause=16;*/
+		bc->out_cause=-1;
+		
+		/*if (ch->state == MISDN_CONNECTED) 
+		misdn_lib_send_event(bc,EVENT_RELEASE);
+		else
+		misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
+		*/
 		
 		misdn_lib_send_event(bc,EVENT_RELEASE);
 		
@@ -3401,15 +3405,18 @@
 				  before, so we should RELEASE_COMPLETE after that Disconnect
 				  (looks like ALERTING State at misdn_hangup !!
 				*/
-				return RESPONSE_OK;
+				
+				/*return RESPONSE_OK;*/
 				break;
 			}
 			
 			
 			bc->out_cause=16;
 			
-			stop_bc_tones(ch);
-			release_chan(bc);
+			/*stop_bc_tones(ch);
+			  release_chan(bc);*/
+			
+			misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
 		}
 		break;
 	case EVENT_RELEASE_COMPLETE:

Modified: team/group/autoconf_and_menuselect/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/misdn/isdn_lib.c?rev=10764&r1=10763&r2=10764&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/misdn/isdn_lib.c (original)
+++ team/group/autoconf_and_menuselect/channels/misdn/isdn_lib.c Wed Feb 22 13:15:42 2006
@@ -1659,13 +1659,13 @@
 
 		case CC_RELEASE|CONFIRM:
 		{
-			struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
-			cb_log(3, stack->port, " --> RELEASE CONFIRM, doing nothin\n");
-			cb_event(EVENT_CLEANUP, bc, glob_mgr->user_data);
-			empty_chan_in_stack(stack,bc->channel);
-			empty_bc(bc);
-			free_msg(msg);
-			return 0;
+			/*struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
+			  cb_log(3, stack->port, " --> RELEASE CONFIRM, doing nothin\n");
+			  cb_event(EVENT_CLEANUP, bc, glob_mgr->user_data);
+			  empty_chan_in_stack(stack,bc->channel);
+			  empty_bc(bc);
+			  free_msg(msg);
+			  return 0;*/
 		}
 		break;  
 		case CC_RELEASE|INDICATION:
@@ -2035,7 +2035,7 @@
 				
 				int i=cb_event( EVENT_BCHAN_DATA, bc, glob_mgr->user_data);
 				if (i<0) {
-					cb_log(2,stack->port,"cb_event returned <0\n");
+					cb_log(5,stack->port,"cb_event returned <0\n");
 					/*clean_up_bc(bc);*/
 				}
 			}
@@ -2990,11 +2990,12 @@
 	glob_mgr = mgr;
   
 	msg_init();
-	debug_init(0 , NULL, NULL, NULL);
 #if 0
 	int flags=0xff;
 	flags &= ~DBGM_MSG;
 	debug_init( flags , NULL, NULL, NULL);
+#else
+	debug_init(0 , NULL, NULL, NULL);
 #endif	
 	if (!portlist || (*portlist == 0) ) return 1;
 	

Modified: team/group/autoconf_and_menuselect/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/misdn/isdn_msg_parser.c?rev=10764&r1=10763&r2=10764&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/misdn/isdn_msg_parser.c (original)
+++ team/group/autoconf_and_menuselect/channels/misdn/isdn_msg_parser.c Wed Feb 22 13:15:42 2006
@@ -798,8 +798,8 @@
  
 	release=(RELEASE_t*)((msg->data+HEADER_LEN)); 
   
-  
-	enc_ie_cause(&release->CAUSE, msg, nt?1:0, bc->out_cause, nt,bc);
+	if (bc->out_cause>= 0)
+		enc_ie_cause(&release->CAUSE, msg, nt?1:0, bc->out_cause, nt,bc);
   
 #if DEBUG 
 	printf("Building RELEASE Msg\n"); 

Modified: team/group/autoconf_and_menuselect/configs/iax.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/configs/iax.conf.sample?rev=10764&r1=10763&r2=10764&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/configs/iax.conf.sample (original)
+++ team/group/autoconf_and_menuselect/configs/iax.conf.sample Wed Feb 22 13:15:42 2006
@@ -331,6 +331,11 @@
 ; to the other side.  Public keys are named /var/lib/asterisk/keys/<name>.pub
 ; while private keys are named /var/lib/asterisk/keys/<name>.key.  Private
 ; keys should always be 3DES encrypted.
+;
+;
+; NOTE: All hostnames and IP addresses in this file are for example purposes
+;       only; you should not expect any of them to actually be available for
+;       your use.
 ;
 ;
 ;[markster]



More information about the asterisk-commits mailing list