[asterisk-commits] russell: branch russell/chan_console r75161 - in /team/russell/chan_console: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 15 17:02:27 CDT 2007


Author: russell
Date: Sun Jul 15 17:02:26 2007
New Revision: 75161

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75161
Log:
resolve conflict, enable automerge

Modified:
    team/russell/chan_console/   (props changed)
    team/russell/chan_console/Makefile
    team/russell/chan_console/apps/app_chanspy.c
    team/russell/chan_console/apps/app_queue.c
    team/russell/chan_console/apps/app_speech_utils.c
    team/russell/chan_console/apps/app_voicemail.c
    team/russell/chan_console/channels/chan_agent.c
    team/russell/chan_console/channels/chan_iax2.c
    team/russell/chan_console/channels/chan_phone.c
    team/russell/chan_console/channels/chan_sip.c
    team/russell/chan_console/channels/chan_skinny.c
    team/russell/chan_console/channels/chan_zap.c
    team/russell/chan_console/channels/misdn/isdn_lib_intern.h
    team/russell/chan_console/configure
    team/russell/chan_console/configure.ac
    team/russell/chan_console/include/asterisk/autoconfig.h.in
    team/russell/chan_console/include/asterisk/monitor.h
    team/russell/chan_console/include/asterisk/rtp.h
    team/russell/chan_console/include/asterisk/speech.h
    team/russell/chan_console/include/asterisk/udptl.h
    team/russell/chan_console/main/app.c
    team/russell/chan_console/main/channel.c
    team/russell/chan_console/main/dns.c
    team/russell/chan_console/main/rtp.c
    team/russell/chan_console/main/udptl.c
    team/russell/chan_console/pbx/pbx_spool.c
    team/russell/chan_console/res/res_agi.c
    team/russell/chan_console/res/res_config_odbc.c
    team/russell/chan_console/res/res_monitor.c
    team/russell/chan_console/res/res_musiconhold.c
    team/russell/chan_console/res/res_smdi.c
    team/russell/chan_console/res/res_speech.c

Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Jul 15 17:02:26 2007
@@ -1,1 +1,1 @@
-/trunk:1-74212
+/trunk:1-75160

Modified: team/russell/chan_console/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/Makefile?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/Makefile (original)
+++ team/russell/chan_console/Makefile Sun Jul 15 17:02:26 2007
@@ -652,7 +652,10 @@
 	rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
 	rm -rf $(DESTDIR)$(ASTHEADERDIR)
 	rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
-	rm -rf $(DESTDIR)$(ASTMANDIR)/man8
+	rm -f $(DESTDIR)$(ASTMANDIR)/man8/asterisk.8
+	rm -f $(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8
+	rm -f $(DESTDIR)$(ASTMANDIR)/man8/autosupport.8
+	rm -f $(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8
 	$(MAKE) -C sounds uninstall
 
 uninstall: _uninstall

Modified: team/russell/chan_console/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_chanspy.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/apps/app_chanspy.c (original)
+++ team/russell/chan_console/apps/app_chanspy.c Sun Jul 15 17:02:26 2007
@@ -674,7 +674,8 @@
 
 		if (ast_test_flag(&flags, OPTION_PRIVATE))
 			ast_set_flag(&flags, OPTION_WHISPER);
-	}
+	} else
+		ast_clear_flag(&flags, AST_FLAGS_ALL);
 
 	oldwf = chan->writeformat;
 	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
@@ -758,7 +759,8 @@
 
 		if (ast_test_flag(&flags, OPTION_PRIVATE))
 			ast_set_flag(&flags, OPTION_WHISPER);
-	}
+	} else
+		ast_clear_flag(&flags, AST_FLAGS_ALL);
 
 	oldwf = chan->writeformat;
 	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {

Modified: team/russell/chan_console/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_queue.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/apps/app_queue.c (original)
+++ team/russell/chan_console/apps/app_queue.c Sun Jul 15 17:02:26 2007
@@ -1468,21 +1468,17 @@
 	return res;
 }
 
