[asterisk-commits] jpeeler: branch jpeeler/chan_dahdi14 r121714 - in /team/jpeeler/chan_dahdi14:...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 10 16:29:02 CDT 2008


Author: jpeeler
Date: Tue Jun 10 16:29:02 2008
New Revision: 121714

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121714
Log:
sync it

Added:
    team/jpeeler/chan_dahdi14/UPGRADE-1.2.txt
      - copied unchanged from r121596, branches/1.4/UPGRADE-1.2.txt
Modified:
    team/jpeeler/chan_dahdi14/   (props changed)
    team/jpeeler/chan_dahdi14/UPGRADE.txt
    team/jpeeler/chan_dahdi14/apps/app_queue.c
    team/jpeeler/chan_dahdi14/channels/chan_agent.c
    team/jpeeler/chan_dahdi14/channels/chan_iax2.c
    team/jpeeler/chan_dahdi14/channels/chan_local.c
    team/jpeeler/chan_dahdi14/channels/chan_sip.c
    team/jpeeler/chan_dahdi14/contrib/scripts/get_ilbc_source.sh
    team/jpeeler/chan_dahdi14/doc/smdi.txt
    team/jpeeler/chan_dahdi14/main/channel.c
    team/jpeeler/chan_dahdi14/main/config.c
    team/jpeeler/chan_dahdi14/main/manager.c
    team/jpeeler/chan_dahdi14/main/pbx.c
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-ntest10
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-test1
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-test15
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-test18
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-test3
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-test5
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-test8
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-vtest13
    team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-vtest17
    team/jpeeler/chan_dahdi14/pbx/pbx_ael.c
    team/jpeeler/chan_dahdi14/pbx/pbx_config.c
    team/jpeeler/chan_dahdi14/pbx/pbx_loopback.c
    team/jpeeler/chan_dahdi14/res/res_jabber.c
    team/jpeeler/chan_dahdi14/res/res_smdi.c

Propchange: team/jpeeler/chan_dahdi14/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun 10 16:29:02 2008
@@ -1,1 +1,1 @@
-/branches/1.4:1-119797
+/branches/1.4:1-121697

Modified: team/jpeeler/chan_dahdi14/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/UPGRADE.txt?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/UPGRADE.txt (original)
+++ team/jpeeler/chan_dahdi14/UPGRADE.txt Tue Jun 10 16:29:02 2008
@@ -1,4 +1,9 @@
-Information for Upgrading From Previous Asterisk Releases
+=========================================================
+=== Information for upgrading from Asterisk 1.2 to 1.4
+===
+===
+=== UPGRADE-1.2.txt -- Upgrade info for 1.0 to 1.2
+=== UPGRADE.txt     -- Upgrade info for 1.2 to 1.4
 =========================================================
 
 Build Process (configure script):

Modified: team/jpeeler/chan_dahdi14/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/apps/app_queue.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/apps/app_queue.c (original)
+++ team/jpeeler/chan_dahdi14/apps/app_queue.c Tue Jun 10 16:29:02 2008
@@ -4815,9 +4815,9 @@
 				if (++which > state) {
 					char *tmp;
 					ast_mutex_unlock(&q->lock);
-					tmp = m->membername;
+					tmp = ast_strdup(m->interface);
 					ao2_ref(m, -1);
-					return ast_strdup(tmp);
+					return tmp;
 				}
 				ao2_ref(m, -1);
 			}

Modified: team/jpeeler/chan_dahdi14/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/channels/chan_agent.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/channels/chan_agent.c (original)
+++ team/jpeeler/chan_dahdi14/channels/chan_agent.c Tue Jun 10 16:29:02 2008
@@ -462,7 +462,17 @@
 			if (!ast_strlen_zero(p->loginchan)) {
 				if (p->chan)
 					ast_log(LOG_DEBUG, "Bridge on '%s' being cleared (2)\n", p->chan->name);
-
+				if (p->owner->_state != AST_STATE_UP) {
+					int howlong = time(NULL) - p->start;
+					if (p->autologoff && howlong > p->autologoff) {
+						long logintime = time(NULL) - p->loginstart;
+						p->loginstart = 0;
+							ast_log(LOG_NOTICE, "Agent '%s' didn't answer/confirm within %d seconds (waited %d)\n", p->name, p->autologoff, howlong);
+						agent_logoff_maintenance(p, p->loginchan, logintime, ast->uniqueid, "Autologoff");
+						if (persistent_agents)
+							dump_agents();
+					}
+				}
 				status = pbx_builtin_getvar_helper(p->chan, "CHANLOCALSTATUS");
 				if (autologoffunavail && status && !strcasecmp(status, "CHANUNAVAIL")) {
 					long logintime = time(NULL) - p->loginstart;
@@ -2759,7 +2769,6 @@
 		free(p);
 	}
 	AST_LIST_UNLOCK(&agents);
-	AST_LIST_HEAD_DESTROY(&agents);
 	return 0;
 }
 

