[asterisk-commits] murf: branch group/CDRfix5 r81970 - in /team/group/CDRfix5: ./ apps/ channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 8 09:32:49 CDT 2007


Author: murf
Date: Sat Sep  8 09:32:48 2007
New Revision: 81970

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81970
Log:
Merged revisions 81683,81712,81730,81742,81744-81745,81777,81779,81781-81785,81813-81814,81827,81839,81849,81858,81873,81891,81910,81924,81953 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r81683 | mmichelson | 2007-09-06 09:21:45 -0600 (Thu, 06 Sep 2007) | 13 lines

Merged revisions 81682 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81682 | mmichelson | 2007-09-06 10:20:36 -0500 (Thu, 06 Sep 2007) | 5 lines

Fixes a memory leak

(closes issue #10658, reported and patched by Ivan)


........

................
r81712 | rizzo | 2007-09-06 09:43:49 -0600 (Thu, 06 Sep 2007) | 8 lines

various changes to the documentation, and redefinition of
ao2_hash_fn and ao2_callback_fn typedefs, in preparation
to more cleanup of the _search_flags

Please do not merge this change to 1.4 yet - there are no
functional changes anyways.


................
r81730 | mmichelson | 2007-09-06 10:31:30 -0600 (Thu, 06 Sep 2007) | 14 lines

Merged revisions 81713 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81713 | mmichelson | 2007-09-06 11:25:40 -0500 (Thu, 06 Sep 2007) | 6 lines

Fixes an issue where valid DTMF had to be pressed twice to exit a queue if a member's phone
was ringing.

(closes issue #10655, reported by strider2k, patched by me)


........

................
r81742 | mattf | 2007-09-06 10:38:54 -0600 (Thu, 06 Sep 2007) | 1 line

Patch on 10575.  Add support for unequipped CIC (UCIC) message as well as improve some of our CIC flags in chan_zap
................
r81744 | tilghman | 2007-09-06 10:57:20 -0600 (Thu, 06 Sep 2007) | 2 lines

Incorporate the ability to log output of safe_asterisk to syslog (closes issue #9882)

................
r81745 | phsultan | 2007-09-06 11:00:58 -0600 (Thu, 06 Sep 2007) | 9 lines

Merged revisions 81743 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81743 | phsultan | 2007-09-06 18:56:29 +0200 (Thu, 06 Sep 2007) | 1 line

Various string length fixes. Removed an unused variable in aji_client structure (context)
........

................
r81777 | file | 2007-09-06 13:43:20 -0600 (Thu, 06 Sep 2007) | 15 lines

Merged revisions 81776 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81776 | file | 2007-09-06 16:40:37 -0300 (Thu, 06 Sep 2007) | 7 lines

(closes issue #10122)
Reported by: stevefeinstein
Patches:
      meetme-unmute-manager.diff uploaded by qwell (license 4)
Tested by: stevefeinstein
After looking over the code I agree with Qwell. Setting the file descriptor to conference each time just causes a fight back and forth.

........

................
r81779 | qwell | 2007-09-06 14:00:08 -0600 (Thu, 06 Sep 2007) | 10 lines

Merged revisions 81778 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81778 | qwell | 2007-09-06 14:59:07 -0500 (Thu, 06 Sep 2007) | 2 lines

This should fix a build issue that people building against uClibc were seeing with the addition of astobj2

........

................
r81781 | russell | 2007-09-06 14:05:50 -0600 (Thu, 06 Sep 2007) | 2 lines

Fix the syntax of declaring a hint with a name to be compatible with trunk

................
r81782 | file | 2007-09-06 14:16:02 -0600 (Thu, 06 Sep 2007) | 6 lines

(closes issue #10377)
Reported by: mvanbaak
Patches:
      chan_skinny_info.diff uploaded by mvanbaak (license 7)
Add skinny show device, skinny show line, and skinny show settings CLI commands.

................
r81783 | russell | 2007-09-06 14:24:18 -0600 (Thu, 06 Sep 2007) | 4 lines

Merge HINT() dialplan function from my sandbox branch into trunk.  This function
will let you retrieve the list of devices or name associated with a hint.
(inspired by issue #10635)

................
r81784 | russell | 2007-09-06 14:27:26 -0600 (Thu, 06 Sep 2007) | 4 lines

Rename the DEVSTATE() function to DEVICE_STATE() to better conform to how other
functions are named.
(inspired by issue #10635)

................
r81785 | russell | 2007-09-06 14:27:53 -0600 (Thu, 06 Sep 2007) | 2 lines

s/DEVSTATE/DEVICE_STATE/

................
r81813 | russell | 2007-09-06 14:54:07 -0600 (Thu, 06 Sep 2007) | 5 lines

Add EXTENSION_STATE() function that can retrieve the state of an extension that
has a hint.

(closes issue #10635, adamgundy)

................
r81814 | file | 2007-09-06 15:01:10 -0600 (Thu, 06 Sep 2007) | 2 lines

Initialize iax_frames variable to NULL, keeps valgrind happy.

................
r81827 | qwell | 2007-09-06 16:06:17 -0600 (Thu, 06 Sep 2007) | 9 lines

Merged revisions 81826 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81826 | qwell | 2007-09-06 17:05:02 -0500 (Thu, 06 Sep 2007) | 1 line

We added COPTS for ASTCFLAGS additions, but not LDOPTS for ASTLDFLAGS.  This adds LDOPTS
........

................
r81839 | russell | 2007-09-06 16:30:15 -0600 (Thu, 06 Sep 2007) | 24 lines

Merged revisions 81832 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81832 | russell | 2007-09-06 17:28:57 -0500 (Thu, 06 Sep 2007) | 16 lines

(closes issue #9724, closes issue #10374)
Reported by: kenw
Patches:
      9724.txt uploaded by russell (license 2)
Tested by: kenw, russell

Resolve a deadlock that occurs when doing a SIP transfer to parking.  

I come across this type of deadlock fairly often it seems.  It is very important
to mind the boundary between the channel driver and the core in respect to the
channel lock and the channel-pvt lock.  Channel drivers lock to lock the
pvt and then the channel once it calls into the core, while the core will do
it in the opposite order.  The way this is avoided is by having channel drivers
either release their pvt lock while calling into the core, or such as in this
case, unlocking the pvt just long enough to acquire the channel lock.

........

................
r81849 | russell | 2007-09-06 16:32:03 -0600 (Thu, 06 Sep 2007) | 1 line

fix the build ... oops
................
r81858 | file | 2007-09-06 16:34:44 -0600 (Thu, 06 Sep 2007) | 2 lines

Fix memory issue that crept up with Russell's testing. It is *not* proper to free the frame we get in ast_write.

................
r81873 | file | 2007-09-07 06:32:04 -0600 (Fri, 07 Sep 2007) | 2 lines

Don't check for epoll support when cross compiling.

................
r81891 | mmichelson | 2007-09-07 09:29:23 -0600 (Fri, 07 Sep 2007) | 11 lines

Merged revisions 81886 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81886 | mmichelson | 2007-09-07 10:25:19 -0500 (Fri, 07 Sep 2007) | 3 lines

Moving the explanation for joinempty to a more appropriate place


........

................
r81910 | qwell | 2007-09-07 10:13:57 -0600 (Fri, 07 Sep 2007) | 4 lines

Add an optional reason parameter to PauseQueueMember/UnpauseQueueMember applications and manager events.

Issue 8738, patch by rgollent

................
r81924 | qwell | 2007-09-07 13:53:30 -0600 (Fri, 07 Sep 2007) | 14 lines

Merged revisions 81923 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue #10671)
........
r81923 | qwell | 2007-09-07 14:48:00 -0500 (Fri, 07 Sep 2007) | 5 lines

Allow the MEMBERINTERFACE variable to be used as the mixmonitor filename.
This moves the setting of the MEMBERINTERFACE variable to before mixmonitor.

Issue 10671, patch by sim.

........

................
r81953 | russell | 2007-09-08 07:45:40 -0600 (Sat, 08 Sep 2007) | 19 lines

Merged revisions 81952 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81952 | russell | 2007-09-08 08:42:26 -0500 (Sat, 08 Sep 2007) | 11 lines

(closes issue #10672)
Bump the cleancount so that a "make clean" will be forced.  This is needed
because my fix in revision 81599 made a change to a data structure in file.h,
and since file dependency tracking is only on with dev-mode enabled, file
format modules that don't get rebuilt may crash, as is the case with this issue.

This makes me wonder - how much faster does the code build without the file
dependency tracking enabled?  If it doesn't make much of a difference, then it
may be worth just keeping it on all of the time, or perhaps just not in release
tarballs, so that this type of issue is avoided.

........

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

Added:
    team/group/CDRfix5/funcs/func_extstate.c
      - copied unchanged from r81953, trunk/funcs/func_extstate.c
Modified:
    team/group/CDRfix5/   (props changed)
    team/group/CDRfix5/.cleancount
    team/group/CDRfix5/CHANGES
    team/group/CDRfix5/Makefile
    team/group/CDRfix5/apps/app_meetme.c
    team/group/CDRfix5/apps/app_queue.c
    team/group/CDRfix5/channels/chan_gtalk.c
    team/group/CDRfix5/channels/chan_sip.c
    team/group/CDRfix5/channels/chan_skinny.c
    team/group/CDRfix5/channels/chan_zap.c
    team/group/CDRfix5/channels/iax2-parser.c
    team/group/CDRfix5/configs/extensions.conf.sample
    team/group/CDRfix5/configs/queues.conf.sample
    team/group/CDRfix5/configure
    team/group/CDRfix5/configure.ac
    team/group/CDRfix5/contrib/scripts/safe_asterisk
    team/group/CDRfix5/funcs/func_devstate.c
    team/group/CDRfix5/include/asterisk/astobj2.h
    team/group/CDRfix5/include/asterisk/jabber.h
    team/group/CDRfix5/main/astobj2.c
    team/group/CDRfix5/main/audiohook.c
    team/group/CDRfix5/main/channel.c

Propchange: team/group/CDRfix5/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/group/CDRfix5/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Sep  8 09:32:48 2007
@@ -1,1 +1,1 @@
-/trunk:1-81660
+/trunk:1-81953

Modified: team/group/CDRfix5/.cleancount
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/.cleancount?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/.cleancount (original)
+++ team/group/CDRfix5/.cleancount Sat Sep  8 09:32:48 2007
@@ -1,1 +1,1 @@
-31
+32

Modified: team/group/CDRfix5/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/CHANGES?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/CHANGES (original)
+++ team/group/CDRfix5/CHANGES Sat Sep  8 09:32:48 2007
@@ -25,7 +25,7 @@
 
 Dialplan functions
 ------------------
-  * Added the DEVSTATE() dialplan function which allows retrieving any device
+  * Added the DEVICE_STATE() dialplan function which allows retrieving any device
     state in the dialplan, as well as creating custom device states that are
     controllable from the dialplan.
   * Extend CALLERID() function with "pres" and "ton" parameters to
@@ -38,6 +38,12 @@
     mutex.  No deadlocks are possible, as LOCK() only allows a single lock to be
     held for any given channel.  Also, locks are automatically freed when a
     channel is hung up.
+  * Added HINT() dialplan function that allows retrieving hint information.
+    Hints are mappings between extensions and devices for the sake of 
+    determining the state of an extension.  This function can retrieve the list
+    of devices or the name associated with a hint.
+  * Added EXTENSION_STATE() dialplan function which allows retrieving the state
+    of any extension.
 
 CLI Changes
 -----------
@@ -83,6 +89,10 @@
   * Added the srvlookup option to iax.conf
   * Added support for OSP.  The token is set and retrieved through the CHANNEL()
      dialplan function.
+
+Skinny changes
+-------------
+  * Added skinny show device, skinny show line, and skinny show settings CLI commands.
 
 DUNDi changes
 -------------

Modified: team/group/CDRfix5/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/Makefile?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/Makefile (original)
+++ team/group/CDRfix5/Makefile Sat Sep  8 09:32:48 2007
@@ -77,8 +77,9 @@
 endif
 
 # Some build systems, such as the one in openwrt, like to pass custom target
-# CFLAGS in the COPTS variable.
+# CFLAGS and LDFLAGS in the COPTS and LDOPTS variables.
 ASTCFLAGS+=$(COPTS)
+ASTLDFLAGS+=$(LDOPTS)
 
 #Uncomment this to see all build commands instead of 'quiet' output
 #NOISY_BUILD=yes

Modified: team/group/CDRfix5/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/apps/app_meetme.c?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/apps/app_meetme.c (original)
+++ team/group/CDRfix5/apps/app_meetme.c Sat Sep  8 09:32:48 2007
@@ -1848,13 +1848,6 @@
 					if (musiconhold == 0 && (confflags & CONFFLAG_MOH)) {
 						ast_moh_start(chan, NULL, NULL);
 						musiconhold = 1;
-					} else {
-						ztc.confmode = ZT_CONF_CONF;
-						if (ioctl(fd, ZT_SETCONF, &ztc)) {
-							ast_log(LOG_WARNING, "Error setting conference\n");
-							close(fd);
-							goto outrun;
-						}
 					}
 				} else if(currentmarked >= 1 && lastmarked == 0) {
 					/* Marked user entered, so cancel timeout */

Modified: team/group/CDRfix5/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/apps/app_queue.c?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/apps/app_queue.c (original)
+++ team/group/CDRfix5/apps/app_queue.c Sat Sep  8 09:32:48 2007
@@ -193,13 +193,15 @@
 static char *app_pqm = "PauseQueueMember" ;
 static char *app_pqm_synopsis = "Pauses a queue member" ;
 static char *app_pqm_descrip =
-"   PauseQueueMember([queuename],interface[,options]):\n"
+"   PauseQueueMember([queuename],interface[,options[,reason]]):\n"
 "Pauses (blocks calls for) a queue member.\n"
 "The given interface will be paused in the given queue.  This prevents\n"
 "any calls from being sent from the queue to the interface until it is\n"
 "unpaused with UnpauseQueueMember or the manager interface.  If no\n"
 "queuename is given, the interface is paused in every queue it is a\n"
 "member of. The application will fail if the interface is not found.\n"
+"The reason string is entirely optional and is used to add extra information\n"
+"to the appropriate queue_log entries and manager events.\n"
 "  This application sets the following channel variable upon completion:\n"
 "     PQMSTATUS      The status of the attempt to pause a queue member as a\n"
 "                     text string, one of\n"
@@ -209,10 +211,12 @@
 static char *app_upqm = "UnpauseQueueMember" ;
 static char *app_upqm_synopsis = "Unpauses a queue member" ;
 static char *app_upqm_descrip =
-"   UnpauseQueueMember([queuename],interface[,options]):\n"
+"   UnpauseQueueMember([queuename],interface[,options[,reason]]):\n"
 "Unpauses (resumes calls to) a queue member.\n"
 "This is the counterpart to PauseQueueMember and operates exactly the\n"
 "same way, except it unpauses instead of pausing the given interface.\n"
+"The reason string is entirely optional and is used to add extra information\n"
+"to the appropriate queue_log entries and manager events.\n"
 "  This application sets the following channel variable upon completion:\n"
 "     UPQMSTATUS       The status of the attempt to unpause a queue \n"
 "                      member as a text string, one of\n"
@@ -412,7 +416,7 @@
 static AST_LIST_HEAD_STATIC(queues, call_queue);
 
 static void update_realtime_members(struct call_queue *q);
-static int set_member_paused(const char *queuename, const char *interface, int paused);
+static int set_member_paused(const char *queuename, const char *interface, const char *reason, int paused);
 
 static void set_queue_result(struct ast_channel *chan, enum queue_result res)
 {
@@ -2013,7 +2017,7 @@
 	ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
 	ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
 	if (qe->parent->autopause) {
-		if (!set_member_paused(qe->parent->name, interface, 1)) {
+		if (!set_member_paused(qe->parent->name, interface, "Auto-Pause", 1)) {
 			ast_verb(3, "Auto-Pausing Queue Member %s in queue %s since they failed to answer.\n", interface, qe->parent->name);
 		} else {
 			ast_verb(3, "Failed to pause Queue Member %s in queue %s!\n", interface, qe->parent->name);
@@ -2637,11 +2641,11 @@
 			/* Must gotten hung up */
 			res = -1;
 		} else {
+			/* User exited by pressing a digit */
 			res = digit;
-			if (res > 0 && !valid_exit(qe, res))
-				res = 0;
-		}
-		ast_debug(1, "%s: Nobody answered.\n", qe->chan->name);
+		}
+		if (res == -1)
+			ast_debug(1, "%s: Nobody answered.\n", qe->chan->name);
 	} else { /* peer is valid */
 		/* Ah ha!  Someone answered within the desired timeframe.  Of course after this
 		   we will always return with -1 so that it is hung up properly after the
@@ -2738,6 +2742,27 @@
 				ast_log(LOG_WARNING, "Announcement file '%s' is unavailable, continuing anyway...\n", qe->parent->sound_callerannounce);
 		}
 
+		ast_mutex_lock(&qe->parent->lock);
+		/* if setinterfacevar is defined, make member variables available to the channel */
+		/* use  pbx_builtin_setvar to set a load of variables with one call */
+		if (qe->parent->setinterfacevar) {
+			snprintf(interfacevar,sizeof(interfacevar), "MEMBERINTERFACE=%s|MEMBERNAME=%s|MEMBERCALLS=%d|MEMBERLASTCALL=%ld|MEMBERPENALTY=%d|MEMBERDYNAMIC=%d|MEMBERREALTIME=%d",
+				member->interface, member->membername, member->calls, (long)member->lastcall, member->penalty, member->dynamic, member->realtime);
+		 	pbx_builtin_setvar(qe->chan, interfacevar);
+		}
+		
+		/* if setqueueentryvar is defined, make queue entry (i.e. the caller) variables available to the channel */
+		/* use  pbx_builtin_setvar to set a load of variables with one call */
+		if (qe->parent->setqueueentryvar) {
+			snprintf(interfacevar,sizeof(interfacevar), "QEHOLDTIME=%ld|QEORIGINALPOS=%d",
+				(long) time(NULL) - qe->start, qe->opos);
+			pbx_builtin_setvar(qe->chan, interfacevar);
+		}
+	
+		/* try to set queue variables if configured to do so*/
+		set_queue_variables(qe);
+		ast_mutex_unlock(&qe->parent->lock);
+		
 		/* Begin Monitoring */
 		if (qe->parent->monfmt && *qe->parent->monfmt) {
 			if (!qe->parent->montype) {
@@ -2832,27 +2857,6 @@
 			ast_channel_sendurl(peer, url);
 		}
 		
-		ast_mutex_lock(&qe->parent->lock);
-		/* if setinterfacevar is defined, make member variables available to the channel */
-		/* use  pbx_builtin_setvar to set a load of variables with one call */
-		if (qe->parent->setinterfacevar) {
-			snprintf(interfacevar,sizeof(interfacevar), "MEMBERINTERFACE=%s|MEMBERNAME=%s|MEMBERCALLS=%d|MEMBERLASTCALL=%ld|MEMBERPENALTY=%d|MEMBERDYNAMIC=%d|MEMBERREALTIME=%d",
-				member->interface, member->membername, member->calls, (long)member->lastcall, member->penalty, member->dynamic, member->realtime);
-		 	pbx_builtin_setvar(qe->chan, interfacevar);
-		}
-		
-		/* if setqueueentryvar is defined, make queue entry (i.e. the caller) variables available to the channel */
-		/* use  pbx_builtin_setvar to set a load of variables with one call */
-		if (qe->parent->setqueueentryvar) {
-			snprintf(interfacevar,sizeof(interfacevar), "QEHOLDTIME=%ld|QEORIGINALPOS=%d",
-				(long) time(NULL) - qe->start, qe->opos);
-			pbx_builtin_setvar(qe->chan, interfacevar);
-		}
-	
-		/* try to set queue variables if configured to do so*/
-		set_queue_variables(qe);
-		ast_mutex_unlock(&qe->parent->lock);
-		
 		/* run a macro for this connection if defined. The macro simply returns, no action is taken on the result */
 		/* use macro from dialplan if passed as a option, otherwise use the default queue macro */
 		if (!ast_strlen_zero(macro)) {
@@ -3178,7 +3182,7 @@
 	return res;
 }
 
-static int set_member_paused(const char *queuename, const char *interface, int paused)
+static int set_member_paused(const char *queuename, const char *interface, const char *reason, int paused)
 {
 	int found = 0;
 	struct call_queue *q;
@@ -3206,14 +3210,24 @@
 				if(mem->realtime)
 					update_realtime_member_field(mem, queuename, "paused", paused ? "1" : "0");
 
-				ast_queue_log(q->name, "NONE", mem->membername, (paused ? "PAUSE" : "UNPAUSE"), "%s", "");
-
-				manager_event(EVENT_FLAG_AGENT, "QueueMemberPaused",
-					"Queue: %s\r\n"
-					"Location: %s\r\n"
-					"MemberName: %s\r\n"
-					"Paused: %d\r\n",
-						q->name, mem->interface, mem->membername, paused);
+				ast_queue_log(q->name, "NONE", mem->membername, (paused ? "PAUSE" : "UNPAUSE"), "%s", S_OR(reason, ""));
+				
+				if (!ast_strlen_zero(reason)) {
+					manager_event(EVENT_FLAG_AGENT, "QueueMemberPaused",
+						"Queue: %s\r\n"
+						"Location: %s\r\n"
+						"MemberName: %s\r\n"
+						"Paused: %d\r\n"
+						"Reason: %s\r\n",
+							q->name, mem->interface, mem->membername, paused, reason);
+				} else {
+					manager_event(EVENT_FLAG_AGENT, "QueueMemberPaused",
+						"Queue: %s\r\n"
+						"Location: %s\r\n"
+						"MemberName: %s\r\n"
+						"Paused: %d\r\n",
+							q->name, mem->interface, mem->membername, paused);
+				}
 			}
 		}
 		ast_mutex_unlock(&q->lock);
@@ -3325,10 +3339,11 @@
 		AST_APP_ARG(queuename);
 		AST_APP_ARG(interface);
 		AST_APP_ARG(options);
+		AST_APP_ARG(reason);
 	);
 
 	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "PauseQueueMember requires an argument ([queuename]|interface[|options])\n");
+		ast_log(LOG_WARNING, "PauseQueueMember requires an argument ([queuename]|interface[|options][|reason])\n");
 		return -1;
 	}
 
@@ -3337,11 +3352,11 @@
 	AST_STANDARD_APP_ARGS(args, parse);
 
 	if (ast_strlen_zero(args.interface)) {
-		ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options])\n");
+		ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options[|reason]])\n");
 		return -1;
 	}
 
-	if (set_member_paused(args.queuename, args.interface, 1)) {
+	if (set_member_paused(args.queuename, args.interface, args.reason, 1)) {
 		ast_log(LOG_WARNING, "Attempt to pause interface %s, not found\n", args.interface);
 		pbx_builtin_setvar_helper(chan, "PQMSTATUS", "NOTFOUND");
 		return -1;
@@ -3359,10 +3374,11 @@
 		AST_APP_ARG(queuename);
 		AST_APP_ARG(interface);
 		AST_APP_ARG(options);
+		AST_APP_ARG(reason);
 	);
 
 	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "UnpauseQueueMember requires an argument ([queuename]|interface[|options])\n");
+		ast_log(LOG_WARNING, "UnpauseQueueMember requires an argument ([queuename]|interface[|options[|reason]])\n");
 		return -1;
 	}
 
@@ -3371,11 +3387,11 @@
 	AST_STANDARD_APP_ARGS(args, parse);
 
 	if (ast_strlen_zero(args.interface)) {
-		ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options])\n");
+		ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options[|reason]])\n");
 		return -1;
 	}
 