-static void recalc_holdtime(struct queue_ent *qe)
-{
-	int oldvalue, newvalue;
+static void recalc_holdtime(struct queue_ent *qe, int newholdtime)
+{
+	int oldvalue;
 
 	/* Calculate holdtime using a recursive boxcar filter */
 	/* Thanks to SRT for this contribution */
 	/* 2^2 (4) is the filter coefficient; a higher exponent would give old entries more weight */
 
-	newvalue = time(NULL) - qe->start;
-
 	ast_mutex_lock(&qe->parent->lock);
-	if (newvalue <= qe->parent->servicelevel)
-		qe->parent->callscompletedinsl++;
 	oldvalue = qe->parent->holdtime;
-	qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newvalue) >> 2;
+	qe->parent->holdtime = (((oldvalue << 2) - oldvalue) + newholdtime) >> 2;
 	ast_mutex_unlock(&qe->parent->lock);
 }
 
@@ -2307,7 +2303,7 @@
 	return res;
 }
 
-static int update_queue(struct call_queue *q, struct member *member)
+static int update_queue(struct call_queue *q, struct member *member, int callcompletedinsl)
 {
 	struct member *cur;
 
@@ -2324,6 +2320,8 @@
 		cur = cur->next;
 	}
 	q->callscompleted++;
+	if (callcompletedinsl)
+		q->callscompletedinsl++;
 	ast_mutex_unlock(&q->lock);
 	return 0;
 }
@@ -2450,6 +2448,8 @@
 	char *p;
 	char vars[2048];
 	int forwardsallowed = 1;
+	int callcompletedinsl;
+
 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
 		
@@ -2559,7 +2559,11 @@
 		if (!strcmp(peer->tech->type, "Zap"))
 			ast_channel_setoption(peer, AST_OPTION_TONE_VERIFY, &nondataquality, sizeof(nondataquality), 0);
 		/* Update parameters for the queue */
-		recalc_holdtime(qe);
+		time(&now);
+		recalc_holdtime(qe, (now - qe->start));
+		ast_mutex_lock(&qe->parent->lock);
+		callcompletedinsl = ((now - qe->start) <= qe->parent->servicelevel);
+		ast_mutex_unlock(&qe->parent->lock);
 		member = lpeer->member;
 		hangupcalls(outgoing, peer);
 		outgoing = NULL;
@@ -2649,13 +2653,13 @@
 				else
 					which = peer;
 				if (monitorfilename)
-					ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1 );
+					ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1, X_REC_IN | X_REC_OUT);
 				else if (qe->chan->cdr)
-					ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1 );
+					ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1, X_REC_IN | X_REC_OUT);
 				else {
 					/* Last ditch effort -- no CDR, make up something */
 					snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
-					ast_monitor_start(which, qe->parent->monfmt, tmpid, 1 );
+					ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT);
 				}
 				if (qe->parent->monjoin)
 					ast_monitor_setjoinfiles(which, 1);
@@ -2893,7 +2897,7 @@
 
 		if (bridge != AST_PBX_NO_HANGUP_PEER)
 			ast_hangup(peer);
-		update_queue(qe->parent, member);
+		update_queue(qe->parent, member, callcompletedinsl);
 		res = bridge ? bridge : 1;
 	}
 out:

Modified: team/russell/chan_console/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_speech_utils.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/apps/app_speech_utils.c (original)
+++ team/russell/chan_console/apps/app_speech_utils.c Sun Jul 15 17:02:26 2007
@@ -150,7 +150,7 @@
 		if (i == wanted_num)
 			break;
 		i++;
-	} while ((result = result->next));
+	} while ((result = AST_LIST_NEXT(result, list)));
 
 	return result;
 }
@@ -315,11 +315,8 @@
 			ast_copy_string(buf, "0", len);
 	} else if (!strcasecmp(data, "results")) {
 		/* Count number of results */
-		result = speech->results;
-		while (result) {
+		for (result = speech->results; result; result = AST_LIST_NEXT(result, list))
 			results++;
-			result = result->next;
-		}
 		snprintf(tmp, sizeof(tmp), "%d", results);
 		ast_copy_string(buf, tmp, len);
 	}
@@ -352,7 +349,7 @@
 	u = ast_module_user_add(chan);
 
 	/* Request a speech object */