Modified: team/jpeeler/chan_dahdi14/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/channels/chan_iax2.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/channels/chan_iax2.c (original)
+++ team/jpeeler/chan_dahdi14/channels/chan_iax2.c Tue Jun 10 16:29:02 2008
@@ -3235,10 +3235,7 @@
 	}
 
 	if (!pds.exten) {
-		if (!ast_strlen_zero(c->exten))
-			pds.exten = c->exten;
-		else
-			pds.exten = defaultrdest;
+		pds.exten = defaultrdest;
 	}
 
 	if (create_addr(pds.peer, c, &sin, &cai)) {
@@ -8804,15 +8801,17 @@
 static void __iax2_poke_noanswer(const void *data)
 {
 	struct iax2_peer *peer = (struct iax2_peer *)data;
+	int callno;
+
 	if (peer->lastms > -1) {
 		ast_log(LOG_NOTICE, "Peer '%s' is now UNREACHABLE! Time: %d\n", peer->name, peer->lastms);
 		manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Unreachable\r\nTime: %d\r\n", peer->name, peer->lastms);
 		ast_device_state_changed("IAX2/%s", peer->name); /* Activate notification */
 	}
-	if (peer->callno > 0) {
-		ast_mutex_lock(&iaxsl[peer->callno]);
-		iax2_destroy(peer->callno);
-		ast_mutex_unlock(&iaxsl[peer->callno]);
+	if ((callno = peer->callno) > 0) {
+		ast_mutex_lock(&iaxsl[callno]);
+		iax2_destroy(callno);
+		ast_mutex_unlock(&iaxsl[callno]);
 	}
 	peer->callno = 0;
 	peer->lastms = -1;
@@ -8845,6 +8844,7 @@
 
 static int iax2_poke_peer(struct iax2_peer *peer, int heldcall)
 {
+	int callno;
 	if (!peer->maxms || (!peer->addr.sin_addr.s_addr && !peer->dnsmgr)) {
 		/* IF we have no IP without dnsmgr, or this isn't to be monitored, return
 		  immediately after clearing things out */
@@ -8854,15 +8854,17 @@
 		peer->callno = 0;
 		return 0;
 	}
-	if (peer->callno > 0) {
+
+	/* The peer could change the callno inside iax2_destroy, since we do deadlock avoidance */
+	if ((callno = peer->callno) > 0) {
 		ast_log(LOG_NOTICE, "Still have a callno...\n");
-		ast_mutex_lock(&iaxsl[peer->callno]);
-		iax2_destroy(peer->callno);
-		ast_mutex_unlock(&iaxsl[peer->callno]);
+		ast_mutex_lock(&iaxsl[callno]);
+		iax2_destroy(callno);
+		ast_mutex_unlock(&iaxsl[callno]);
 	}
 	if (heldcall)
 		ast_mutex_unlock(&iaxsl[heldcall]);
-	peer->callno = find_callno(0, 0, &peer->addr, NEW_FORCE, peer->sockfd, 0);
+	callno = peer->callno = find_callno(0, 0, &peer->addr, NEW_FORCE, peer->sockfd, 0);
 	if (heldcall)
 		ast_mutex_lock(&iaxsl[heldcall]);
 	if (peer->callno < 1) {
@@ -8893,11 +8895,11 @@
 		peer_unref(peer);
 
 	/* And send the poke */
-	ast_mutex_lock(&iaxsl[peer->callno]);
-	if (iaxs[peer->callno]) {
-		send_command(iaxs[peer->callno], AST_FRAME_IAX, IAX_COMMAND_POKE, 0, NULL, 0, -1);
-	}
-	ast_mutex_unlock(&iaxsl[peer->callno]);
+	ast_mutex_lock(&iaxsl[callno]);
+	if (iaxs[callno]) {
+		send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_POKE, 0, NULL, 0, -1);
+	}
+	ast_mutex_unlock(&iaxsl[callno]);
 
 	return 0;
 }

Modified: team/jpeeler/chan_dahdi14/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/channels/chan_local.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/channels/chan_local.c (original)
+++ team/jpeeler/chan_dahdi14/channels/chan_local.c Tue Jun 10 16:29:02 2008
@@ -756,7 +756,6 @@
 				ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
 		}
 		AST_LIST_UNLOCK(&locals);
-		AST_LIST_HEAD_DESTROY(&locals);
 	} else {
 		ast_log(LOG_WARNING, "Unable to lock the monitor\n");
 		return -1;

Modified: team/jpeeler/chan_dahdi14/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/channels/chan_sip.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/channels/chan_sip.c (original)
+++ team/jpeeler/chan_dahdi14/channels/chan_sip.c Tue Jun 10 16:29:02 2008
@@ -1194,6 +1194,13 @@
 /*! \brief A per-thread temporary pvt structure */
 AST_THREADSTORAGE_CUSTOM(ts_temp_pvt, temp_pvt_init, temp_pvt_cleanup);
 
+#ifdef LOW_MEMORY
+static void ts_ast_rtp_destroy(void *);
+
+AST_THREADSTORAGE_CUSTOM(ts_audio_rtp, ts_audio_rtp_init, ts_ast_rtp_destroy);
+AST_THREADSTORAGE_CUSTOM(ts_video_rtp, ts_video_rtp_init, ts_ast_rtp_destroy);
+#endif
+
 /*! \todo Move the sip_auth list to AST_LIST */
 static struct sip_auth *authl = NULL;		/*!< Authentication list for realm authentication */
 
@@ -1775,11 +1782,12 @@
 
 	if (res == -1) {
 		switch (errno) {
-			case EBADF: 		/* Bad file descriptor - seems like this is generated when the host exist, but doesn't accept the UDP packet */
-			case EHOSTUNREACH: 	/* Host can't be reached */
-			case ENETDOWN: 		/* Inteface down */
-			case ENETUNREACH:	/* Network failure */
-				res = XMIT_ERROR;	/* Don't bother with trying to transmit again */
+		case EBADF: 		/* Bad file descriptor - seems like this is generated when the host exist, but doesn't accept the UDP packet */
+		case EHOSTUNREACH: 	/* Host can't be reached */
+		case ENETDOWN: 		/* Inteface down */
+		case ENETUNREACH:	/* Network failure */
+		case ECONNREFUSED:      /* ICMP port unreachable */ 
+			res = XMIT_ERROR;	/* Don't bother with trying to transmit again */
 		}
 	}
 	if (res != len)
@@ -3107,7 +3115,9 @@
 
 	/* Remove link from peer to subscription of MWI */
 	if (p->relatedpeer) {
-		p->relatedpeer->mwipvt = NULL;
+		if (p->relatedpeer->mwipvt == p) {
+			p->relatedpeer->mwipvt = NULL;
+		}
 		ASTOBJ_UNREF(p->relatedpeer, sip_destroy_peer);
 	}
 
@@ -5059,12 +5069,20 @@
 	}
 
 	/* Initialize the temporary RTP structures we use to evaluate the offer from the peer */
+#ifdef LOW_MEMORY
+	newaudiortp = ast_threadstorage_get(&ts_audio_rtp, ast_rtp_alloc_size());
+#else
 	newaudiortp = alloca(ast_rtp_alloc_size());
+#endif
 	memset(newaudiortp, 0, ast_rtp_alloc_size());
 	ast_rtp_new_init(newaudiortp);
 	ast_rtp_pt_clear(newaudiortp);
 
+#ifdef LOW_MEMORY
+	newvideortp = ast_threadstorage_get(&ts_video_rtp, ast_rtp_alloc_size());
+#else
 	newvideortp = alloca(ast_rtp_alloc_size());
+#endif
 	memset(newvideortp, 0, ast_rtp_alloc_size());
 	ast_rtp_new_init(newvideortp);
 	ast_rtp_pt_clear(newvideortp);
@@ -5596,6 +5614,13 @@
 	return 0;
 }
 
+#ifdef LOW_MEMORY
+static void ts_ast_rtp_destroy(void *data)
+{
+    struct ast_rtp *tmp = data;
+    ast_rtp_destroy(tmp);
+}
+#endif
 
 /*! \brief Add header to SIP message */
 static int add_header(struct sip_request *req, const char *var, const char *value)

Modified: team/jpeeler/chan_dahdi14/contrib/scripts/get_ilbc_source.sh
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/contrib/scripts/get_ilbc_source.sh?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/contrib/scripts/get_ilbc_source.sh (original)
+++ team/jpeeler/chan_dahdi14/contrib/scripts/get_ilbc_source.sh Tue Jun 10 16:29:02 2008
@@ -22,7 +22,7 @@
 
 wget -P codecs/ilbc http://www.ietf.org/rfc/rfc3951.txt
 
-wget -P codecs/ilbc http://www.ilbcfreeware.org/documentation/extract-cfile.awk
+wget -q -O - http://www.ilbcfreeware.org/documentation/extract-cfile.awk | sed -e 's/\r//g' > codecs/ilbc/extract-cfile.awk
 
 (cd codecs/ilbc && awk -f extract-cfile.awk rfc3951.txt)
 

Modified: team/jpeeler/chan_dahdi14/doc/smdi.txt
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/doc/smdi.txt?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/doc/smdi.txt (original)
+++ team/jpeeler/chan_dahdi14/doc/smdi.txt Tue Jun 10 16:29:02 2008
@@ -1,25 +1,137 @@
-Asterisk SMDI (Simple Message Desk Interface) integration
----------------------------------------------------------
+===============================================================================
+===============================================================================
+=== Asterisk SMDI (Simple Message Desk Interface) integration =================
+===============================================================================
+===============================================================================
 
-SMDI integration is configured in smdi.conf, zaptel.conf, and voicemail.conf.
-Various characteristics of the SMDI interfaces to be used (serial ports) are
-defined in smdi.conf.  SMDI integration for callerid and MWI are defined in
-zaptel.conf and voicemail.conf respectively. SMDI only works with Zaptel
-interfaces configured for FXS signalling.
+===============================================================================
+===== 1) Accessing SMDI information in the dialplan. ==========================
+===============================================================================
 