-	if (set_member_paused(args.queuename, args.interface, 0)) {
+	if (set_member_paused(args.queuename, args.interface, args.reason, 0)) {
 		ast_log(LOG_WARNING, "Attempt to unpause interface %s, not found\n", args.interface);
 		pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "NOTFOUND");
 		return -1;
@@ -4553,12 +4569,13 @@
 
 static int manager_pause_queue_member(struct mansession *s, const struct message *m)
 {
-	const char *queuename, *interface, *paused_s;
+	const char *queuename, *interface, *paused_s, *reason;
 	int paused;
 
 	interface = astman_get_header(m, "Interface");
 	paused_s = astman_get_header(m, "Paused");
-	queuename = astman_get_header(m, "Queue");	/* Optional - if not supplied, pause the given Interface in all queues */
+	queuename = astman_get_header(m, "Queue");      /* Optional - if not supplied, pause the given Interface in all queues */
+	reason = astman_get_header(m, "Reason");        /* Optional - Only used for logging purposes */
 
 	if (ast_strlen_zero(interface) || ast_strlen_zero(paused_s)) {
 		astman_send_error(s, m, "Need 'Interface' and 'Paused' parameters.");
@@ -4567,7 +4584,7 @@
 
 	paused = abs(ast_true(paused_s));
 
-	if (set_member_paused(queuename, interface, paused))
+	if (set_member_paused(queuename, interface, reason, paused))
 		astman_send_error(s, m, "Interface not found");
 	else
 		astman_send_ack(s, m, paused ? "Interface paused successfully" : "Interface unpaused successfully");

Modified: team/group/CDRfix5/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/channels/chan_gtalk.c?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/channels/chan_gtalk.c (original)
+++ team/group/CDRfix5/channels/chan_gtalk.c Sat Sep  8 09:32:48 2007
@@ -111,8 +111,8 @@
 	time_t laststun;
 	struct gtalk *parent;	         /*!< Parent client */
 	char sid[100];
-	char us[100];
-	char them[100];
+	char us[AJI_MAX_JIDLEN];
+	char them[AJI_MAX_JIDLEN];
 	char ring[10];                   /*!< Message ID of ring */
 	iksrule *ringrule;               /*!< Rule for matching RING request */
 	int initiator;                   /*!< If we're the initiator */
@@ -154,8 +154,8 @@
 	struct gtalk_pvt *p;
 	struct ast_codec_pref prefs;
 	int amaflags;			/*!< AMA Flags */
-	char user[100];
-	char context[100];
+	char user[AJI_MAX_JIDLEN];
+	char context[AST_MAX_CONTEXT];
 	char accountcode[AST_MAX_ACCOUNT_CODE];	/*!< Account code */
 	int capability;
 	ast_group_t callgroup;	/*!< Call group */
@@ -1572,7 +1572,7 @@
 	struct gtalk_pvt *p;
 	struct ast_channel *chan;
 	int numchans = 0;
-	char them[100];
+	char them[AJI_MAX_JIDLEN];
 	char *jid = NULL;
 	char *resource = NULL;
 
@@ -1760,7 +1760,7 @@
 {
 	char *cat = NULL;
 	struct ast_config *cfg = NULL;
-	char context[100];
+	char context[AST_MAX_CONTEXT];
 	int allowguest = 1;
 	struct ast_variable *var;
 	struct gtalk *member;

Modified: team/group/CDRfix5/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/channels/chan_sip.c?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/channels/chan_sip.c (original)
+++ team/group/CDRfix5/channels/chan_sip.c Sat Sep  8 09:32:48 2007
@@ -14008,8 +14008,17 @@
 	transferer->readformat = chan2->readformat;
 	transferer->writeformat = chan2->writeformat;
 
-	/* Prepare for taking over the channel */
+	/* Prepare for taking over the channel.  Go ahead and grab this channel
+	 * lock here to avoid a deadlock with callbacks into the channel driver
+	 * that hold the channel lock and want the pvt lock.  */
+	while (ast_channel_trylock(chan2)) {
+		struct sip_pvt *pvt = chan2->tech_pvt;
+		sip_pvt_unlock(pvt);
+		usleep(1);
+		sip_pvt_lock(pvt);
+	}
 	ast_channel_masquerade(transferer, chan2);
+	ast_channel_unlock(chan2);
 
 	/* Setup the extensions and such */
 	ast_copy_string(transferer->context, chan2->context, sizeof(transferer->context));

Modified: team/group/CDRfix5/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/group/CDRfix5/channels/chan_skinny.c?view=diff&rev=81970&r1=81969&r2=81970
==============================================================================
--- team/group/CDRfix5/channels/chan_skinny.c (original)
+++ team/group/CDRfix5/channels/chan_skinny.c Sat Sep  8 09:32:48 2007
@@ -2179,9 +2179,9 @@
 
 static int skinny_do_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 3) {
+	if (argc != 3)
 		return RESULT_SHOWUSAGE;
-	}
+
 	skinnydebug = 1;
 	ast_cli(fd, "Skinny Debugging Enabled\n");
 	return RESULT_SUCCESS;
@@ -2189,26 +2189,52 @@
 
 static int skinny_no_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 4) {
+	if (argc != 4)
 		return RESULT_SHOWUSAGE;
-	}
+
 	skinnydebug = 0;
 	ast_cli(fd, "Skinny Debugging Disabled\n");
 	return RESULT_SUCCESS;
 }
 
+static char *complete_skinny_devices(const char *word, int state)
+{
+	struct skinny_device *d;
+	char *result = NULL;
+	int wordlen = strlen(word), which = 0;
+
+	for (d = devices; d && !result; d = d->next) {
+		if (!strncasecmp(word, d->id, wordlen) && ++which > state)
+			result = ast_strdup(d->id);
+	}
+
+	return result;
+}
+
+static char *complete_skinny_show_device(const char *line, const char *word, int pos, int state)
+{
+	return (pos == 3 ? ast_strdup(complete_skinny_devices(word, state)) : NULL);
+}
+
 static char *complete_skinny_reset(const char *line, const char *word, int pos, int state)
 {
+	return (pos == 2 ? ast_strdup(complete_skinny_devices(word, state)) : NULL);
+}
+
+static char *complete_skinny_show_lines(const char *line, const char *word, int pos, int state)
+{
 	struct skinny_device *d;
-
+	struct skinny_line *l;
 	char *result = NULL;
-	int wordlen = strlen(word);
-	int which = 0;
-
-	if (pos == 2) {
-		for (d = devices; d && !result; d = d->next) {
-			if (!strncasecmp(word, d->id, wordlen) && ++which > state)
-				result = ast_strdup(d->id);
+	int wordlen = strlen(word), which = 0;
+
+	if (pos != 3)
+		return NULL;
+	
+	for (d = devices; d && !result; d = d->next) {
+		for (l = d->lines; l && !result; l = l->next) {
+			if (!strncasecmp(word, l->name, wordlen) && ++which > state)
+				result = ast_strdup(l->name);
 		}
 	}
 
@@ -2220,14 +2246,14 @@
 	struct skinny_device *d;
 	struct skinny_req *req;
 
-	if (argc < 3 || argc > 4) {
+	if (argc < 3 || argc > 4)
 		return RESULT_SHOWUSAGE;
-	}
+
 	ast_mutex_lock(&devicelock);
 
 	for (d = devices; d; d = d->next) {
 		int fullrestart = 0;
-		if (!strcasecmp(argv[2], d->id) || !strcasecmp(argv[2], "all")) {
+		if (!strcasecmp(argv[2], d->id) || !strcasecmp(argv[2], d->name) || !strcasecmp(argv[2], "all")) {
 			if (!(d->session))
 				continue;
 
@@ -2321,32 +2347,97 @@
 	}
 }
 
+/*! \brief Print codec list from preference to CLI/manager */
+static void print_codec_to_cli(int fd, struct ast_codec_pref *pref)
+{
+	int x, codec;
+
+	for(x = 0; x < 32 ; x++) {
+		codec = ast_codec_pref_index(pref, x);
+		if (!codec)
+			break;
+		ast_cli(fd, "%s", ast_getformatname(codec));
+		ast_cli(fd, ":%d", pref->framing[x]);
+		if (x < 31 && ast_codec_pref_index(pref, x + 1))
+			ast_cli(fd, ",");
+	}
+	if (!x)
+		ast_cli(fd, "none");
+}
+
 static int skinny_show_devices(int fd, int argc, char *argv[])
 {
 	struct skinny_device *d;
 	struct skinny_line *l;
-	int numlines = 0;
-
-	if (argc != 3) {
+
+	if (argc != 3)
 		return RESULT_SHOWUSAGE;
-	}
+
 	ast_mutex_lock(&devicelock);
 
 	ast_cli(fd, "Name                 DeviceId         IP              Type            R NL\n");
 	ast_cli(fd, "-------------------- ---------------- --------------- --------------- - --\n");
+
 	for (d = devices; d; d = d->next) {
-		numlines = 0;
-		for (l = d->lines; l; l = l->next) {
+		int numlines = 0;
+
+		for (l = d->lines; l; l = l->next)
 			numlines++;
-		}
-
+		
 		ast_cli(fd, "%-20s %-16s %-15s %-15s %c %2d\n",
-				d->name,
-				d->id,
-				d->session?ast_inet_ntoa(d->session->sin.sin_addr):"",
-				device2str(d->type),
-				d->registered?'Y':'N',
-				numlines);
+			d->name,
+			d->id,
+			d->session?ast_inet_ntoa(d->session->sin.sin_addr):"",
+			device2str(d->type),
+			d->registered?'Y':'N',
+			numlines);
+	}
+
+	ast_mutex_unlock(&devicelock);
+
+	return RESULT_SUCCESS;
+}
+
+/*! \brief Show device information */
+static int skinny_show_device(int fd, int argc, char *argv[])
+{
+	struct skinny_device *d;
+	struct skinny_line *l;
+	struct skinny_speeddial *sd;
+	struct skinny_addon *a;
+
+	if (argc < 4)
+		return RESULT_SHOWUSAGE;
+
+	ast_mutex_lock(&devicelock);
+	for (d = devices; d; d = d->next) {
+		if (!strcasecmp(argv[3], d->id) || !strcasecmp(argv[3], d->name)) {
+			int numlines = 0, numaddons = 0, numspeeddials = 0;
+
+			for (l = d->lines; l; l = l->next)
+				numlines++;
+
+			ast_cli(fd, "Name:        %s\n", d->name);
+			ast_cli(fd, "Id:          %s\n", d->id);
+			ast_cli(fd, "version:     %s\n", S_OR(d->version_id, "Unknown"));
+			ast_cli(fd, "Ip address:  %s\n", (d->session ? ast_inet_ntoa(d->session->sin.sin_addr) : "Unknown"));
+			ast_cli(fd, "Port:        %d\n", (d->session ? ntohs(d->session->sin.sin_port) : 0));
+			ast_cli(fd, "Device Type: %s\n", device2str(d->type));
+			ast_cli(fd, "Registered:  %s\n", (d->registered ? "Yes" : "No"));
+			ast_cli(fd, "Lines:       %d\n", numlines);
+			for (l = d->lines; l; l = l->next)
+				ast_cli(fd, "  %s (%s)\n", l->name, l->label);
+			for (a = d->addons; a; a = a->next)
+				numaddons++;
+			ast_cli(fd, "Addons:      %d\n", numaddons);
+			for (a = d->addons; a; a = a->next)
+				ast_cli(fd, "  %s\n", a->type);
+			for (sd = d->speeddials; sd; sd = sd->next)
+				numspeeddials++;
+			ast_cli(fd, "Speeddials:  %d\n", numspeeddials);
+			for (sd = d->speeddials; sd; sd = sd->next)
+				ast_cli(fd, "  %s (%s) ishint: %d\n", sd->exten, sd->label, sd->isHint);
+		}
 	}
 	ast_mutex_unlock(&devicelock);
 	return RESULT_SUCCESS;
@@ -2357,11 +2448,11 @@
 	struct skinny_device *d;
 	struct skinny_line *l;
 
-	if (argc != 3) {
+	if (argc != 3)
 		return RESULT_SHOWUSAGE;
-	}
+	
 	ast_mutex_lock(&devicelock);
-
+	
 	ast_cli(fd, "Device Name          Instance Name                 Label               \n");
 	ast_cli(fd, "-------------------- -------- -------------------- --------------------\n");
 	for (d = devices; d; d = d->next) {
@@ -2373,8 +2464,97 @@
 				l->label);
 		}
 	}
-
+	
 	ast_mutex_unlock(&devicelock);
+	return RESULT_SUCCESS;
+}
+
+/*! \brief List line information. */
+static int skinny_show_line(int fd, int argc, char *argv[])
+{
+	struct skinny_device *d;
+	struct skinny_line *l;
+
+	char codec_buf[512];
+	char group_buf[256];
+
+	if (argc < 4)
+		return RESULT_SHOWUSAGE;
+	
+	ast_mutex_lock(&devicelock);
+
+	/* Show all lines matching the one supplied */
+	for (d = devices; d; d = d->next) {
+		if (argc == 6 && (strcasecmp(argv[5], d->id) && strcasecmp(argv[5], d->name)))
+			continue;
+		for (l = d->lines; l; l = l->next) {
+			if (strcasecmp(argv[3], l->name))
+				continue;
+			ast_cli(fd, "Line:             %s\n", l->name);
+			ast_cli(fd, "On Device:        %s\n", d->name);
+			ast_cli(fd, "Line Label:       %s\n", l->label);
+			ast_cli(fd, "Extension:        %s\n", S_OR(l->exten, "<not set>"));
+			ast_cli(fd, "Context:          %s\n", l->context);
+			ast_cli(fd, "CallGroup:        %s\n", ast_print_group(group_buf, sizeof(group_buf), l->callgroup));
+			ast_cli(fd, "PickupGroup:      %s\n", ast_print_group(group_buf, sizeof(group_buf), l->pickupgroup));
+			ast_cli(fd, "Language:         %s\n", S_OR(l->language, "<not set>"));
+			ast_cli(fd, "Accountcode:      %s\n", S_OR(l->accountcode, "<not set>"));
+			ast_cli(fd, "AmaFlag:          %s\n", ast_cdr_flags2str(l->amaflags));
+			ast_cli(fd, "CallerId Number:  %s\n", S_OR(l->cid_num, "<not set>"));
+			ast_cli(fd, "CallerId Name:    %s\n", S_OR(l->cid_name, "<not set>"));
+			ast_cli(fd, "Hide CallerId:    %s\n", (l->hidecallerid ? "Yes" : "No"));
+			ast_cli(fd, "CallForward:      %s\n", S_OR(l->call_forward, "<not set>"));
+			ast_cli(fd, "VoicemailBox:     %s\n", S_OR(l->mailbox, "<not set>"));
+			ast_cli(fd, "VoicemailNumber:  %s\n", S_OR(l->vmexten, "<not set>"));
+			ast_cli(fd, "MWIblink:         %d\n", l->mwiblink);
+			ast_cli(fd, "Regextension:     %s\n", S_OR(l->regexten, "<not set>"));
+			ast_cli(fd, "Regcontext:       %s\n", S_OR(l->regcontext, "<not set>"));
+			ast_cli(fd, "MoHInterpret:     %s\n", S_OR(l->mohinterpret, "<not set>"));
+			ast_cli(fd, "MoHSuggest:       %s\n", S_OR(l->mohsuggest, "<not set>"));
+			ast_cli(fd, "Last dialed nr:   %s\n", S_OR(l->lastnumberdialed, "<no calls made yet>"));
+			ast_cli(fd, "Last CallerID:    %s\n", S_OR(l->lastcallerid, "<not set>"));
+			ast_cli(fd, "Transfer enabled: %s\n", (l->transfer ? "Yes" : "No"));
+			ast_cli(fd, "Callwaiting:      %s\n", (l->callwaiting ? "Yes" : "No"));
+			ast_cli(fd, "3Way Calling:     %s\n", (l->threewaycalling ? "Yes" : "No"));
+			ast_cli(fd, "Can forward:      %s\n", (l->cancallforward ? "Yes" : "No"));
+			ast_cli(fd, "Do Not Disturb:   %s\n", (l->dnd ? "Yes" : "No"));
+			ast_cli(fd, "NAT:              %s\n", (l->nat ? "Yes" : "No"));
+			ast_cli(fd, "immediate:        %s\n", (l->immediate ? "Yes" : "No"));
+			ast_cli(fd, "Group:            %d\n", l->group);
+			ast_cli(fd, "Codecs:           ");
+			ast_getformatname_multiple(codec_buf, sizeof(codec_buf) -1, l->capability);
+			ast_cli(fd, "%s\n", codec_buf);
+			ast_cli(fd, "Codec Order:      (");
+			print_codec_to_cli(fd, &l->prefs);
+			ast_cli(fd, ")\n");
+			ast_cli(fd, "\n");
+		}
+	}
+	
+	ast_mutex_unlock(&devicelock);
+	return RESULT_SUCCESS;
+}
+
+/*! \brief List global settings for the Skinny subsystem. */
+static int skinny_show_settings(int fd, int argc, char *argv[])
+{
+	if (argc != 3)
+		return RESULT_SHOWUSAGE;
+
+	ast_cli(fd, "\nGlobal Settings:\n");
+	ast_cli(fd, "  Skinny Port:            %d\n", ntohs(bindaddr.sin_port));
+	ast_cli(fd, "  Bindaddress:            %s\n", ast_inet_ntoa(bindaddr.sin_addr));
+	ast_cli(fd, "  KeepAlive:              %d\n", keep_alive);
+	ast_cli(fd, "  Date Format:            %s\n", date_format);
+	ast_cli(fd, "  Voice Mail Extension:   %s\n", S_OR(vmexten, "(not set)"));
+	ast_cli(fd, "  Reg. context:           %s\n", S_OR(regcontext, "(not set)"));
+	ast_cli(fd, "  Jitterbuffer enabled:   %s\n", (ast_test_flag(&global_jbconf, AST_JB_ENABLED) ? "Yes" : "No"));
+	ast_cli(fd, "  Jitterbuffer forced:    %s\n", (ast_test_flag(&global_jbconf, AST_JB_FORCED) ? "Yes" : "No"));
+	ast_cli(fd, "  Jitterbuffer max size:  %ld\n", global_jbconf.max_size);
+	ast_cli(fd, "  Jitterbuffer resync:    %ld\n", global_jbconf.resync_threshold);
+	ast_cli(fd, "  Jitterbuffer impl:      %s\n", global_jbconf.impl);
+	ast_cli(fd, "  Jitterbuffer log:       %s\n", (ast_test_flag(&global_jbconf, AST_JB_LOG) ? "Yes" : "No"));
+
 	return RESULT_SUCCESS;
 }
 
@@ -2382,10 +2562,22 @@
 "Usage: skinny show devices\n"
 "       Lists all devices known to the Skinny subsystem.\n";
 
+static const char show_device_usage[] =
+"Usage: skinny show device <DeviceId|DeviceName>\n"
+"       Lists all deviceinformation of a specific device known to the Skinny subsystem.\n";
+
 static const char show_lines_usage[] =
 "Usage: skinny show lines\n"
 "       Lists all lines known to the Skinny subsystem.\n";
 
+static const char show_line_usage[] =
+"Usage: skinny show line <Line> [ on <DeviceID|DeviceName> ]\n"
+"       List all lineinformation of a specific line known to the Skinny subsystem.\n";
+
+static const char show_settings_usage[] =
+"Usage: skinny show settings\n"
+"       Lists all global configuration settings of the Skinny subsystem.\n";
+
 static const char debug_usage[] =
 "Usage: skinny set debug\n"
 "       Enables dumping of Skinny packets for debugging purposes\n";
@@ -2395,7 +2587,7 @@
 "       Disables dumping of Skinny packets for debugging purposes\n";
 
 static const char reset_usage[] =
-"Usage: skinny reset <DeviceId|all> [restart]\n"
+"Usage: skinny reset <DeviceId|DeviceName|all> [restart]\n"
 "       Causes a Skinny device to reset itself, optionally with a full restart\n";
 
 static struct ast_cli_entry cli_skinny[] = {
@@ -2403,9 +2595,21 @@
 	skinny_show_devices, "List defined Skinny devices",
 	show_devices_usage },
 
+	{ { "skinny", "show", "device", NULL },
+	skinny_show_device, "List Skinny device information",
+	show_device_usage, complete_skinny_show_device },
+
 	{ { "skinny", "show", "lines", NULL },
 	skinny_show_lines, "List defined Skinny lines per device",
 	show_lines_usage },
+
+	{ { "skinny", "show", "line", NULL },

[... 1115 lines stripped ...]



More information about the asterisk-commits mailing list