[asterisk-commits] branch crichter/0.3.0 - r7499 in /team/crichter/0.3.0: ./ apps/ channels/ cha...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Dec 16 04:50:30 CST 2005


Author: crichter
Date: Fri Dec 16 04:50:14 2005
New Revision: 7499

URL: http://svn.digium.com/view/asterisk?rev=7499&view=rev
Log:
merged with current trunk, added support for asterisk indications

Added:
    team/crichter/0.3.0/funcs/func_cut.c   (props changed)
      - copied unchanged from r7498, trunk/funcs/func_cut.c
Removed:
    team/crichter/0.3.0/apps/app_cut.c
Modified:
    team/crichter/0.3.0/   (props changed)
    team/crichter/0.3.0/Makefile
    team/crichter/0.3.0/app.c
    team/crichter/0.3.0/apps/app_dial.c
    team/crichter/0.3.0/apps/app_externalivr.c
    team/crichter/0.3.0/apps/app_macro.c
    team/crichter/0.3.0/apps/app_voicemail.c
    team/crichter/0.3.0/channel.c
    team/crichter/0.3.0/channels/chan_agent.c
    team/crichter/0.3.0/channels/chan_misdn.c
    team/crichter/0.3.0/channels/chan_sip.c
    team/crichter/0.3.0/channels/chan_zap.c
    team/crichter/0.3.0/channels/misdn/isdn_lib.c
    team/crichter/0.3.0/channels/misdn/isdn_lib.h
    team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c
    team/crichter/0.3.0/configs/features.conf.sample
    team/crichter/0.3.0/configs/res_odbc.conf.sample
    team/crichter/0.3.0/doc/README.variables
    team/crichter/0.3.0/include/asterisk/linkedlists.h
    team/crichter/0.3.0/pbx.c
    team/crichter/0.3.0/utils.c
    team/crichter/0.3.0/utils/astman.c

Propchange: team/crichter/0.3.0/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Dec 16 04:50:14 2005
@@ -1,1 +1,1 @@
-/trunk:1-7393
+/trunk:1-7498

Modified: team/crichter/0.3.0/Makefile
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/Makefile?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/Makefile (original)
+++ team/crichter/0.3.0/Makefile Fri Dec 16 04:50:14 2005
@@ -899,3 +899,13 @@
 	if cmp -s .cleancount .lastclean ; then echo ; else \
 		$(MAKE) clean; cp -f .cleancount .lastclean;\
 	fi
+
+
+
+chan_misdn.so:
+	make -C . SUBDIRS=channels CHANNEL_LIBS=chan_misdn.so
+
+cm-install: chan_misdn.so
+	install -m 644 channels/chan_misdn.so /usr/lib/asterisk/modules/
+
+