-	speech = ast_speech_new(data, AST_FORMAT_SLINEAR);
+	speech = ast_speech_new(data, chan->nativeformats);
 	if (speech == NULL) {
 		/* Not available */
 		pbx_builtin_setvar_helper(chan, "ERROR", "1");
@@ -572,7 +569,7 @@
         oldreadformat = chan->readformat;
 
         /* Change read format to be signed linear */
-        if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
+        if (ast_set_read_format(chan, speech->format)) {
                 ast_module_user_remove(u);
                 return -1;
         }

Modified: team/russell/chan_console/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_voicemail.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/apps/app_voicemail.c (original)
+++ team/russell/chan_console/apps/app_voicemail.c Sun Jul 15 17:02:26 2007
@@ -495,7 +495,7 @@
 	"           message. The units are whole-number decibels (dB).\n"
 	"    s    - Skip the playback of instructions for leaving a message to the\n"
 	"           calling party.\n"
-	"    u    - Play the 'unavailable greeting.\n";
+	"    u    - Play the 'unavailable' greeting.\n";
 
 static char *synopsis_vmain = "Check Voicemail messages";
 
@@ -4176,6 +4176,7 @@
 	char *temp;
 	char todir[256];
 	int todircount=0;
+	struct vm_state *dstvms;
 #endif
 	char username[70]="";
 	int res = 0, cmd = 0;
@@ -4366,7 +4367,19 @@
  				/* should not assume "fmt" here! */
 				save_body(body,vms,"2",fmt);
  
-				STORE(todir, vmtmp->mailbox, vmtmp->context, vms->curmsg, chan, vmtmp, fmt, duration, vms);
+				/* get destination mailbox */
+				dstvms = get_vm_state_by_mailbox(vmtmp->mailbox,0);
+				if (dstvms) {
+					init_mailstream(dstvms, 0);
+					if (!dstvms->mailstream) {
+						ast_log (LOG_ERROR,"IMAP mailstream for %s is NULL\n",vmtmp->mailbox);
+					} else {
+						STORE(todir, vmtmp->mailbox, vmtmp->context, dstvms->curmsg, chan, vmtmp, fmt, duration, dstvms);
+						run_externnotify(vmtmp->context, vmtmp->mailbox); 
+					}
+				} else {
+					ast_log (LOG_ERROR,"Could not find state information for mailbox %s\n",vmtmp->mailbox);
+				}
 
 				if (!ast_strlen_zero(vmtmp->serveremail))
 					myserveremail = vmtmp->serveremail;

Modified: team/russell/chan_console/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_agent.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/channels/chan_agent.c (original)
+++ team/russell/chan_console/channels/chan_agent.c Sun Jul 15 17:02:26 2007
@@ -391,7 +391,7 @@
 		if ((pointer = strchr(filename, '.')))
 			*pointer = '-';
 		snprintf(tmp, sizeof(tmp), "%s%s",savecallsin ? savecallsin : "", filename);
-		ast_monitor_start(ast, recordformat, tmp, needlock);
+		ast_monitor_start(ast, recordformat, tmp, needlock, X_REC_IN | X_REC_OUT);
 		ast_monitor_setjoinfiles(ast, 1);
 		snprintf(tmp2, sizeof(tmp2), "%s%s.%s", urlprefix ? urlprefix : "", filename, recordformatext);
 #if 0
@@ -794,7 +794,7 @@
 			/* Not dead -- check availability now */
 			ast_mutex_lock(&p->lock);
 			/* Store last disconnect time */
-			p->lastdisc = ast_tvnow();
+			p->lastdisc = ast_tvadd(ast_tvnow(), ast_samp2tv(p->wrapuptime, 1000));
 			ast_mutex_unlock(&p->lock);
 		}
 		/* Release ownership of the agent to other threads (presumably running the login app). */
@@ -814,7 +814,7 @@
 	ast_mutex_lock(&p->lock);
 	res = p->app_sleep_cond;
 	if (p->lastdisc.tv_sec) {
-		if (ast_tvdiff_ms(ast_tvnow(), p->lastdisc) > p->wrapuptime) 
+		if (ast_tvdiff_ms(ast_tvnow(), p->lastdisc) > 0) 
 			res = 1;
 	}
 	ast_mutex_unlock(&p->lock);