-When SMDI is enabled and a call comes into Asterisk, the forwarding station
-number is used as the destination for the call and any callerid information
-present is used.  This way you can configure your extensions.conf as follows to
-behave as a message desk.
+There are two dialplan functions that can be used to access the details of
+incoming SMDI messages.
 
-[default]
+*CLI> core show function SMDI_MSG_RETRIEVE
 
-exten => _XXXXXXX,1,VoiceMail(${EXTEN}|${SMDI_VM_TYPE})
-exten => _XXXXXXX,n,Hangup
+  -= Info about function 'SMDI_MSG_RETRIEVE' =- 
 
-exten => s,1,VoiceMailMain(${CALLERID(num)})
-exten => s,n,Hangup
+[Syntax]
+SMDI_MSG_RETRIEVE(<smdi port>,<search key>[,timeout[,options]])
 
-The ${SMDI_VM_TYPE} variable will be set to u, b, or nothing depending on the
-contents of the type of SMDI message received.
+[Synopsis]
+Retrieve an SMDI message.
 
+[Description]
+   This function is used to retrieve an incoming SMDI message.  It returns
+an ID which can be used with the SMDI_MSG() function to access details of
+the message.  Note that this is a destructive function in the sense that
+once an SMDI message is retrieved using this function, it is no longer in
+the global SMDI message queue, and can not be accessed by any other Asterisk
+channels.  The timeout for this function is optional, and the default is
+3 seconds.  When providing a timeout, it should be in milliseconds.
+   The default search is done on the forwarding station ID.  However, if
+you set one of the search key options in the options field, you can change
+this behavior.
+   Options:
+     t - Instead of searching on the forwarding station, search on the message
+         desk terminal.
+     n - Instead of searching on the forwarding station, search on the message
+         desk number.
+
+
+*CLI> core show function SMDI_MSG
+
+  -= Info about function 'SMDI_MSG' =-
+
+[Syntax]
+SMDI_MSG(<message_id>,<component>)
+
+[Synopsis]
+Retrieve details about an SMDI message.
+
+[Description]
+   This function is used to access details of an SMDI message that was
+pulled from the incoming SMDI message queue using the SMDI_MSG_RETRIEVE()
+function.
+   Valid message components are:
+      station  - The forwarding station
+      callerid - The callerID of the calling party that was forwarded
+      type     - The call type.  The value here is the exact character
+                 that came in on the SMDI link.  Typically, example values
+                 are: D - Direct Calls, A - Forward All Calls,
+                      B - Forward Busy Calls, N - Forward No Answer Calls
+
+
+Here is an example of how to use these functions:
+
+; Retrieve the SMDI message that is associated with the number that
+; was called in Asterisk.
+exten => _0XXX,1,Set(SMDI_MSG_ID=${SMDI_MSG_RETRIEVE(/dev/tty0,${EXTEN})})
+
+; Ensure that the message was retrieved.
+exten => _0XXX,n,GotoIf($["x${SMDI_MSG_ID}" != "x"]?processcall:hangup)
+exten => _0XXX,n(hangup),NoOp(No SMDI message retrieved for ${EXTEN})
+
+; Grab the details out of the SMDI message.
+exten => _0XXX,n(processcall),NoOp(Message found for ${EXTEN})
+exten => _0XXX,n,Set(SMDI_EXTEN=${SMDI_MSG(${SMDI_MSG_ID},station)})
+exten => _0XXX,n,Set(SMDI_CID=${SMDI_MSG(${SMDI_MSG_ID},callerid)})
+
+; Map SMDI message types to the right voicemail option.  If it is "B", use the
+; busy option.  Otherwise, use the unavailable option.
+exten => _0XXX,n,GotoIf($["${SMDI_MSG(${SMDI_MSG_ID},type)}" == "B"]?usebusy:useunavail)
+
+exten => _0XXX,n(usebusy),Set(SMDI_VM_TYPE=b)
+exten => _0XXX,n,Goto(continue)
+
+exten => _0XXX,n,(useunavil),Set(SMDI_VM_TYPE=u)
+
+exten => _0XXX,n(continue),NoOp( Process the rest of the call ... )
+
+
+===============================================================================
+===== 2) Ensuring complete MWI information over SMDI ==========================
+===============================================================================
+
+Another change has been made to ensure that MWI state is properly propagated
+over the SMDI link.  This replaces the use of externnotify=smdi for
+voicemail.conf.  The issue is that we have to poll mailboxes occasionally for
+changes that were made using an IMAP client.  So, this ability was added to
+res_smdi.  To configure this, there is a new section in smdi.conf.  It looks
+like this:
+
+[mailboxes]
+; This section configures parameters related to MWI handling for the SMDI link.
+ ;
+; This option configures the polling interval used to check to see if the
+; mailboxes have any new messages.  This option is specified in seconds.
+; The default value is 10 seconds.
+;
+;pollinginterval=10
+;
+; Before specifying mailboxes, you must specify an SMDI interface.  All mailbox
+; definitions that follow will correspond to that SMDI interface.  If you
+; specify another interface, then all definitions following that will correspond
+; to the new interface.
+;
+; Every other entry in this section of the configuration file is interpreted as
+; a mapping between the mailbox ID on the SMDI link, and the local Asterisk
+; mailbox name.  In many cases, they are the same thing, but they still must be
+; listed here so that this module knows which mailboxes it needs to pay
+; attention to.
+;
+; Syntax:
+;   <SMDI mailbox ID>=<Asterisk Mailbox Name>[@Asterisk Voicemail Context]
+;
+; If no Asterisk voicemail context is specified, "default" will be assumed.
+;
+;
+;smdiport=/dev/ttyS0
+;2565551234=1234 at vmcontext1
+;2565555678=5678 at vmcontext2
+;smdiport=/dev/ttyS1
+;2565559999=9999
+
+===============================================================================
+===============================================================================
+===============================================================================