Modified: team/crichter/0.3.0/app.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/app.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/app.c (original)
+++ team/crichter/0.3.0/app.c Fri Dec 16 04:50:14 2005
@@ -430,11 +430,11 @@
 			   const char *stop, const char *pause,
 			   const char *restart, int skipms) 
 {
-	long elapsed = 0, last_elapsed = 0;
 	char *breaks = NULL;
 	char *end = NULL;
 	int blen = 2;
 	int res;
+	long pause_restart_point = 0;
 
 	if (stop)
 		blen += strlen(stop);
@@ -456,9 +456,6 @@
 	if (chan->_state != AST_STATE_UP)
 		res = ast_answer(chan);
 
-	if (chan)
-		ast_stopstream(chan);
-
 	if (file) {
 		if ((end = strchr(file,':'))) {
 			if (!strcasecmp(end, ":end")) {
@@ -469,25 +466,18 @@
 	}
 
 	for (;;) {
-		struct timeval started = ast_tvnow();
-
-		if (chan)
-			ast_stopstream(chan);
+		ast_stopstream(chan);
 		res = ast_streamfile(chan, file, chan->language);
 		if (!res) {
-			if (end) {
+			if (pause_restart_point) {
+				ast_seekstream(chan->stream, pause_restart_point, SEEK_SET);
+				pause_restart_point = 0;
+			}
+			else if (end) {
 				ast_seekstream(chan->stream, 0, SEEK_END);
-				end=NULL;
-			}
-			res = 1;
-			if (elapsed) {
-				ast_stream_fastforward(chan->stream, elapsed);
-				last_elapsed = elapsed - 200;
-			}
-			if (res)
-				res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
-			else
-				break;
+				end = NULL;
+			};
+			res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
 		}
 
 		if (res < 1)
@@ -496,17 +486,16 @@
 		/* We go at next loop if we got the restart char */
 		if (restart && strchr(restart, res)) {
 			ast_log(LOG_DEBUG, "we'll restart the stream here at next loop\n");
-			elapsed=0; /* To make sure the next stream will start at beginning */
+			pause_restart_point = 0;
 			continue;
 		}
 
-		if (pause != NULL && strchr(pause, res)) {
-			elapsed = ast_tvdiff_ms(ast_tvnow(), started) + last_elapsed;
-			for(;;) {
-				if (chan)
-					ast_stopstream(chan);
+		if (pause && strchr(pause, res)) {
+			pause_restart_point = ast_tellstream(chan->stream);
+			for (;;) {
+				ast_stopstream(chan);
 				res = ast_waitfordigit(chan, 1000);
-				if (res == 0)
+				if (!res)
 					continue;
 				else if (res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
 					break;
@@ -516,17 +505,16 @@
 				continue;
 			}
 		}
+
 		if (res == -1)
 			break;
 
 		/* if we get one of our stop chars, return it to the calling function */
-		if (stop && strchr(stop, res)) {
-			/* res = 0; */
-			break;
-		}
-	}
-	if (chan)
-		ast_stopstream(chan);
+		if (stop && strchr(stop, res))
+			break;
+	}
+
+	ast_stopstream(chan);
 
 	return res;
 }

Modified: team/crichter/0.3.0/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_dial.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_dial.c (original)
+++ team/crichter/0.3.0/apps/app_dial.c Fri Dec 16 04:50:14 2005
@@ -962,7 +962,7 @@
 	/* If a channel group has been specified, get it for use when we create peer channels */
 	outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
 
-	ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID);
+	ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP);
 	cur = args.peers;
 	do {
 		/* Remember where to start next time */

Modified: team/crichter/0.3.0/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_externalivr.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_externalivr.c (original)
+++ team/crichter/0.3.0/apps/app_externalivr.c Fri Dec 16 04:50:14 2005
@@ -345,8 +345,6 @@
 			goto exit;
 		}
 
-		setvbuf(child_events, NULL, _IONBF, 0);
-
 		if (!(child_commands = fdopen(child_commands_fd, "r"))) {
 			ast_chan_log(LOG_WARNING, chan, "Could not open stream for child commands\n");
 			goto exit;
@@ -356,6 +354,10 @@
 			ast_chan_log(LOG_WARNING, chan, "Could not open stream for child errors\n");
 			goto exit;
 		}
+
+		setvbuf(child_events, NULL, _IONBF, 0);
+		setvbuf(child_commands, NULL, _IONBF, 0);
+		setvbuf(child_errors, NULL, _IONBF, 0);
 
 		res = 0;
 

Modified: team/crichter/0.3.0/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_macro.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_macro.c (original)
+++ team/crichter/0.3.0/apps/app_macro.c Fri Dec 16 04:50:14 2005
@@ -86,6 +86,11 @@
 STANDARD_LOCAL_USER;
 
 LOCAL_USER_DECL;
+
+static char *safe_strdup(const char *s)
+{
+	return s ? strdup(s) : NULL;
+}
 
 static int macro_exec(struct ast_channel *chan, void *data)
 {
@@ -162,25 +167,17 @@
 	}
 	argc = 1;
 	/* Save old macro variables */
-	save_macro_exten = pbx_builtin_getvar_helper(chan, "MACRO_EXTEN");
-	if (save_macro_exten) 
-		save_macro_exten = strdup(save_macro_exten);
+	save_macro_exten = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_EXTEN"));
 	pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", oldexten);
 
-	save_macro_context = pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT");
-	if (save_macro_context)
-		save_macro_context = strdup(save_macro_context);
+	save_macro_context = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"));
 	pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", oldcontext);
 
-	save_macro_priority = pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY");
-	if (save_macro_priority) 
-		save_macro_priority = strdup(save_macro_priority);
+	save_macro_priority = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY"));
 	snprintf(pc, sizeof(pc), "%d", oldpriority);
 	pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", pc);
   
-	save_macro_offset = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET");
-	if (save_macro_offset) 
-		save_macro_offset = strdup(save_macro_offset);
+	save_macro_offset = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"));
 	pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", NULL);
 
 	/* Setup environment for new run */

Modified: team/crichter/0.3.0/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_voicemail.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_voicemail.c (original)
+++ team/crichter/0.3.0/apps/app_voicemail.c Fri Dec 16 04:50:14 2005
@@ -536,10 +536,10 @@
 		if (mailbox) 
 			ast_copy_string(retval->mailbox, mailbox, sizeof(retval->mailbox));
 		populate_defaults(retval);
-		if (ast_test_flag((&globalflags), VM_SEARCH))
+		if (!context && ast_test_flag((&globalflags), VM_SEARCH))
 			var = ast_load_realtime("voicemail", "mailbox", mailbox, NULL);
 		else
-			var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", retval->context, NULL);
+			var = ast_load_realtime("voicemail", "mailbox", mailbox, "context", context, NULL);
 		if (var) {
 			tmp = var;
 			while(tmp) {
@@ -582,7 +582,7 @@
 	while (cur) {
 		if (ast_test_flag((&globalflags), VM_SEARCH) && !strcasecmp(mailbox, cur->mailbox))
 			break;
-		if ((!strcasecmp(context, cur->context)) && (!strcasecmp(mailbox, cur->mailbox)))
+		if (context && (!strcasecmp(context, cur->context)) && (!strcasecmp(mailbox, cur->mailbox)))
 			break;
 		cur=cur->next;
 	}

Modified: team/crichter/0.3.0/channel.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channel.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channel.c (original)
+++ team/crichter/0.3.0/channel.c Fri Dec 16 04:50:14 2005
@@ -3055,7 +3055,6 @@
 	if (ast_test_flag(clone, AST_FLAG_ZOMBIE)) {
 		ast_log(LOG_DEBUG, "Destroying channel clone '%s'\n", clone->name);
 		ast_mutex_unlock(&clone->lock);
-		ast_channel_free(clone);
 		manager_event(EVENT_FLAG_CALL, "Hangup", 
 			"Channel: %s\r\n"
 			"Uniqueid: %s\r\n"
@@ -3066,6 +3065,7 @@
 			clone->hangupcause,
 			ast_cause2str(clone->hangupcause)
 			);
+		ast_channel_free(clone);
 	} else {
 		struct ast_frame null_frame = { AST_FRAME_NULL, };
 		ast_log(LOG_DEBUG, "Released clone lock on '%s'\n", clone->name);

Modified: team/crichter/0.3.0/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_agent.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_agent.c (original)
+++ team/crichter/0.3.0/channels/chan_agent.c Fri Dec 16 04:50:14 2005
@@ -1417,7 +1417,7 @@
 		/* Set a default status. It 'should' get changed. */
 		status = "AGENT_UNKNOWN";
 
-		if (!ast_strlen_zero(p->loginchan)) {
+		if (!ast_strlen_zero(p->loginchan) && !p->chan) {
 			loginChan = p->loginchan;
 			talkingtoChan = "n/a";
 			status = "AGENT_IDLE";

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=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Fri Dec 16 04:50:14 2005
@@ -62,7 +62,6 @@
 #include "chan_misdn_config.h"
 #include "isdn_lib.h"
 
-
 ast_mutex_t release_lock_mutex;
 
 #define release_lock ast_mutex_lock(&release_lock_mutex)
@@ -102,6 +101,17 @@
 
 
 /* BEGIN: chan_misdn.h */
+
+
+enum tone_e {
+	TONE_NONE=0,
+	TONE_DIAL,
+	TONE_ALERTING,
+	TONE_BUSY,
+	TONE_CUSTOM,
+	TONE_FILE
+};
+
 
 enum misdn_chan_state {
 	MISDN_NOTHING,		/*!< at beginning */
@@ -161,6 +171,8 @@
 	int addr;
 
 	char context[BUFFERSIZE];
+
+	const struct tone_zone_sound *ts;
 	
 	struct chan_list *peer;
 	struct chan_list *next;
@@ -230,8 +242,8 @@
 
 /* #define MISDN_DEBUG 1 */
 
-static  char *desc = "Channel driver for mISDN Support (Bri/Pri)";
-char *misdn_type = "mISDN";
+static char *desc = "Channel driver for mISDN Support (Bri/Pri)";
+static char *misdn_type = "mISDN";
 
 static int tracing = 0 ;
 
@@ -266,6 +278,7 @@
 
 
 
+static int tone_indicate( struct chan_list *cl, enum tone_e tone);
 
 static int start_bc_tones(struct chan_list *cl);
 static int stop_bc_tones(struct chan_list *cl);
@@ -300,25 +313,6 @@
 	return NULL;
 }
 
-static char* tone2str(struct misdn_bchannel *bc)
-{
-	static struct {
-		char name[16];
-		enum tone_e tone;
-	} *tone, tone_buf[] = {
-		{"NOTONE",TONE_NONE},
-		{"DIAL",TONE_DIAL},
-		{"BUSY",TONE_BUSY},
-		{"ALERT",TONE_ALERTING},
-		{"",TONE_NONE}
-	};
-  
-  
-	for (tone=&tone_buf[0]; tone->name[0]; tone++) {
-		if (tone->tone == bc->tone) return tone->name;
-	}
-	return NULL;
-}
 
 static char *bearer2str(int cap) {
 	static char *bearers[]={
@@ -643,7 +637,6 @@
 			"  --> ch_addr: %x\n"
 			"  --> bc_addr: %x\n"
 			"  --> bc_l3id: %x\n"
-			"  --> tone: %s\n"
 			"  --> display: %s\n"
 			"  --> activated: %d\n"
 			"  --> capability: %s\n"
@@ -655,7 +648,6 @@
 			help->addr,
 			bc->addr,
 			bc?bc->l3_id:-1,
-			tone2str(bc),
 			bc->display,
 			
 			bc->active,
@@ -1536,7 +1528,7 @@
 	}
 
 	{
-		char *tmp_key = pbx_builtin_getvar_helper(p->ast, "CRYPT_KEY");
+		const char *tmp_key = pbx_builtin_getvar_helper(p->ast, "CRYPT_KEY");
 		
 		if (tmp_key ) {
 			chan_misdn_log(1, p->bc->port, " --> Connection will be BF crypted\n");
@@ -1552,7 +1544,7 @@
 	}
 
 	{
-		char *async=pbx_builtin_getvar_helper(ast, "MISDN_DIGITAL_TRANS");
+		const char *async=pbx_builtin_getvar_helper(ast, "MISDN_DIGITAL_TRANS");
 		if (async) {
 			chan_misdn_log(1, p->bc->port, " --> Connection is transparent digital\n");
 			p->bc->async=1;
@@ -1671,7 +1663,7 @@
 		p->bc->out_cause=17;
 		if (p->state != MISDN_CONNECTED) {
 			misdn_lib_send_event( p->bc, EVENT_DISCONNECT);
-			manager_send_tone(p->bc, TONE_BUSY);
+			tone_indicate(p, TONE_BUSY);
 		} else {
 
 			chan_misdn_log(-1, p->bc->port, " --> !! Got Busy in Connected State !?! ast:%s\n", ast->name);
@@ -1691,7 +1683,10 @@
 		
 		misdn_lib_send_event( p->bc, EVENT_ALERTING);
 		
-		manager_send_tone(p->bc, TONE_ALERTING);
+		tone_indicate(p, TONE_ALERTING);
+		//tone_indicate(p->bc, TONE_NONE);
+		
+		
 		chan_misdn_log(1, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
 		ast_setstate(ast,AST_STATE_RINGING);
 		break;
@@ -1724,7 +1719,7 @@
 		}
 
 		if (p->bc->nt) {
-			manager_send_tone(p->bc, TONE_BUSY);
+			tone_indicate(p, TONE_BUSY);
 		}
 		break;
 	case -1 :
@@ -1796,7 +1791,7 @@
 	
 	
 	{
-		char *varcause=NULL;
+		const char *varcause=NULL;
 		bc->cause=ast->hangupcause?ast->hangupcause:16;
 		
 		if ( (varcause=pbx_builtin_getvar_helper(ast, "HANGUPCAUSE")) ||
@@ -1818,7 +1813,7 @@
 		case MISDN_HOLDED:
 		case MISDN_DIALING:
 			start_bc_tones(p);
-			manager_send_tone(bc, TONE_BUSY);
+			tone_indicate(p, TONE_BUSY);
 			p->state=MISDN_CLEANING;
 			
 			misdn_lib_send_event( bc, EVENT_RELEASE_COMPLETE);
@@ -1829,7 +1824,7 @@
 			chan_misdn_log(2, bc->port, " --> * State Alerting\n");
 
 			if (p->orginator != ORG_AST) 
-				manager_send_tone(bc, TONE_BUSY);
+				tone_indicate(p, TONE_BUSY);
       
 			p->state=MISDN_CLEANING;
 			misdn_lib_send_event( bc, EVENT_DISCONNECT);
@@ -1838,7 +1833,7 @@
 			/*  Alerting or Disconect */
 			chan_misdn_log(2, bc->port, " --> * State Connected\n");
 			start_bc_tones(p);
-			manager_send_tone(bc, TONE_BUSY);
+			tone_indicate(p, TONE_BUSY);
 			misdn_lib_send_event( bc, EVENT_DISCONNECT);
       
 			p->state=MISDN_CLEANING; /* MISDN_HUNGUP_FROM_AST; */
@@ -1921,8 +1916,8 @@
 		return -1;
 	}
 	
-	if (ch->bc->tone != TONE_NONE)
-		manager_send_tone(ch->bc,TONE_NONE);
+	/*if (ch->bc->tone != TONE_NONE)
+	  tone_indicate(ch,TONE_NONE); */
 	
 	
 	if (ch->holded ) {
@@ -1934,10 +1929,17 @@
 		chan_misdn_log(5, ch->bc->port, "misdn_write: Returning because notxone\n");
 		return 0;
 	}
+
+
+	if ( !frame->subclass) {
+		chan_misdn_log(0, ch->bc->port, "misdn_write: * prods us\n");
+		return 0;
+	}
 	
 	if ( !(frame->subclass & prefformat)) {
-
+		
 		chan_misdn_log(-1, ch->bc->port, "Got Unsupported Frame with Format:%d\n", frame->subclass);
+		return -1;
 	}
 	
 	
@@ -1952,6 +1954,13 @@
 	}
 #endif
 
+	
+	if (!ch->bc->active) {
+		chan_misdn_log(5, ch->bc->port, "BC not active droping: %d frames\n",frame->samples);
+		return 0;
+	}
+	
+	chan_misdn_log(9, ch->bc->port, "Sending :%d bytes 2 MISDN\n",frame->samples);
 	/*if speech flip bits*/
 	if ( misdn_cap_is_speech(ch->bc->capability) )
 		flip_buf_bits(frame->data,frame->samples);
@@ -2063,10 +2072,56 @@
 
 /** AST INDICATIONS END **/
 
+static int tone_indicate( struct chan_list *cl, enum tone_e tone)
+{
+	const struct tone_zone_sound *ts= NULL;
+	struct ast_channel *ast=cl->ast;
+	
+	chan_misdn_log(0,cl->bc->port,"Tone Indicate:\n");
+	
+	if (!cl->ast) {
+		return 0;
+	}
+	
+	switch (tone) {
+	case TONE_DIAL:
+		chan_misdn_log(0,cl->bc->port," --> Dial\n");
+		ts=ast_get_indication_tone(ast->zone,"dial");
+		misdn_lib_tone_generator_start(cl->bc);
+		break;
+	case TONE_ALERTING:
+		chan_misdn_log(0,cl->bc->port," --> Ring\n");
+		ts=ast_get_indication_tone(ast->zone,"ring");
+		misdn_lib_tone_generator_stop(cl->bc);
+		break;
+	case TONE_BUSY:
+		chan_misdn_log(0,cl->bc->port," --> Busy\n");
+		ts=ast_get_indication_tone(ast->zone,"busy");
+		misdn_lib_tone_generator_stop(cl->bc);
+		break;
+	case TONE_FILE:
+		break;
+
+	case TONE_NONE:
+		chan_misdn_log(0,cl->bc->port," --> None\n");
+		misdn_lib_tone_generator_stop(cl->bc);
+		ast_playtones_stop(ast);
+		break;
+	default:
+		chan_misdn_log(0,cl->bc->port,"Don't know how to handle tone: %d\n",tone);
+	}
+	
+	cl->ts=ts;	
+	
+	if (ts) ast_playtones_start(ast,0, ts->data, 0);
+	
+	return 0;
+}
+
 static int start_bc_tones(struct chan_list* cl)
 {
 	manager_bchannel_activate(cl->bc);
-	manager_send_tone(cl->bc ,TONE_NONE);
+	misdn_lib_tone_generator_stop(cl->bc);
 	cl->notxtone=0;
 	cl->norxtone=0;
 	return 0;
@@ -2381,15 +2436,16 @@
 static int misdn_tx2ast_frm(struct chan_list * tmp, char * buf,  int len )
 {
 	struct ast_frame frame;
-	
+
 	/* If in hold state we drop frame .. */
 	if (tmp->holded ) return 0;
-
+	
 	switch(tmp->state) {
 	case MISDN_CLEANING:
 	case MISDN_EXTCANTMATCH:
+		return 0;
+		
 	case MISDN_WAITING4DIGS:
-		return 0;
 	default:
 		break;
 	}
@@ -2475,7 +2531,7 @@
 #endif
 		chan_misdn_log(9, tmp->bc->port, "Queueing %d bytes 2 Asterisk\n",len);
 		ast_queue_frame(tmp->ast,&frame);
-		
+
 	}  else {
 		ast_log (LOG_WARNING, "No ast || ast->pvt || ch\n");
 	}
@@ -2726,7 +2782,7 @@
 		}
 	}
 
-	manager_send_tone(bc,TONE_DIAL);  
+	tone_indicate(ch,TONE_DIAL);  
   
 	chan_misdn_log(1, bc->port, "* Starting Ast ctx:%s dad:%s oad:%s with 's' extension\n", ast->context, ast->exten, AST_CID_P(ast));
   
@@ -2734,7 +2790,7 @@
   
 	if (ast_pbx_start(ast)<0) {
 		ast=NULL;
-		manager_send_tone(bc,TONE_BUSY);
+		tone_indicate(ch,TONE_BUSY);
 
 		if (bc->nt)
 			misdn_lib_send_event(bc, EVENT_RELEASE_COMPLETE );
@@ -2800,7 +2856,7 @@
 	if (!ch)
 		ch=find_chan_by_l3id(cl_te, bc->l3_id);
 	
-	if (event != EVENT_BCHAN_DATA) { /*  Debug Only Non-Bchan */
+	if (event != EVENT_BCHAN_DATA && event != EVENT_TONE_GENERATE) { /*  Debug Only Non-Bchan */
 		chan_misdn_log(1, bc->port, "I IND :%s oad:%s dad:%s\n", manager_isdn_get_info(event), bc->oad, bc->dad);
 		misdn_lib_log_ies(bc);
 	}
@@ -2830,6 +2886,11 @@
 	
 	
 	switch (event) {
+
+	case EVENT_BCHAN_ACTIVATED:
+		break;
+		
+		
 	case EVENT_NEW_L3ID:
 		ch->l3id=bc->l3_id;
 		break;
@@ -2865,8 +2926,8 @@
 	{
 		int stop_tone;
 		misdn_cfg_get( 0, MISDN_GEN_STOP_TONE, &stop_tone, sizeof(int));
-		if ( stop_tone && bc->tone != TONE_NONE) {
-			manager_send_tone(bc,TONE_NONE);
+		if ( stop_tone ) {
+			tone_indicate(ch,TONE_NONE);
 		}
 		
 		if (ch->state == MISDN_WAITING4DIGS ) {
@@ -2889,7 +2950,7 @@
 			if(!ast_canmatch_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
 
 				chan_misdn_log(-1, bc->port, "Extension can never match, so disconnecting\n");
-				manager_send_tone(bc,TONE_BUSY);
+				tone_indicate(ch,TONE_BUSY);
 				ch->state=MISDN_EXTCANTMATCH;
 				bc->out_cause=1;
 
@@ -2902,12 +2963,12 @@
 			if (ast_exists_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
 				ch->state=MISDN_DIALING;
 	  
-				manager_send_tone(bc,TONE_NONE);
+				tone_indicate(ch,TONE_NONE);
 /*				chan_misdn_log(1, bc->port, " --> * Starting Ast ctx:%s\n", ch->context);*/
 				if (ast_pbx_start(ch->ast)<0) {
 
 					chan_misdn_log(-1, bc->port, "ast_pbx_start returned < 0 in INFO\n");
-					manager_send_tone(bc,TONE_BUSY);
+					tone_indicate(ch,TONE_BUSY);
 
 					if (bc->nt)
 						misdn_lib_send_event(bc, EVENT_RELEASE_COMPLETE );
@@ -3029,7 +3090,7 @@
 			
 			chan_misdn_log(-1, bc->port, "Extension can never match, so disconnecting\n");
 
-			manager_send_tone(bc,TONE_BUSY);
+			tone_indicate(ch,TONE_BUSY);
 			ch->state=MISDN_EXTCANTMATCH;
 			bc->out_cause=1;
 
@@ -3055,7 +3116,7 @@
 
 				chan_misdn_log(-1, bc->port, "ast_pbx_start returned <0 in SETUP\n");
 				chan=NULL;
-				manager_send_tone(bc,TONE_BUSY);
+				tone_indicate(ch,TONE_BUSY);
 
 				if (bc->nt)
 					misdn_lib_send_event(bc, EVENT_RELEASE_COMPLETE );
@@ -3075,9 +3136,9 @@
 			int stop_tone;
 			misdn_cfg_get( 0, MISDN_GEN_STOP_TONE, &stop_tone, sizeof(int));
 			if ( (!ast_strlen_zero(bc->dad)) && stop_tone ) 
-				manager_send_tone(bc,TONE_NONE);
+				tone_indicate(ch,TONE_NONE);
 			else
-				manager_send_tone(bc,TONE_DIAL);
+				tone_indicate(ch,TONE_DIAL);
 	
 			ch->state=MISDN_WAITING4DIGS;
 		}
@@ -3145,8 +3206,8 @@
 		cb_log(1,bc->port,"Set State Ringing\n");
 		
 		if ( misdn_cap_is_speech(bc->capability) && misdn_inband_avail(bc)) {
-			 start_bc_tones(ch);
-		 }
+			start_bc_tones(ch);
+		}
 	}
 	break;
 	case EVENT_CONNECT:
@@ -3234,10 +3295,37 @@
 		release_chan(bc);
 	}
 	break;
-	
+
+
+	case EVENT_TONE_GENERATE:
+	{
+		int tone_len=bc->tone_cnt;
+		struct ast_channel *ast=ch->ast;
+		void *tmp;
+		int res;
+		int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples);
+
+		chan_misdn_log(9,0,"TONE_GEN: len:%d\n");
+		
+		if (!ast->generator) break;
+		
+		tmp = ast->generatordata;
+		ast->generatordata = NULL;
+		generate = ast->generator->generate;
+		res = generate(ast, tmp, tone_len, tone_len);
+		ast->generatordata = tmp;
+		if (res) {
+			ast_log(LOG_WARNING, "Auto-deactivating generator\n");
+			ast_deactivate_generator(ast);
+		} else {
+			bc->tone_cnt=0;
+		}
+		
+	}
+	break;
+		
 	case EVENT_BCHAN_DATA:
 	{
-		
 		if ( !misdn_cap_is_speech(ch->bc->capability) || bc->nojitter) {
 			misdn_tx2ast_frm(ch, bc->bframe, bc->bframe_len );
 		} else {
@@ -3275,7 +3363,6 @@
 				
 			}
 		}
-		
 	}
 	break;
 	case EVENT_TIMEOUT:

Modified: team/crichter/0.3.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_sip.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_sip.c (original)
+++ team/crichter/0.3.0/channels/chan_sip.c Fri Dec 16 04:50:14 2005
@@ -2279,6 +2279,7 @@
 /* Possible values taken from causes.h */
 
 	switch(cause) {
+		case 603:	/* Declined */
 		case 403:	/* Not found */
 			return AST_CAUSE_CALL_REJECTED;
 		case 404:	/* Not found */
@@ -2458,7 +2459,7 @@
 				if (ast->hangupcause && ((res = hangup_cause2sip(ast->hangupcause)))) {
 					transmit_response_reliable(p, res, &p->initreq, 1);
 				} else 
-					transmit_response_reliable(p, "403 Forbidden", &p->initreq, 1);
+					transmit_response_reliable(p, "603 Declined", &p->initreq, 1);
 			}
 		} else {	/* Call is in UP state, send BYE */
 			if (!p->pendinginvite) {

Modified: team/crichter/0.3.0/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_zap.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_zap.c (original)
+++ team/crichter/0.3.0/channels/chan_zap.c Fri Dec 16 04:50:14 2005
@@ -5269,6 +5269,7 @@
 				return NULL;
 			} else if (res) {
 				exten[len++] = res;
+				exten[len] = '\0';
 			} else
 				break;
 		}
@@ -5375,6 +5376,7 @@
 			default:
 				/* If we got the first digit, get the rest */
 				len = 1;
+				dtmfbuf[len] = '\0';
 				while((len < AST_MAX_EXTENSION-1) && ast_matchmore_extension(chan, chan->context, dtmfbuf, 1, p->cid_num)) {
 					if (ast_exists_extension(chan, chan->context, dtmfbuf, 1, p->cid_num)) {
 						timeout = matchdigittimeout;
@@ -5388,6 +5390,7 @@
 						return NULL;
 					} else if (res) {
 						dtmfbuf[len++] = res;
+						dtmfbuf[len] = '\0';
 					} else {
 						break;
 					}

Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Fri Dec 16 04:50:14 2005
@@ -452,8 +452,8 @@
 	
 	bc->crypt_key[0] = 0;
 	
-	bc->tone=TONE_NONE;
-	bc->tone_cnt2 = bc->tone_cnt=0;
+	bc->generate_tone=0;
+	bc->tone_cnt=0;
   
 	bc->dnumplan=NUMPLAN_UNKNOWN;
 	bc->onumplan=NUMPLAN_UNKNOWN;
@@ -650,7 +650,6 @@
 	
 	act.addr = (stack->upper_id | FLG_MSG_DOWN)  ;
 
-	//act.dinfo = SSTATUS_ALL|SSTATUS_BROADCAST_BIT;
 	act.dinfo = SSTATUS_L1;
 	
 	act.len = 0;
@@ -758,8 +757,6 @@
 	int channel=bc->channel-1-(bc->channel>16);
 	int b_stid=stack->b_stids[channel>=0?channel:0];
 	
-	
-	//if (bc->nodsp ) clean_up_bc(bc);
 	
 	if ( !misdn_cap_is_speech(bc->capability))
 		clean_up_bc(bc);
@@ -1859,84 +1856,27 @@
 
 
 
+void misdn_lib_tone_generator_start(struct misdn_bchannel *bc)
+{
+	bc->generate_tone=1;
+}
+
+void misdn_lib_tone_generator_stop(struct misdn_bchannel *bc)
+{
+	bc->generate_tone=0;
+}
+
 
 static int do_tone(struct misdn_bchannel *bc, int len)
 {
-	char buf[4096 + mISDN_HEADER_LEN];
-	iframe_t *frm= (iframe_t*)buf;
-	int  r;
-	struct misdn_stack *stack=get_stack_by_bc(bc);
-	
-	if (bc->tone == TONE_NONE) return 0;
-
-	frm->prim = DL_DATA|REQUEST;
-	frm->dinfo = 0;
-
-	frm->addr = bc->addr | FLG_MSG_DOWN ;
-
-	
-  
-	bc->tone_cnt+=len;
-
-	if (bc->tone_cnt < TONE_425_SIZE) return 1;
-	
-	switch(bc->tone) {
-	case TONE_DIAL:
-	{
-		frm->len = TONE_425_SIZE;
-		memcpy(&buf[mISDN_HEADER_LEN], tone_425_flip,TONE_425_SIZE);
-      
-		r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_1SEC);
-		if (r<frm->len) {
-			perror("Error written less than told bytes :(\n");
-		}
-	}
-	break;
-
-	case TONE_ALERTING:
-		bc->tone_cnt2++;
-    
-		if (bc->tone_cnt2 <= TONE_ALERT_CNT) {
-			frm->len = TONE_425_SIZE;
-			memcpy(&buf[mISDN_HEADER_LEN], tone_425_flip,TONE_425_SIZE);
-			r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_1SEC);
-			if (r<frm->len) {
-				perror("Error written less than told bytes :(\n");
-			}
-		} else if (bc->tone_cnt2 <= (TONE_ALERT_SILENCE_CNT)) {
-			frm->len = TONE_SILENCE_SIZE;
-			memcpy(&buf[mISDN_HEADER_LEN], tone_silence_flip ,TONE_SILENCE_SIZE);
-			r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_1SEC);
-		} else {
-			bc->tone_cnt2=-1;
-		}
-		break;
-	case TONE_BUSY:
-		bc->tone_cnt2++;
-    
-		if (bc->tone_cnt2 <= TONE_BUSY_CNT) {
-			frm->len = TONE_425_SIZE;
-			memcpy(&buf[mISDN_HEADER_LEN], tone_425_flip,TONE_425_SIZE);
-			r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_1SEC);
-			if (r<frm->len) {
-				perror("Error written less than told bytes :(\n");
-			}
-		} else if (bc->tone_cnt2 <= (TONE_BUSY_SILENCE_CNT)) {
-			frm->len = TONE_SILENCE_SIZE;
-			memcpy(&buf[mISDN_HEADER_LEN], tone_silence_flip ,TONE_SILENCE_SIZE);
-			r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_1SEC);
-		} else {
-			bc->tone_cnt2=-1;
-		}
-		break;
-	case TONE_FILE:
-		break;
-	case TONE_NONE:
-		return 0;
-	}
-  
-	bc->tone_cnt -= TONE_425_SIZE ;
-	return 1;
+	bc->tone_cnt=len;
+	
+	if (bc->generate_tone) {
+		cb_event(EVENT_TONE_GENERATE, bc, glob_mgr->user_data);
+		return 1;
+	}
+	
+	return 0;
 }
 
 
@@ -1979,6 +1919,7 @@
 		free_msg(msg);
 		
 		manager_bchannel_activate(bc);
+				
 		return 1;
 	case MGR_DELLAYER| CONFIRM:
 		cb_log(2, stack->port, "BCHAN: MGR_DELLAYER|CNF \n");
@@ -1996,7 +1937,9 @@
 	case DL_ESTABLISH | CONFIRM:
 		cb_log(4, stack->port, "BCHAN: bchan ACT Confirm\n");
 		free_msg(msg);
-
+		
+		cb_event(EVENT_BCHAN_ACTIVATED, bc, glob_mgr->user_data);
+		
 		return 1;    
 		
 	case PH_DEACTIVATE | INDICATION:
@@ -3224,8 +3167,12 @@
 {
 	msg_t *msg=alloc_msg(MAX_MSG_SIZE);
 	iframe_t *frm;
-
+	
 	struct misdn_stack *stack=get_stack_by_bc(bc);
+
+	if (!stack) {
+		cb_log(-1, stack->port, "bchannel_activate: Stack not found !");
+	}
 	
 	if (!msg) {
 		cb_log(-1, stack->port, "bchannel_activate: alloc_msg failed !");
@@ -3272,8 +3219,8 @@
   
 	cb_log(5, stack->port, "$$$ Bchan deActivated addr %x\n", bc->addr);
   
-	bc->tone=TONE_NONE;
-
+	bc->generate_tone=0;
+	
 	dact.prim = DL_RELEASE | REQUEST;
 	dact.addr = bc->addr | FLG_MSG_DOWN;
 	dact.dinfo = 0;
@@ -3310,17 +3257,6 @@
 	r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_INFINIT);
 	
 	return 0;
-}
-
-
-
-
-void manager_send_tone (struct misdn_bchannel *bc, enum tone_e tone)
-{
-	if (tone != TONE_NONE) manager_bchannel_activate(bc);
-	bc->tone=tone;
-	bc->tone_cnt2=-1;
-	bc->tone_cnt=0;
 }
 
 

Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.h?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.h (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.h Fri Dec 16 04:50:14 2005
@@ -31,15 +31,6 @@
 	STATE_HOLD_ACKNOWLEDGE
 };
 
-
-enum tone_e {
-	TONE_NONE=0,
-	TONE_DIAL,
-	TONE_ALERTING,
-	TONE_BUSY,
-	TONE_FILE
-};
-
 enum misdn_err_e {
 	ENOCHAN=1
 };
@@ -66,7 +57,9 @@
 
 enum event_e {
 	EVENT_NOTHING,
+	EVENT_TONE_GENERATE,
 	EVENT_BCHAN_DATA,
+	EVENT_BCHAN_ACTIVATED,
 	EVENT_CLEANUP,
 	EVENT_PROCEEDING,
 	EVENT_PROGRESS,
@@ -242,9 +235,8 @@
 	int active;
 	int upset;
 
-	enum tone_e tone;
+	int generate_tone;
 	int tone_cnt;
-	int tone_cnt2;
   
 	enum bc_state_e state;
 
@@ -334,8 +326,6 @@
 
 int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len);
 
-void manager_send_tone (struct misdn_bchannel *bc, enum tone_e tone);
-
 void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2);
 
 
@@ -375,6 +365,10 @@
 
 /** Ibuf interface End **/
 
+void misdn_lib_tone_generator_start(struct misdn_bchannel *bc);
+void misdn_lib_tone_generator_stop(struct misdn_bchannel *bc);
+
+
 void misdn_lib_setup_bc(struct misdn_bchannel *bc);
 
 void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2);

Modified: team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_msg_parser.c Fri Dec 16 04:50:14 2005
@@ -1189,6 +1189,8 @@
 char EVENT_NEW_L3ID_INFO[] = "NEW_L3ID";
 char EVENT_NEW_BC_INFO[] = "NEW_BC";
 char EVENT_BCHAN_DATA_INFO[] = "BCHAN_DATA";
+char EVENT_BCHAN_ACTIVATED_INFO[] = "BCHAN_ACTIVATED";
+char EVENT_TONE_GENERATE_INFO[] = "TONE_GENERATE";
 
 char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt)
 {
@@ -1201,6 +1203,8 @@
 	if (event == EVENT_NEW_L3ID) return EVENT_NEW_L3ID_INFO;
 	if (event == EVENT_NEW_BC) return EVENT_NEW_BC_INFO;
 	if (event == EVENT_BCHAN_DATA) return EVENT_BCHAN_DATA_INFO;
+	if (event == EVENT_BCHAN_ACTIVATED) return EVENT_BCHAN_ACTIVATED_INFO;
+	if (event == EVENT_TONE_GENERATE) return EVENT_TONE_GENERATE_INFO;
 	
 	return NULL;
 }

Modified: team/crichter/0.3.0/configs/features.conf.sample
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/configs/features.conf.sample?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/configs/features.conf.sample (original)
+++ team/crichter/0.3.0/configs/features.conf.sample Fri Dec 16 04:50:14 2005
@@ -11,6 +11,7 @@
 ;transferdigittimeout => 3	; Number of seconds to wait between digits when transfering a call
 ;courtesytone = beep		; Sound file to play to the parked caller 
 				; when someone dials a parked call
+				; or the Touch Monitor is activated/deactivated.
 ;xfersound = beep		; to indicate an attended transfer is complete
 ;xferfailsound = beeperr	; to indicate a failed transfer
 ;adsipark = yes			; if you want ADSI parking announcements
@@ -23,7 +24,7 @@
 [featuremap]
 ;blindxfer => #1		; Blind transfer
 ;disconnect => *0		; Disconnect
-;automon => *1			; One Touch Record
+;automon => *1			; One Touch Record (a.k.a. Touch Monitor)
 ;atxfer => *2			; Attended transfer
 
 [applicationmap]

Modified: team/crichter/0.3.0/configs/res_odbc.conf.sample
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/configs/res_odbc.conf.sample?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/configs/res_odbc.conf.sample (original)
+++ team/crichter/0.3.0/configs/res_odbc.conf.sample Fri Dec 16 04:50:14 2005
@@ -1,17 +1,28 @@
 ;;; odbc setup file 
 
+; ENV is a global set of environmental variables that will get set.
+; Note that all environmental variables can be seen by all connections,
+; so you can't have different values for different connections.
+[ENV]
+INFORMIXSERVER => my_special_database
+INFORMIXDIR => /opt/informix
+
+; All other sections are arbitrary names for database connections.
+
 [asterisk]
+enabled => yes
 dsn => asterisk
 ;username => myuser
 ;password => mypass
 pre-connect => yes
 
 
-;[mysql2]
-;dsn => MySQL-asterisk
-;username => myuser
-;password => mypass
-;pre-connect => yes
+[mysql2]
+enabled => no
+dsn => MySQL-asterisk
+username => myuser
+password => mypass
+pre-connect => yes
 
 
 

Modified: team/crichter/0.3.0/doc/README.variables
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/doc/README.variables?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/doc/README.variables (original)
+++ team/crichter/0.3.0/doc/README.variables Fri Dec 16 04:50:14 2005
@@ -94,17 +94,17 @@
 
 
 
-_______________________________
-REMOVING CHARACTERS FROM STRING
--------------------------------
-
-The format for removing characters from a variable can be expressed as:
+___________________________________
+SELECTING CHARACTERS FROM VARIABLES
+-----------------------------------
+
+The format for selecting characters from a variable can be expressed as:
 
 	${variable_name[:offset[:length]]}
 
-If you want to remove the first N characters from the string assigned
+If you want to select the first N characters from the string assigned
 to a variable, simply append a colon and the number of characters to
-remove from the beginning of the string to the variable name.
+skip from the beginning of the string to the variable name.
 
 	;Remove the first character of extension, save in "number" variable
 	exten => _9X.,1,Set(number=${EXTEN:1})
@@ -115,7 +115,7 @@
 digit.
 
 If you use a negative offset number, Asterisk starts counting from the end 
-of the string and then removes everything before the new position. The following
+of the string and then selects everything after the new position. The following
 example will save the numbers 1234 to the 'number' variable, still assuming
 we've dialed 918005551234.
 
@@ -647,6 +647,7 @@
 ${TALK_DETECTED} 	* Result from talkdetect()
 ${TOUCH_MONITOR} 	The filename base to use with Touch Monitor (auto record)
 ${TOUCH_MONITOR_FORMAT} The audio format to use with Touch Monitor (auto record)
+${TOUCH_MONITOR_OUTPUT} * Recorded file from Touch Monitor (auto record)
 ${TXTCIDNAME}		* Result of application TXTCIDName
 ${VPB_GETDTMF}		chan_vpb
 

Propchange: team/crichter/0.3.0/funcs/func_cut.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/crichter/0.3.0/funcs/func_cut.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: team/crichter/0.3.0/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/include/asterisk/linkedlists.h?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/include/asterisk/linkedlists.h (original)
+++ team/crichter/0.3.0/include/asterisk/linkedlists.h Fri Dec 16 04:50:14 2005
@@ -424,15 +424,16 @@
 #define AST_LIST_REMOVE(head, elm, field) do {			        \
 	if ((head)->first == (elm)) {					\
 		(head)->first = (elm)->field.next;			\
-	}								\
-	else {								\
+		if ((head)->last == (elm))			\
+			(head)->last = NULL;			\
+	} else {								\
 		typeof(elm) curelm = (head)->first;			\
 		while (curelm->field.next != (elm))			\
 			curelm = curelm->field.next;			\
 		curelm->field.next = (elm)->field.next;			\
+		if ((head)->last == curelm->field.next)			\
+			(head)->last = curelm;				\
 	}								\
-	if ((head)->last == elm)					\
-		(head)->last = NULL;					\
 } while (0)
 
 #endif /* _ASTERISK_LINKEDLISTS_H */

Modified: team/crichter/0.3.0/pbx.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/pbx.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/pbx.c (original)
+++ team/crichter/0.3.0/pbx.c Fri Dec 16 04:50:14 2005
@@ -5443,6 +5443,8 @@
 static int pbx_builtin_hangup(struct ast_channel *chan, void *data)
 {
 	/* Just return non-zero and it will hang up */
+	if (!chan->hangupcause)
+		chan->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 	return -1;
 }
 

Modified: team/crichter/0.3.0/utils.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/utils.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/utils.c (original)
+++ team/crichter/0.3.0/utils.c Fri Dec 16 04:50:14 2005
@@ -613,11 +613,11 @@
 	if (a.tv_usec >= ONE_MILLION) {
 		ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
 			a.tv_sec, (long int) a.tv_usec);
-		a.tv_sec += a.tv_usec % ONE_MILLION;
+		a.tv_sec += a.tv_usec / ONE_MILLION;
 		a.tv_usec %= ONE_MILLION;
 	} else if (a.tv_usec < 0) {
 		ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
-				a.tv_sec, (long int) a.tv_usec);
+			a.tv_sec, (long int) a.tv_usec);
 		a.tv_usec = 0;
 	}
 	return a;

Modified: team/crichter/0.3.0/utils/astman.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/utils/astman.c?rev=7499&r1=7498&r2=7499&view=diff
==============================================================================
--- team/crichter/0.3.0/utils/astman.c (original)

[... 13 lines stripped ...]


More information about the asterisk-commits mailing list