@@ -1260,7 +1260,9 @@
 		    ast_strlen_zero(p->loginchan)) {
 			if (p->chan)
 				hasagent++;
-			if (!p->lastdisc.tv_sec) {
+			tv = ast_tvnow();
+			if (!p->lastdisc.tv_sec || (tv.tv_sec >= p->lastdisc.tv_sec)) {
+				p->lastdisc = ast_tv(0, 0);
 				/* Agent must be registered, but not have any active call, and not be in a waiting state */
 				if (!p->owner && p->chan) {
 					/* Fixed agent */
@@ -1463,13 +1465,13 @@
 		if (!strcasecmp(p->agent, agent)) {
 			ret = 0;
 			if (p->owner || p->chan) {
-				p->deferlogoff = 1;
 				if (!soft) {
 					if (p->owner)
 						ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
 					if (p->chan)
 						ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
-				}
+				} else
+					p->deferlogoff = 1;
 			} else {
 				logintime = time(NULL) - p->loginstart;
 				p->loginstart = 0;
@@ -1899,6 +1901,10 @@
 						ast_device_state_changed("Agent/%s", p->agent);
 						while (res >= 0) {
 							ast_mutex_lock(&p->lock);
+							if (p->deferlogoff && p->chan) {
+								ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
+								p->deferlogoff = 0;
+							}
 							if (p->chan != chan)
 								res = -1;
 							ast_mutex_unlock(&p->lock);
@@ -1910,7 +1916,7 @@
 							AST_LIST_LOCK(&agents);
 							ast_mutex_lock(&p->lock);
 							if (p->lastdisc.tv_sec) {
-								if (ast_tvdiff_ms(ast_tvnow(), p->lastdisc) > p->wrapuptime) {
+								if (ast_tvdiff_ms(ast_tvnow(), p->lastdisc) > 0) {
 									ast_debug(1, "Wrapup time for %s expired!\n", p->agent);
 									p->lastdisc = ast_tv(0, 0);
 									if (p->ackcall > 1)

Modified: team/russell/chan_console/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_iax2.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/channels/chan_iax2.c (original)
+++ team/russell/chan_console/channels/chan_iax2.c Sun Jul 15 17:02:26 2007
@@ -7246,7 +7246,9 @@
 					check_provisioning(&sin, fd, ies.serviceident, ies.provver);
 				/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
 				if (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
-					fr->callno = make_trunk(fr->callno, 1);
+					int new_callno;
+					if ((new_callno = make_trunk(fr->callno, 1)) != -1)
+						fr->callno = new_callno;
 				}
 				/* For security, always ack immediately */
 				if (delayreject)
@@ -8519,8 +8521,11 @@
 
 	/* If this is a trunk, update it now */
 	ast_copy_flags(iaxs[callno], &cai, IAX_TRUNK | IAX_SENDANI | IAX_NOTRANSFER | IAX_TRANSFERMEDIA | IAX_USEJITTERBUF | IAX_FORCEJITTERBUF);	
-	if (ast_test_flag(&cai, IAX_TRUNK))
-		callno = make_trunk(callno, 1);
+	if (ast_test_flag(&cai, IAX_TRUNK)) {
+		int new_callno;
+		if ((new_callno = make_trunk(callno, 1)) != -1)
+			callno = new_callno;
+	}
 	iaxs[callno]->maxtime = cai.maxtime;
 	if (cai.found)
 		ast_string_field_set(iaxs[callno], host, pds.peer);

Modified: team/russell/chan_console/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_phone.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/channels/chan_phone.c (original)
+++ team/russell/chan_console/channels/chan_phone.c Sun Jul 15 17:02:26 2007
@@ -45,6 +45,9 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <signal.h>
+#ifdef HAVE_LINUX_COMPILER_H
+#include <linux/compiler.h>
+#endif
 #include <linux/telephony.h>
 /* Still use some IXJ specific stuff */
 #include <linux/version.h>
@@ -1068,7 +1071,7 @@
 		ast_mutex_unlock(&iflock);
 
 		/* Wait indefinitely for something to happen */
-		if (dotone && i->mode != MODE_SIGMA) {
+		if (dotone && i && i->mode != MODE_SIGMA) {
 			/* If we're ready to recycle the time, set it to 30 ms */
 			tonepos += 240;
 			if (tonepos >= sizeof(DialTone))

Modified: team/russell/chan_console/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_sip.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/channels/chan_sip.c (original)
+++ team/russell/chan_console/channels/chan_sip.c Sun Jul 15 17:02:26 2007
@@ -13992,7 +13992,8 @@
 	sip_pvt_unlock(p->refer->refer_call);
 
 	/* Make sure that the masq does not free our PVT for the old call */
-	ast_set_flag(&p->refer->refer_call->flags[0], SIP_DEFER_BYE_ON_TRANSFER);	/* Delay hangup */
+	if (! earlyreplace && ! oneleggedreplace )
+		ast_set_flag(&p->refer->refer_call->flags[0], SIP_DEFER_BYE_ON_TRANSFER);	/* Delay hangup */
 		
 	/* Prepare the masquerade - if this does not happen, we will be gone */
 	if(ast_channel_masquerade(replacecall, c))
@@ -14202,7 +14203,7 @@
 			error = 1;
 		}
 
-		if (!error && p->refer->refer_call->owner->_state != AST_STATE_RING && p->refer->refer_call->owner->_state != AST_STATE_UP ) {
+		if (!error && p->refer->refer_call->owner->_state != AST_STATE_RINGING && p->refer->refer_call->owner->_state != AST_STATE_RING && p->refer->refer_call->owner->_state != AST_STATE_UP ) {
 			ast_log(LOG_NOTICE, "Supervised transfer attempted to replace non-ringing or active call id (%s)!\n", replace_id);
 			transmit_response(p, "603 Declined (Replaces)", req);
 			error = 1;

Modified: team/russell/chan_console/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_skinny.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/channels/chan_skinny.c (original)
+++ team/russell/chan_console/channels/chan_skinny.c Sun Jul 15 17:02:26 2007
@@ -821,6 +821,7 @@
 #define SKINNY_DEVICE_7911		307
 #define SKINNY_DEVICE_7961GE		308
 #define SKINNY_DEVICE_7941GE		309
+#define SKINNY_DEVICE_7921		365
 #define SKINNY_DEVICE_7905		20000
 #define SKINNY_DEVICE_7920		30002
 #define SKINNY_DEVICE_7970		30006
@@ -1178,6 +1179,7 @@
 			(btn++)->buttonDefinition = BT_HOLD;
 			break;
 		case SKINNY_DEVICE_7920:
+		case SKINNY_DEVICE_7921:
 			/* XXX I don't know if this is right. */
 			for (i = 0; i < 4; i++)
 				(btn++)->buttonDefinition = BT_CUST_LINESPEEDDIAL;
@@ -2073,6 +2075,8 @@
 		return "7961GE";
 	case SKINNY_DEVICE_7941GE:
 		return "7941GE";
+	case SKINNY_DEVICE_7921:
+		return "7921";
 	case SKINNY_DEVICE_7905:
 		return "7905";
 	case SKINNY_DEVICE_7920:

Modified: team/russell/chan_console/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_zap.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/channels/chan_zap.c (original)
+++ team/russell/chan_console/channels/chan_zap.c Sun Jul 15 17:02:26 2007
@@ -1757,14 +1757,23 @@
 
 static inline int zt_set_hook(int fd, int hs)
 {
-	int x, res;
+	int x, res, count = 0;
+
 	x = hs;
 	res = ioctl(fd, ZT_HOOK, &x);
-	if (res < 0) 
-	{
+
+	while (res < 0 && count < 20) {
+		usleep(100000); /* 1/10 sec. */
+		x = hs;
+		res = ioctl(fd, ZT_HOOK, &x);
+		count++;
+	}
+
+	if (res < 0) {
 		if (errno == EINPROGRESS) return 0;
 		ast_log(LOG_WARNING, "zt hook failed: %s\n", strerror(errno));
 	}
+
 	return res;
 }
 

Modified: team/russell/chan_console/channels/misdn/isdn_lib_intern.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/misdn/isdn_lib_intern.h?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/channels/misdn/isdn_lib_intern.h (original)
+++ team/russell/chan_console/channels/misdn/isdn_lib_intern.h Sun Jul 15 17:02:26 2007
@@ -11,7 +11,9 @@
 
 #include "isdn_lib.h"
 
-#if !defined MISDNUSER_VERSION_CODE || (MISDNUSER_VERSION_CODE < MISDNUSER_VERSION(1, 0, 3))
+#ifndef MISDNUSER_VERSION_CODE
+#error "You need a newer version of mISDNuser ..."
+#elif MISDNUSER_VERSION_CODE < MISDNUSER_VERSION(1, 0, 3)
 #error "You need a newer version of mISDNuser ..."
 #endif
 

Modified: team/russell/chan_console/configure
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/configure?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/configure (original)
+++ team/russell/chan_console/configure Sun Jul 15 17:02:26 2007
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 72769 .
+# From configure.ac Revision: 74213 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -15816,6 +15816,59 @@
 #define HAVE_RES_NINIT 1
 _ACEOF
 
+	{ echo "$as_me:$LINENO: checking for res_ndestroy" >&5
+echo $ECHO_N "checking for res_ndestroy... $ECHO_C" >&6; }
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <resolv.h>
+int
+main ()
+{
+int foo = res_ndestroy(NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_RES_NDESTROY 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -40154,6 +40207,141 @@
 
 
 
+if test "${ac_cv_header_linux_compiler_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for linux/compiler.h" >&5
+echo $ECHO_N "checking for linux/compiler.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_linux_compiler_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_compiler_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_compiler_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking linux/compiler.h usability" >&5
+echo $ECHO_N "checking linux/compiler.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <linux/compiler.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking linux/compiler.h presence" >&5
+echo $ECHO_N "checking linux/compiler.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <linux/compiler.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: linux/compiler.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: linux/compiler.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: linux/compiler.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: linux/compiler.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: linux/compiler.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: linux/compiler.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: linux/compiler.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/compiler.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: linux/compiler.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for linux/compiler.h" >&5
+echo $ECHO_N "checking for linux/compiler.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_linux_compiler_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_linux_compiler_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_compiler_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_compiler_h" >&6; }
+
+fi
+if test $ac_cv_header_linux_compiler_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_COMPILER_H 1
+_ACEOF
+
+fi
+
+
+
 { echo "$as_me:$LINENO: checking for linux/ixjuser.h" >&5
 echo $ECHO_N "checking for linux/ixjuser.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_linux_ixjuser_h+set}" = set; then
@@ -40167,7 +40355,7 @@
 /* end confdefs.h.  */
 
 				   #include <linux/version.h>
-				   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+				   #ifdef HAVE_LINUX_COMPILER_H
 				   #include <linux/compiler.h>
 				   #endif
 

Modified: team/russell/chan_console/configure.ac
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/configure.ac?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/configure.ac (original)
+++ team/russell/chan_console/configure.ac Sun Jul 15 17:02:26 2007
@@ -352,7 +352,15 @@
 	AC_LANG_PROGRAM([#include <resolv.h>],
 			[int foo = res_ninit(NULL);]),
 	AC_MSG_RESULT(yes)
-	AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
+	AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
+	AC_MSG_CHECKING(for res_ndestroy)
+	AC_LINK_IFELSE(
+		AC_LANG_PROGRAM([#include <resolv.h>],
+				[int foo = res_ndestroy(NULL);]),
+		AC_MSG_RESULT(yes)
+		AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
+		AC_MSG_RESULT(no)
+	),
 	AC_MSG_RESULT(no)
 )
 
@@ -1023,9 +1031,12 @@
 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
 AC_SUBST(PBX_H323)
 
+AC_CHECK_HEADER([linux/compiler.h],
+                [AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])])
+
 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
 				   #include <linux/version.h>
-				   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+				   #ifdef HAVE_LINUX_COMPILER_H
 				   #include <linux/compiler.h>
 				   #endif
 				   ])

Modified: team/russell/chan_console/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/include/asterisk/autoconfig.h.in?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/include/asterisk/autoconfig.h.in (original)
+++ team/russell/chan_console/include/asterisk/autoconfig.h.in Sun Jul 15 17:02:26 2007
@@ -244,6 +244,9 @@
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
+/* Define to 1 if your system has linux/compiler.h. */
+#undef HAVE_LINUX_COMPILER_H
+
 /* Define to 1 if you have the <locale.h> header file. */
 #undef HAVE_LOCALE_H
 
@@ -429,6 +432,9 @@
 
 /* Define to 1 if you have the `regcomp' function. */
 #undef HAVE_REGCOMP
+
+/* Define to 1 if your system has the ndestroy resolver function. */
+#undef HAVE_RES_NDESTROY
 
 /* Define to 1 if your system has the re-entrant resolver functions. */
 #undef HAVE_RES_NINIT

Modified: team/russell/chan_console/include/asterisk/monitor.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/include/asterisk/monitor.h?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/include/asterisk/monitor.h (original)
+++ team/russell/chan_console/include/asterisk/monitor.h Sun Jul 15 17:02:26 2007
@@ -29,6 +29,11 @@
 	AST_MONITOR_RUNNING,
 	AST_MONITOR_PAUSED
 };
+
+/* Streams recording control */
+#define X_REC_IN	1
+#define X_REC_OUT	2
+#define X_JOIN		4
 
 /*! Responsible for channel monitoring data */
 struct ast_channel_monitor {

Modified: team/russell/chan_console/include/asterisk/rtp.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/include/asterisk/rtp.h?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/include/asterisk/rtp.h (original)
+++ team/russell/chan_console/include/asterisk/rtp.h Sun Jul 15 17:02:26 2007
@@ -211,7 +211,22 @@
 /*! \brief Enable STUN capability */
 void ast_rtp_setstun(struct ast_rtp *rtp, int stun_enable);
 
-/*! \brief Send STUN request (??) */
+/*! \brief Generic STUN request
+ * send a generic stun request to the server specified.
+ * \param s the socket used to send the request
+ * \param dst the address of the STUN server
+ * \param username if non null, add the username in the request
+ * \param answer if non null, the function waits for a response and
+ *    puts here the externally visible address.
+ * \return 0 on success, other values on error.
+ * The interface it may change in the future.
+ */
+int ast_stun_request(int s, struct sockaddr_in *dst,
+	const char *username, struct sockaddr_in *answer);
+
+/*! \brief Send STUN request for an RTP socket
+ * Deprecated, this is just a wrapper for ast_rtp_stun_request()
+ */
 void ast_rtp_stun_request(struct ast_rtp *rtp, struct sockaddr_in *suggestion, const char *username);
 
 /*! \brief The RTP bridge.

Modified: team/russell/chan_console/include/asterisk/speech.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/include/asterisk/speech.h?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/include/asterisk/speech.h (original)
+++ team/russell/chan_console/include/asterisk/speech.h Sun Jul 15 17:02:26 2007
@@ -73,7 +73,7 @@
 	/*! Name of speech engine */
 	char *name;
 	/*! Set up the speech structure within the engine */
-	int (*create)(struct ast_speech *speech);
+	int (*create)(struct ast_speech *speech, int format);
 	/*! Destroy any data set on the speech structure by the engine */
 	int (*destroy)(struct ast_speech *speech);
 	/*! Load a local grammar on the speech structure */
@@ -110,7 +110,7 @@
 	/*! Matched grammar */
 	char *grammar;
 	/*! List information */
-	struct ast_speech_result *next;
+	AST_LIST_ENTRY(ast_speech_result) list;
 };
 
 /*! \brief Activate a grammar on a speech structure */
@@ -128,7 +128,7 @@
 /*! \brief Indicate to the speech engine that audio is now going to start being written */
 void ast_speech_start(struct ast_speech *speech);
 /*! \brief Create a new speech structure */
-struct ast_speech *ast_speech_new(char *engine_name, int format);
+struct ast_speech *ast_speech_new(char *engine_name, int formats);
 /*! \brief Destroy a speech structure */
 int ast_speech_destroy(struct ast_speech *speech);
 /*! \brief Write audio to the speech engine */

Modified: team/russell/chan_console/include/asterisk/udptl.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/include/asterisk/udptl.h?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/include/asterisk/udptl.h (original)
+++ team/russell/chan_console/include/asterisk/udptl.h Sun Jul 15 17:02:26 2007
@@ -42,7 +42,7 @@
 	/* Set UDPTL peer */
 	int (* const set_udptl_peer)(struct ast_channel *chan, struct ast_udptl *peer);
 	const char * const type;
-	struct ast_udptl_protocol *next;
+	AST_RWLIST_ENTRY(ast_udptl_protocol) list;
 };
 
 struct ast_udptl;

Modified: team/russell/chan_console/main/app.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/app.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/main/app.c (original)
+++ team/russell/chan_console/main/app.c Sun Jul 15 17:02:26 2007
@@ -908,7 +908,7 @@
 	
 	AST_RWLIST_RDLOCK(&groups);
 	AST_RWLIST_TRAVERSE(&groups, gi, list) {
-		if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category)))
+		if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
 			count++;
 	}
 	AST_RWLIST_UNLOCK(&groups);
@@ -931,7 +931,7 @@
 
 	AST_RWLIST_RDLOCK(&groups);
 	AST_RWLIST_TRAVERSE(&groups, gi, list) {
-		if (!regexec(&regexbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category)))
+		if (!regexec(&regexbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
 			count++;
 	}
 	AST_RWLIST_UNLOCK(&groups);

Modified: team/russell/chan_console/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/channel.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/main/channel.c (original)
+++ team/russell/chan_console/main/channel.c Sun Jul 15 17:02:26 2007
@@ -1992,6 +1992,7 @@
 
 int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
 {
+	int begin_digit = 0;
 
 	/* Stop if we're a zombie or need a soft hangup */
 	if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
@@ -2018,7 +2019,12 @@
 				return -1;
 
 			switch (f->frametype) {
-			case AST_FRAME_DTMF:
+			case AST_FRAME_DTMF_BEGIN:
+				begin_digit = f->subclass;
+				break;
+			case AST_FRAME_DTMF_END:
+				if (begin_digit != f->subclass)
+					break;
 				res = f->subclass;
 				ast_frfree(f);
 				return res;

Modified: team/russell/chan_console/main/dns.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/dns.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/main/dns.c (original)
+++ team/russell/chan_console/main/dns.c Sun Jul 15 17:02:26 2007
@@ -229,7 +229,11 @@
 			ret = 1;
 	}
 #ifdef HAVE_RES_NINIT
+#ifdef HAVE_RES_NDESTROY
+	res_ndestroy(&dnsstate);
+#else
 	res_nclose(&dnsstate);
+#endif
 #else
 #ifndef __APPLE__
 	res_close();

Modified: team/russell/chan_console/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/rtp.c?view=diff&rev=75161&r1=75160&r2=75161
==============================================================================
--- team/russell/chan_console/main/rtp.c (original)
+++ team/russell/chan_console/main/rtp.c Sun Jul 15 17:02:26 2007
@@ -237,10 +237,34 @@
 	int sendfur;
 };
 
+/*!
+ * \brief STUN support code
+ *
+ * This code provides some support for doing STUN transactions.
+ * Eventually it should be moved elsewhere as other protocols
+ * than RTP can benefit from it - e.g. SIP.
+ * STUN is described in RFC3489 and it is based on the exchange
+ * of UDP packets between a client and one or more servers to
+ * determine the externally visible address (and port) of the client
+ * once it has gone through the NAT boxes that connect it to the
+ * outside.
+ * The simplest request packet is just the header defined in
+ * struct stun_header, and from the response we may just look at
+ * one attribute, STUN_MAPPED_ADDRESS, that we find in the response.
+ * By doing more transactions with different server addresses we
+ * may determine more about the behaviour of the NAT boxes, of
+ * course - the details are in the RFC.
+ *
+ * All STUN packets start with a simple header made of a type,
+ * length (excluding the header) and a 16-byte random transaction id.
+ * Following the header we may have zero or more attributes, each
+ * structured as a type, length and a value (whose format depends
+ * on the type, but often contains addresses).
+ * Of course all fields are in network format.
+ */
 
 typedef struct { unsigned int id[4]; } __attribute__((packed)) stun_trans_id;
 
-/* XXX Maybe stun belongs in another file if it ever has use outside of RTP */
 struct stun_header {
 	unsigned short msgtype;
 	unsigned short msglen;
@@ -254,6 +278,9 @@
 	unsigned char value[0];
 } __attribute__((packed));
 
+/*
+ * The format normally used for addresses carried by STUN messages.
+ */
 struct stun_addr {
 	unsigned char unused;
 	unsigned char family;
@@ -264,6 +291,13 @@
 #define STUN_IGNORE		(0)
 #define STUN_ACCEPT		(1)
 
+/*! \brief STUN message types
+ * 'BIND' refers to transactions used to determine the externally
+ * visible addresses. 'SEC' refers to transactions used to establish
+ * a session key for subsequent requests.
+ * 'SEC' functionality is not supported here.
+ */
+ 
 #define STUN_BINDREQ	0x0001

[... 1826 lines stripped ...]



More information about the asterisk-commits mailing list