Modified: team/jpeeler/chan_dahdi14/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/main/channel.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/main/channel.c (original)
+++ team/jpeeler/chan_dahdi14/main/channel.c Tue Jun 10 16:29:02 2008
@@ -2174,7 +2174,7 @@
 					ast_log(LOG_DTMF, "DTMF end accepted without begin '%c' on %s\n", f->subclass, chan->name);
 					f->len = AST_MIN_DTMF_DURATION;
 				}
-				if (f->len < AST_MIN_DTMF_DURATION) {
+				if (f->len < AST_MIN_DTMF_DURATION && !ast_test_flag(chan, AST_FLAG_END_DTMF_ONLY)) {
 					ast_log(LOG_DTMF, "DTMF end '%c' has duration %ld but want minimum %d, emulating on %s\n", f->subclass, f->len, AST_MIN_DTMF_DURATION, chan->name);
 					ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
 					chan->emulate_dtmf_digit = f->subclass;
@@ -2183,6 +2183,9 @@
 					f = &ast_null_frame;
 				} else {
 					ast_log(LOG_DTMF, "DTMF end passthrough '%c' on %s\n", f->subclass, chan->name);
+					if (f->len < AST_MIN_DTMF_DURATION) {
+						f->len = AST_MIN_DTMF_DURATION;
+					}
 					chan->dtmf_tv = now;
 				}
 				if (chan->audiohooks) {
@@ -4122,6 +4125,12 @@
 			o0nativeformats = c0->nativeformats;
 			o1nativeformats = c1->nativeformats;
 		}
+
+		if (!ast_strlen_zero(pbx_builtin_getvar_helper(c0, "BRIDGEPEER")))
+			pbx_builtin_setvar_helper(c0, "BRIDGEPEER", c1->name);
+		if (!ast_strlen_zero(pbx_builtin_getvar_helper(c1, "BRIDGEPEER")))
+			pbx_builtin_setvar_helper(c1, "BRIDGEPEER", c0->name);
+
 		res = ast_generic_bridge(c0, c1, config, fo, rc, nexteventts);
 		if (res != AST_BRIDGE_RETRY)
 			break;

Modified: team/jpeeler/chan_dahdi14/main/config.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/main/config.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/main/config.c (original)
+++ team/jpeeler/chan_dahdi14/main/config.c Tue Jun 10 16:29:02 2008
@@ -812,7 +812,11 @@
 static struct ast_config *config_text_file_load(const char *database, const char *table, const char *filename, struct ast_config *cfg, int withcomments)
 {
 	char fn[256];
+#if defined(LOW_MEMORY)
+	char buf[512];
+#else
 	char buf[8192];
+#endif
 	char *new_buf, *comment_p, *process_buf;
 	FILE *f;
 	int lineno=0;

Modified: team/jpeeler/chan_dahdi14/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/main/manager.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/main/manager.c (original)
+++ team/jpeeler/chan_dahdi14/main/manager.c Tue Jun 10 16:29:02 2008
@@ -2877,7 +2877,7 @@
 
 int init_manager(void)
 {
-	struct ast_config *cfg = NULL;
+	struct ast_config *cfg = NULL, *ucfg = NULL;
 	const char *val;
 	char *cat = NULL;
 	int oldportno = portno;
@@ -2974,6 +2974,71 @@
 	}
 
 	AST_LIST_LOCK(&users);
+
+	if ((ucfg = ast_config_load("users.conf"))) {
+		while ((cat = ast_category_browse(ucfg, cat))) {
+			int hasmanager = 0;
+			struct ast_variable *var = NULL;
+
+			if (!strcasecmp(cat, "general")) {
+				continue;
+			}
+
+			if (!(hasmanager = ast_true(ast_variable_retrieve(ucfg, cat, "hasmanager")))) {
+				continue;
+			}
+
+			/* Look for an existing entry, if none found - create one and add it to the list */
+			if (!(user = ast_get_manager_by_name_locked(cat))) {
+				if (!(user = ast_calloc(1, sizeof(*user)))) {
+					break;
+				}
+				/* Copy name over */
+				ast_copy_string(user->username, cat, sizeof(user->username));
+				/* Insert into list */
+				AST_LIST_INSERT_TAIL(&users, user, list);
+			}
+
+			/* Make sure we keep this user and don't destroy it during cleanup */
+			user->keep = 1;
+
+			for (var = ast_variable_browse(ucfg, cat); var; var = var->next) {
+				if (!strcasecmp(var->name, "secret")) {
+					if (user->secret) {
+						free(user->secret);
+					}
+					user->secret = ast_strdup(var->value);
+				} else if (!strcasecmp(var->name, "deny") ) {
+					if (user->deny) {
+						free(user->deny);
+					}
+					user->deny = ast_strdup(var->value);
+				} else if (!strcasecmp(var->name, "permit") ) {
+					if (user->permit) {
+						free(user->permit);
+					}
+					user->permit = ast_strdup(var->value);
+				} else if (!strcasecmp(var->name, "read") ) {
+					if (user->read) {
+						free(user->read);
+					}
+					user->read = ast_strdup(var->value);
+				} else if (!strcasecmp(var->name, "write") ) {
+					if (user->write) {
+						free(user->write);
+					}
+					user->write = ast_strdup(var->value);
+				} else if (!strcasecmp(var->name, "displayconnects") ) {
+					user->displayconnects = ast_true(var->value);
+				} else if (!strcasecmp(var->name, "hasmanager")) {
+					/* already handled */
+				} else {
+					ast_log(LOG_DEBUG, "%s is an unknown option (to the manager module).\n", var->name);
+				}
+			}
+		}
+		ast_config_destroy(ucfg);
+	}
 
 	while ((cat = ast_category_browse(cfg, cat))) {
 		struct ast_variable *var = NULL;

Modified: team/jpeeler/chan_dahdi14/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/main/pbx.c?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/main/pbx.c (original)
+++ team/jpeeler/chan_dahdi14/main/pbx.c Tue Jun 10 16:29:02 2008
@@ -6326,7 +6326,7 @@
 			continue;
 
 		res = -1;
-		ast_log(LOG_WARNING, "Context '%s' tries includes nonexistent context '%s'\n",
+		ast_log(LOG_WARNING, "Context '%s' tries to include nonexistent context '%s'\n",
 			ast_get_context_name(con), inc->rname);
 		break;
 	}

Modified: team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-ntest10
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-ntest10?view=diff&rev=121714&r1=121713&r2=121714
==============================================================================
--- team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-ntest10 (original)
+++ team/jpeeler/chan_dahdi14/pbx/ael/ael-test/ref.ael-ntest10 Tue Jun 10 16:29:02 2008
@@ -5,20 +5,20 @@
 
 
 (You can use the -w option to dump extensions.conf format to extensions.conf.aeldump)
-LOG: lev:2 file:pbx_ael.c  line:4069 func: pbx_load_module  Starting AEL load process.
-LOG: lev:2 file:pbx_ael.c  line:4076 func: pbx_load_module  AEL load process: calculated config file name './extensions.ael'.
-LOG: lev:2 file:pbx_ael.c  line:4084 func: pbx_load_module  AEL load process: parsed config file name './extensions.ael'.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 13-13: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 36-36: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 48-48: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 60-60: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 72-72: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 84-84: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 87-87: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 106-106: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 119-119: A default case was automatically added to the switch.
-LOG: lev:3 file:pbx_ael.c  line:2234 func: check_switch_expr  Warning: file ./extensions.ael, line 122-122: A default case was automatically added to the switch.
-LOG: lev:2 file:pbx_ael.c  line:4087 func: pbx_load_module  AEL load process: checked config file name './extensions.ael'.
+LOG: lev:2 file:pbx_ael.c  line:4131 func: pbx_load_module  Starting AEL load process.
+LOG: lev:2 file:pbx_ael.c  line:4138 func: pbx_load_module  AEL load process: calculated config file name './extensions.ael'.
+LOG: lev:2 file:pbx_ael.c  line:4146 func: pbx_load_module  AEL load process: parsed config file name './extensions.ael'.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 13-13: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 36-36: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 48-48: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 60-60: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 72-72: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 84-84: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 87-87: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 106-106: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 119-119: A default case was automatically added to the switch.
+LOG: lev:3 file:pbx_ael.c  line:2235 func: check_switch_expr  Warning: file ./extensions.ael, line 122-122: A default case was automatically added to the switch.
+LOG: lev:2 file:pbx_ael.c  line:4149 func: pbx_load_module  AEL load process: checked config file name './extensions.ael'.
 Executed ast_context_create(conts, name=macro-endsess, registrar=pbx_ael);
 Executed ast_context_create(conts, name=macro-nullchk, registrar=pbx_ael);
 Executed ast_context_create(conts, name=macro-endcall, registrar=pbx_ael);
@@ -30,9 +30,10 @@
 Executed ast_add_extension2(context=macro-nullchk, rep=0, exten=s, priority=1, label=(null), callerid=(null), appl=Set, data=type=${ARG1}, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-nullchk, rep=0, exten=s, priority=2, label=(null), callerid=(null), appl=NoOp, data=${type} is this, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=s, priority=1, label=(null), callerid=(null), appl=Set, data=type=${ARG1}, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall, rep=0, exten=s, priority=2, label=(null), callerid=(null), appl=Goto, data=sw-1-${type}|10, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall, rep=0, exten=s, priority=3, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall-1, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall, rep=0, exten=_sw-1-., priority=10, label=(null), callerid=(null), appl=Goto, data=s|3, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall, rep=0, exten=s, priority=2, label=(null), callerid=(null), appl=Set, data=~~EXTEN~~=${EXTEN}, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall, rep=0, exten=s, priority=3, label=(null), callerid=(null), appl=Goto, data=sw-1-${type}|10, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall, rep=0, exten=s, priority=4, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall-1, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall, rep=0, exten=_sw-1-., priority=10, label=(null), callerid=(null), appl=Goto, data=s|4, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-, priority=10, label=(null), callerid=(null), appl=Goto, data=sw-1-.|10, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=10, label=(null), callerid=(null), appl=Macro, data=nullchk|callid, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=11, label=(null), callerid=(null), appl=GotoIf, data=$[${testnotnull}]?12:15, FREE, registrar=pbx_ael);
@@ -40,17 +41,18 @@
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=13, label=(null), callerid=(null), appl=Goto, data=sw-1-out|ptr1, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=14, label=(null), callerid=(null), appl=Goto, data=17, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=15, label=ptr1, callerid=(null), appl=Softhangup, data=${CHANNEL}, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=16, label=(null), callerid=(null), appl=Goto, data=s|3, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=16, label=(null), callerid=(null), appl=Goto, data=s|4, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=17, label=(null), callerid=(null), appl=NoOp, data=Finish if-sw-endcall-out-1-2, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=18, label=(null), callerid=(null), appl=Noop, data=esac, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall, rep=0, exten=sw-1-out, priority=19, label=(null), callerid=(null), appl=Goto, data=sw-1-.|10, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=s, priority=1, label=(null), callerid=(null), appl=Set, data=type=${ARG1}, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=s, priority=2, label=(null), callerid=(null), appl=Goto, data=sw-3-${type}|10, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=s, priority=3, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall2-3, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=_sw-3-., priority=10, label=(null), callerid=(null), appl=Goto, data=s|3, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=s, priority=2, label=(null), callerid=(null), appl=Set, data=~~EXTEN~~=${EXTEN}, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=s, priority=3, label=(null), callerid=(null), appl=Goto, data=sw-3-${type}|10, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=s, priority=4, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall2-3, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=_sw-3-., priority=10, label=(null), callerid=(null), appl=Goto, data=s|4, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-, priority=10, label=(null), callerid=(null), appl=Goto, data=sw-3-.|10, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out2, priority=10, label=ptr1, callerid=(null), appl=Softhangup, data=${CHANNEL}, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out2, priority=11, label=(null), callerid=(null), appl=Goto, data=s|3, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out2, priority=11, label=(null), callerid=(null), appl=Goto, data=s|4, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out2, priority=12, label=(null), callerid=(null), appl=Noop, data=esac, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out2, priority=13, label=(null), callerid=(null), appl=Goto, data=sw-3-.|10, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out, priority=10, label=(null), callerid=(null), appl=Macro, data=nullchk|callid, FREE, registrar=pbx_ael);
@@ -60,22 +62,23 @@
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out, priority=14, label=(null), callerid=(null), appl=NoOp, data=Finish if-sw-endcall2-out-3-4, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall2, rep=0, exten=sw-3-out, priority=15, label=(null), callerid=(null), appl=Goto, data=sw-3-out2|10, FREE, registrar=pbx_ael);
 Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=1, label=(null), callerid=(null), appl=Set, data=type=${ARG1}, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=2, label=(null), callerid=(null), appl=Goto, data=sw-5-${type}|10, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=3, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall3-5, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=4, label=(null), callerid=(null), appl=GotoIf, data=$[${testnotnull}]?5:6, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=5, label=(null), callerid=(null), appl=Goto, data=sw-8-out|ptr1, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=6, label=(null), callerid=(null), appl=NoOp, data=Finish if-endcall3-7, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=7, label=(null), callerid=(null), appl=Goto, data=sw-8-${type}|10, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=8, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall3-8, FREE, registrar=pbx_ael);
-Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=_sw-8-., priority=10, label=(null), callerid=(null), appl=Goto, data=s|8, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=2, label=(null), callerid=(null), appl=Set, data=~~EXTEN~~=${EXTEN}, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=3, label=(null), callerid=(null), appl=Goto, data=sw-5-${type}|10, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=4, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall3-5, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=5, label=(null), callerid=(null), appl=GotoIf, data=$[${testnotnull}]?6:7, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=6, label=(null), callerid=(null), appl=Goto, data=sw-8-out|ptr1, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=7, label=(null), callerid=(null), appl=NoOp, data=Finish if-endcall3-7, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=8, label=(null), callerid=(null), appl=Goto, data=sw-8-${type}|10, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=s, priority=9, label=(null), callerid=(null), appl=NoOp, data=Finish switch-endcall3-8, FREE, registrar=pbx_ael);
+Executed ast_add_extension2(context=macro-endcall3, rep=0, exten=_sw-8-., priority=10, label=(null), callerid=(null), appl=Goto, data=s|9, FREE, registrar=pbx_ael);

[... 3112 lines stripped ...]



More information about the asterisk-commits mailing list