[asterisk-commits] murf: branch murf/bug11210 r114069 - in /team/murf/bug11210: ./ apps/ cdr/ ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 11 16:11:56 CDT 2008


Author: murf
Date: Fri Apr 11 16:11:56 2008
New Revision: 114069

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114069
Log:
Merged revisions 113320-114041 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r113349 | tilghman | 2008-04-08 09:48:58 -0600 (Tue, 08 Apr 2008) | 15 lines
  
  Merged revisions 113348 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113348 | tilghman | 2008-04-08 10:39:16 -0500 (Tue, 08 Apr 2008) | 7 lines
  
  Move check for still-bridged channels out a little further, to avoid possible
  deadlocks.  (Closes issue #12252)
  Reported by: callguy
   Patches: 
         20080319__bug12252.diff.txt uploaded by Corydon76 (license 14)
   Tested by: callguy
  
  ........
................
  r113400 | tilghman | 2008-04-08 10:54:21 -0600 (Tue, 08 Apr 2008) | 14 lines
  
  Merged revisions 113399 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113399 | tilghman | 2008-04-08 11:51:28 -0500 (Tue, 08 Apr 2008) | 6 lines
  
  Add security note on astgenkey's manpage.
  (closes issue #12373)
   Reported by: lmamane
   Patches: 
         20080406__bug12373.diff.txt uploaded by Corydon76 (license 14)
  
  ........
................
  r113403 | qwell | 2008-04-08 11:00:55 -0600 (Tue, 08 Apr 2008) | 9 lines
  
  Merged revisions 113402 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113402 | qwell | 2008-04-08 11:56:52 -0500 (Tue, 08 Apr 2008) | 1 line
  
  Work around some silliness caused by sys/capability.h - this should fix compile errors a number of users have been experiencing.
  ........
................
  r113452 | qwell | 2008-04-08 11:32:42 -0600 (Tue, 08 Apr 2008) | 9 lines
  
  Move AST_FEATURE_FLAG_* and FEATURE_RETURN_* to features.h so that they can be used by modules.
  
  (closes issue #12384)
  Reported by: fnordian
  Patches:
        features.patch uploaded by fnordian (license 110)
  
  (patch modified by me, to give FEATURE_RETURN_* an AST_ prefix)
................
  r113455 | qwell | 2008-04-08 12:08:35 -0600 (Tue, 08 Apr 2008) | 12 lines
  
  Merged revisions 113454 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113454 | qwell | 2008-04-08 13:07:49 -0500 (Tue, 08 Apr 2008) | 4 lines
  
  Add support for several new(ish) devices - most notably, 7942/7945, 7962/7965, 7975.
  
  Thanks to Greg Oliver for providing me the required information.
  
  ........
................
  r113505 | qwell | 2008-04-08 12:49:21 -0600 (Tue, 08 Apr 2008) | 9 lines
  
  Merged revisions 113504 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113504 | qwell | 2008-04-08 13:48:55 -0500 (Tue, 08 Apr 2008) | 1 line
  
  Add a little more that is required for previously added devices.
  ........
................
  r113508 | mmichelson | 2008-04-08 13:09:16 -0600 (Tue, 08 Apr 2008) | 15 lines
  
  Blocked revisions 113507 via svnmerge
  
  ........
  r113507 | mmichelson | 2008-04-08 14:07:38 -0500 (Tue, 08 Apr 2008) | 8 lines
  
  Fix potential buffer overflow that could happen if more than 100 announce files
  were specified when calling ParkAndAnnounce. This overflow is not exploitable remotely
  and so there is no need for a security advisory.
  
  (closes issue #12386)
  Reported by: davidw
  
  
  ........
................
  r113559 | tilghman | 2008-04-08 15:33:11 -0600 (Tue, 08 Apr 2008) | 6 lines
  
  Add commandline tool for doing CLI commands through AMI (instead of using asterisk -rx)
  (closes issue #12389)
   Reported by: davevg
   Patches: 
         astcli uploaded by davevg (license 209)
................
  r113597 | twilson | 2008-04-08 19:36:58 -0600 (Tue, 08 Apr 2008) | 10 lines
  
  Merged revisions 113596 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113596 | twilson | 2008-04-08 20:34:25 -0500 (Tue, 08 Apr 2008) | 2 lines
  
  Initialize fr->cacheable to make valgrind happy
  
  ........
................
  r113647 | tilghman | 2008-04-09 07:23:44 -0600 (Wed, 09 Apr 2008) | 6 lines
  
  Additional enhancements
  (closes issue #12390)
   Reported by: tzafrir
   Patches: 
         astcli_fixes.diff uploaded by tzafrir (license 46)
................
  r113649 | tilghman | 2008-04-09 07:55:28 -0600 (Wed, 09 Apr 2008) | 6 lines
  
  Permit callee to continue in the dialplan, after caller has hung up.
  (closes issue #11954)
   Reported by: johan
   Patches: 
         app_dial_rev104031.patch uploaded by johan (license 334)
................
  r113682 | mmichelson | 2008-04-09 08:41:58 -0600 (Wed, 09 Apr 2008) | 17 lines
  
  Merged revisions 113681 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113681 | mmichelson | 2008-04-09 09:40:05 -0500 (Wed, 09 Apr 2008) | 9 lines
  
  If Asterisk receives a 488 on an INVITE (not a reinvite), then
  we should not send a BYE.
  
  (closes issue #12392)
  Reported by: fnordian
  Patches:
        chan_sip.patch uploaded by fnordian (license 110) with small modification from me
  
  
  ........
................
  r113731 | tilghman | 2008-04-09 10:16:44 -0600 (Wed, 09 Apr 2008) | 6 lines
  
  Permit message wrap-around during message retrieval.
  (closes issue #12254)
   Reported by: andrew
   Patches: 
         bug-12253.diff uploaded by snuffy (license 35)
................
  r113752 | tilghman | 2008-04-09 10:23:30 -0600 (Wed, 09 Apr 2008) | 2 lines
  
  Mark recent additions from #11954 and #12254
................
  r113785 | file | 2008-04-09 10:52:04 -0600 (Wed, 09 Apr 2008) | 12 lines
  
  Merged revisions 113784 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113784 | file | 2008-04-09 13:50:45 -0300 (Wed, 09 Apr 2008) | 4 lines
  
  If we receive an AUTHREQ from the remote server and we are unable to reply (for example they have a secret configured, but we do not) then queue a hangup frame on the Asterisk channel. This will cause the channel to hangup and a HANGUP to be sent via IAX2 to the remote side which is the proper thing to do in this scenario.
  (closes issue #12385)
  Reported by: viraptor
  
  ........
................
  r113834 | qwell | 2008-04-09 11:41:09 -0600 (Wed, 09 Apr 2008) | 7 lines
  
  Move all messages wrapped in skinnydebug from debug to verbose.
  
  (closes issue #12224)
  Reported by: DEA
  Patches:
        chan_skinny-debug-log.txt uploaded by DEA (license 3)
................
  r113836 | mmichelson | 2008-04-09 11:48:33 -0600 (Wed, 09 Apr 2008) | 14 lines
  
  There was a subtle logical difference between 1.4 and trunk with regards to how timeouts
  were handled. In 1.4, if the absolute timeout were reached on a call, no matter what
  the return value of ast_spawn_extension was, the pbx would attempt to go to the 'T'
  extension or hangup otherwise. The rearrangement of this function in trunk made this check
  only happen in the case that ast_spawn_extension returned 0. If ast_spawn_extension returned
  1, then the fact that the timeout expired resulted in a no-op, and would cause an infinite
  loop to occur in __ast_pbx_run. This change fixes this problem. Now timeouts will
  behave as they did in 1.4
  
  (closes issue #11550)
  Reported by: pj
  Tested by: putnopvut
................
  r113838 | qwell | 2008-04-09 11:56:07 -0600 (Wed, 09 Apr 2008) | 2 lines
  
  Fix a small file handle "leak" pointed out by jjshoe on #asterisk.
................
  r113840 | file | 2008-04-09 12:05:40 -0600 (Wed, 09 Apr 2008) | 4 lines
  
  Enable enough RTP bridging to allow P2P to work.
  (closes issue #11901)
  Reported by: pj
................
  r113875 | tilghman | 2008-04-09 13:00:40 -0600 (Wed, 09 Apr 2008) | 12 lines
  
  Merged revisions 113874 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113874 | tilghman | 2008-04-09 13:57:33 -0500 (Wed, 09 Apr 2008) | 4 lines
  
  If the [csv] section does not exist in cdr.conf, then an unload/load sequence
  is needed to correct the problem.  Track whether the load succeeded with a
  variable, so we can fix this with a simple reload event, instead.
  
  ........
................
  r113928 | mmichelson | 2008-04-09 14:56:14 -0600 (Wed, 09 Apr 2008) | 16 lines
  
  Merged revisions 113927 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r113927 | mmichelson | 2008-04-09 15:54:31 -0500 (Wed, 09 Apr 2008) | 8 lines
  
  We need to set the persistant_route [sic] parameter for the sip_pvt
  during the initial INVITE, no matter if we're building the route set from
  an INVITE request or response.
  
  (closes issue #12391)
  Reported by: benjaminbohlmann
  Tested by: benjaminbohlmann
  
  ........
................
  r113980 | mmichelson | 2008-04-09 16:32:32 -0600 (Wed, 09 Apr 2008) | 8 lines
  
  Fix a crash that happened due to accessing free'd memory
  
  (closes issue #12396)
  Reported by: tcalosi
  Patches:
        12396.patch uploaded by putnopvut (license 60)
  	  Tested by: tcalosi
................
  r114022 | file | 2008-04-10 07:28:30 -0600 (Thu, 10 Apr 2008) | 14 lines
  
  Merged revisions 114021 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r114021 | file | 2008-04-10 10:27:11 -0300 (Thu, 10 Apr 2008) | 6 lines
  
  Don't add custom URI options if they don't exist OR they are empty.
  (closes issue #12407)
  Reported by: homesick
  Patches:
        uri_options-1.4.diff uploaded by homesick (license 91)
  
  ........
................
  r114024 | file | 2008-04-10 07:45:45 -0600 (Thu, 10 Apr 2008) | 4 lines
  
  Fix spelling of existent in a few places.
  (closes issue #12409)
  Reported by: candlerb
................
  r114027 | file | 2008-04-10 08:53:19 -0600 (Thu, 10 Apr 2008) | 6 lines
  
  Don't hardcode ru into the digits filename so that languageprefix can work.
  (closes issue #12404)
  Reported by: IgorG
  Patches:
        voicemail_ru_hardcoded-v1.patch uploaded by IgorG (license 20)
................
  r114030 | file | 2008-04-10 09:10:47 -0600 (Thu, 10 Apr 2008) | 14 lines
  
  Merged revisions 114029 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r114029 | file | 2008-04-10 12:09:04 -0300 (Thu, 10 Apr 2008) | 6 lines
  
  Create the directory where name recordings will go if it does not exist.
  (closes issue #12311)
  Reported by: rkeene
  Patches:
        12311-mkdir.diff uploaded by qwell (license 4)
  
  ........
................
  r114033 | file | 2008-04-10 09:59:13 -0600 (Thu, 10 Apr 2008) | 13 lines
  
  Blocked revisions 114032 via svnmerge
  
  ........
  r114032 | file | 2008-04-10 12:58:39 -0300 (Thu, 10 Apr 2008) | 6 lines
  
  Forgot the 1.4 branch for russian language fix.
  (closes issue #12404)
  Reported by: IgorG
  Patches:
        voicemail_ru_hardcoded-v1.patch uploaded by IgorG (license 20)
  
  ........
................
  r114036 | qwell | 2008-04-10 11:27:16 -0600 (Thu, 10 Apr 2008) | 18 lines
  
  Merged revisions 114035 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
  r114035 | qwell | 2008-04-10 12:26:10 -0500 (Thu, 10 Apr 2008) | 10 lines
  
  Only try to prefix language if we are not using an absolute path (suffix it otherwise).
  
  en/var/lib/asterisk/sounds/blah.gsm is a very silly path.
  
  (closes issue #12379)
  Reported by: kuj
  Patches:
        12379-absolutepath.diff uploaded by qwell (license 4)
  Tested by: kuj, qwell
  
  ........
................

Added:
    team/murf/bug11210/contrib/scripts/astcli
      - copied unchanged from r114036, trunk/contrib/scripts/astcli
Modified:
    team/murf/bug11210/   (props changed)
    team/murf/bug11210/CHANGES
    team/murf/bug11210/apps/app_dial.c
    team/murf/bug11210/apps/app_meetme.c
    team/murf/bug11210/apps/app_queue.c
    team/murf/bug11210/apps/app_voicemail.c
    team/murf/bug11210/cdr/cdr_csv.c
    team/murf/bug11210/channels/chan_h323.c
    team/murf/bug11210/channels/chan_iax2.c
    team/murf/bug11210/channels/chan_sip.c
    team/murf/bug11210/channels/chan_skinny.c
    team/murf/bug11210/channels/chan_unistim.c
    team/murf/bug11210/configs/cdr.conf.sample
    team/murf/bug11210/configs/voicemail.conf.sample
    team/murf/bug11210/contrib/scripts/astgenkey.8
    team/murf/bug11210/include/asterisk/features.h
    team/murf/bug11210/main/asterisk.c
    team/murf/bug11210/main/features.c
    team/murf/bug11210/main/file.c
    team/murf/bug11210/main/pbx.c
    team/murf/bug11210/main/rtp.c

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Apr 11 16:11:56 2008
@@ -1,1 +1,1 @@
-/trunk:1-113319
+/trunk:1-114041

Modified: team/murf/bug11210/CHANGES
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/CHANGES?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/CHANGES (original)
+++ team/murf/bug11210/CHANGES Fri Apr 11 16:11:56 2008
@@ -25,6 +25,10 @@
    the arguments to Directory; previously, you could enter only 3, regardless
    of how many names are in your company.  For large companies, this should be
    quite helpful.
+ * Voicemail now permits a mailbox setting to wrap around from first to last
+   messages, if the "messagewrap" option is set to a true value.
+ * Dial has a new option: F(context^extension^pri), which permits a callee to
+   continue in the dialplan, at the specified label, if the caller hangs up.
 
 SIP Changes
 -----------

Modified: team/murf/bug11210/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_dial.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/apps/app_dial.c (original)
+++ team/murf/bug11210/apps/app_dial.c Fri Apr 11 16:11:56 2008
@@ -116,6 +116,8 @@
 "           extension associated with the channel using a dialplan 'hint'.\n"
 "           For example, some PSTNs do not allow CallerID to be set to anything\n"
 "           other than the number assigned to the caller.\n"
+"    F(context^exten^pri) - When the caller hangs up, transfer the called party\n"
+"           to the specified context and extension and continue execution.\n"
 "    g    - Proceed with dialplan execution at the current extension if the\n"
 "           destination channel hangs up.\n"
 "    G(context^exten^pri) - If the call is answered, transfer the calling party to\n"
@@ -147,7 +149,7 @@
 "           specified.\n"
 "    M(x[^arg]) - Execute the Macro for the *called* channel before connecting\n"
 "           to the calling channel. Arguments can be specified to the Macro\n"
-"           using '^' as a delimeter. The Macro can set the variable\n"
+"           using '^' as a delimiter. The Macro can set the variable\n"
 "           MACRO_RESULT to specify the following actions after the Macro is\n"
 "           finished executing.\n"
 "           * ABORT        Hangup both legs of the call.\n"
@@ -194,7 +196,7 @@
 "           DTMF sequence defined in features.conf.\n"
 "    U(x[^arg]) - Execute via Gosub the routine 'x' for the *called* channel before connecting\n"
 "           to the calling channel. Arguments can be specified to the Gosub\n"
-"           using '^' as a delimeter. The Gosub routine can set the variable\n"
+"           using '^' as a delimiter. The Gosub routine can set the variable\n"
 "           GOSUB_RESULT to specify the following actions after the Gosub returns.\n"
 "           * ABORT        Hangup both legs of the call.\n"
 "           * CONGESTION   Behave as if line congestion was encountered.\n"
@@ -269,6 +271,7 @@
 #define DIAL_NOFORWARDHTML   ((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
 #define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 33)
 #define OPT_PEER_H           ((uint64_t)1 << 34)
+#define OPT_CALLEE_GO_ON     ((uint64_t)1 << 35)
 
 enum {
 	OPT_ARG_ANNOUNCE = 0,
@@ -278,6 +281,7 @@
 	OPT_ARG_MUSICBACK,
 	OPT_ARG_CALLEE_MACRO,
 	OPT_ARG_CALLEE_GOSUB,
+	OPT_ARG_CALLEE_GO_ON,
 	OPT_ARG_PRIVACY,
 	OPT_ARG_DURATION_STOP,
 	OPT_ARG_OPERMODE,
@@ -293,6 +297,7 @@
 	AST_APP_OPTION_ARG('D', OPT_SENDDTMF, OPT_ARG_SENDDTMF),
 	AST_APP_OPTION('e', OPT_PEER_H),
 	AST_APP_OPTION('f', OPT_FORCECLID),
+	AST_APP_OPTION_ARG('F', OPT_CALLEE_GO_ON, OPT_ARG_CALLEE_GO_ON),
 	AST_APP_OPTION('g', OPT_GO_ON),
 	AST_APP_OPTION_ARG('G', OPT_GOTO, OPT_ARG_GOTO),
 	AST_APP_OPTION('h', OPT_CALLEE_HANGUP),
@@ -1919,9 +1924,15 @@
 			ast_set2_flag(peer, autoloopflag, AST_FLAG_IN_AUTOLOOP);  /* set it back the way it was */
 		}
 		if (res != AST_PBX_NO_HANGUP_PEER) {
-			if (!ast_check_hangup(chan))
-				chan->hangupcause = peer->hangupcause;
-			ast_hangup(peer);
+			if (!ast_check_hangup(peer) && ast_test_flag64(&opts, OPT_CALLEE_GO_ON) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) {		
+                        	replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
+                        	ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
+	                        ast_pbx_start(peer);
+			} else {
+				if (!ast_check_hangup(chan))
+					chan->hangupcause = peer->hangupcause;
+				ast_hangup(peer);
+			}
 		}
 	}
 out:

Modified: team/murf/bug11210/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_meetme.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/apps/app_meetme.c (original)
+++ team/murf/bug11210/apps/app_meetme.c Fri Apr 11 16:11:56 2008
@@ -1694,8 +1694,17 @@
 	ast_mutex_unlock(&conf->playlock);
 
 	if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
+		char destdir[PATH_MAX];
+
+		snprintf(destdir, sizeof(destdir), "%s/meetme", ast_config_AST_SPOOL_DIR);
+
+		if (mkdir(destdir, 0777) && errno != EEXIST) {
+			ast_log(LOG_WARNING, "mkdir '%s' failed: %s\n", destdir, strerror(errno));
+			goto outrun;
+		}
+
 		snprintf(user->namerecloc, sizeof(user->namerecloc),
-			 "%s/meetme/meetme-username-%s-%d", ast_config_AST_SPOOL_DIR,
+			 "%s/meetme-username-%s-%d", destdir,
 			 conf->confno, user->user_no);
 		if (confflags & CONFFLAG_INTROUSERNOREVIEW)
 			res = ast_play_and_record(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL);

Modified: team/murf/bug11210/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_queue.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/apps/app_queue.c (original)
+++ team/murf/bug11210/apps/app_queue.c Fri Apr 11 16:11:56 2008
@@ -1519,7 +1519,6 @@
 			q->strategy = QUEUE_STRATEGY_RINGALL;
 		init_queue(q);		/* Ensure defaults for all parameters not set explicitly. */
 		ao2_link(queues, q);
-		ast_variables_destroy(tmpvar);
 	}
 
 	memset(tmpbuf, 0, sizeof(tmpbuf));

Modified: team/murf/bug11210/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_voicemail.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/apps/app_voicemail.c (original)
+++ team/murf/bug11210/apps/app_voicemail.c Fri Apr 11 16:11:56 2008
@@ -204,23 +204,24 @@
 #define MAX_DATETIME_FORMAT	512
 #define MAX_NUM_CID_CONTEXTS 10
 
-#define VM_REVIEW        (1 << 0)
-#define VM_OPERATOR      (1 << 1)
-#define VM_SAYCID        (1 << 2)
-#define VM_SVMAIL        (1 << 3)
-#define VM_ENVELOPE      (1 << 4)
-#define VM_SAYDURATION   (1 << 5)
-#define VM_SKIPAFTERCMD  (1 << 6)
+#define VM_REVIEW        (1 << 0)   /*!< After recording, permit the caller to review the recording before saving */
+#define VM_OPERATOR      (1 << 1)   /*!< Allow 0 to be pressed to go to 'o' extension */
+#define VM_SAYCID        (1 << 2)   /*!< Repeat the CallerID info during envelope playback */
+#define VM_SVMAIL        (1 << 3)   /*!< Allow the user to compose a new VM from within VoicemailMain */
+#define VM_ENVELOPE      (1 << 4)   /*!< Play the envelope information (who-from, time received, etc.) */
+#define VM_SAYDURATION   (1 << 5)   /*!< Play the length of the message during envelope playback */
+#define VM_SKIPAFTERCMD  (1 << 6)   /*!< After deletion, assume caller wants to go to the next message */
 #define VM_FORCENAME     (1 << 7)   /*!< Have new users record their name */
 #define VM_FORCEGREET    (1 << 8)   /*!< Have new users record their greetings */
-#define VM_PBXSKIP       (1 << 9)
-#define VM_DIRECFORWARD  (1 << 10)  /*!< directory_forward */
-#define VM_ATTACH        (1 << 11)
-#define VM_DELETE        (1 << 12)
-#define VM_ALLOCED       (1 << 13)
-#define VM_SEARCH        (1 << 14)
+#define VM_PBXSKIP       (1 << 9)   /*!< Skip the [PBX] preamble in the Subject line of emails */
+#define VM_DIRECFORWARD  (1 << 10)  /*!< Permit caller to use the Directory app for selecting to which mailbox to forward a VM */
+#define VM_ATTACH        (1 << 11)  /*!< Attach message to voicemail notifications? */
+#define VM_DELETE        (1 << 12)  /*!< Delete message after sending notification */
+#define VM_ALLOCED       (1 << 13)  /*!< Structure was malloc'ed, instead of placed in a return (usually static) buffer */
+#define VM_SEARCH        (1 << 14)  /*!< Search all contexts for a matching mailbox */
 #define VM_TEMPGREETWARN (1 << 15)  /*!< Remind user tempgreeting is set */
 #define VM_MOVEHEARD     (1 << 16)  /*!< Move a "heard" message to Old after listening to it */
+#define VM_MESSAGEWRAP   (1 << 17)  /*!< Wrap around from the last message to the first, and vice-versa */
 #define ERROR_LOCK_PATH  -100
 #define ERROR_MAILBOX_FULL	-200
 
@@ -740,6 +741,8 @@
 		ast_set2_flag(vmu, ast_true(value), VM_REVIEW);
 	} else if (!strcasecmp(var, "tempgreetwarn")) {
 		ast_set2_flag(vmu, ast_true(value), VM_TEMPGREETWARN);	
+	} else if (!strcasecmp(var, "messagewrap")){
+		ast_set2_flag(vmu, ast_true(value), VM_MESSAGEWRAP);	
 	} else if (!strcasecmp(var, "operator")) {
 		ast_set2_flag(vmu, ast_true(value), VM_OPERATOR);	
 	} else if (!strcasecmp(var, "envelope")) {
@@ -6633,7 +6636,7 @@
 			res = say_and_wait(chan, dcnum, chan->language);
 		if (!res && lastnum) {
 			if (lastnum == 1) 
-				res = ast_play_and_wait(chan, "digits/ru/odno");
+				res = ast_play_and_wait(chan, "digits/odno");
 			else
 				res = say_and_wait(chan, lastnum, chan->language);
 		}
@@ -6652,7 +6655,7 @@
 			res = say_and_wait(chan, dcnum, chan->language);
 		if (!res && lastnum) {
 			if (lastnum == 1) 
-				res = ast_play_and_wait(chan, "digits/ru/odno");
+				res = ast_play_and_wait(chan, "digits/odno");
 			else
 				res = say_and_wait(chan, lastnum, chan->language);
 		}
@@ -6842,7 +6845,7 @@
 	}
 }
 
-static int vm_instructions_en(struct ast_channel *chan, struct vm_state *vms, int skipadvanced)
+static int vm_instructions_en(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced)
 {
 	int res = 0;
 	/* Play instructions and wait for new command */
@@ -6864,20 +6867,23 @@
 			}
 		} else {
 			/* Added for additional help */
-			if (skipadvanced)  {
+			if (skipadvanced) {
 				res = ast_play_and_wait(chan, "vm-onefor-full");
 				if (!res)
 					res = vm_play_folder_name(chan, vms->vmbox);
 				res = ast_play_and_wait(chan, "vm-opts-full");
-                        }
-			if (vms->curmsg)
+			}
+			if (vms->curmsg || (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms->lastmsg > 0)) {
 				res = ast_play_and_wait(chan, "vm-prev");
+			}
 			if (!res && !skipadvanced)
 				res = ast_play_and_wait(chan, "vm-advopts");
 			if (!res)
 				res = ast_play_and_wait(chan, "vm-repeat");
-			if (!res && (vms->curmsg != vms->lastmsg))
+			if (!res && (vms->curmsg != vms->lastmsg || 
+				(ast_test_flag(vmu, VM_MESSAGEWRAP) && vms->lastmsg > 0) )) {
 				res = ast_play_and_wait(chan, "vm-next");
+			}
 			if (!res) {
 				if (!vms->deleted[vms->curmsg])
 					res = ast_play_and_wait(chan, "vm-delete");
@@ -6907,7 +6913,7 @@
 	return res;
 }
 
-static int vm_instructions_tw(struct ast_channel *chan, struct vm_state *vms, int skipadvanced)
+static int vm_instructions_tw(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms,  int skipadvanced)
 {
 	int res = 0;
 	/* Play instructions and wait for new command */
@@ -6925,18 +6931,18 @@
 			res = ast_play_and_wait(chan, "vm-opts");
 		if (!res) {
 			vms->starting = 0;
-			return vm_instructions_en(chan, vms, skipadvanced);
+			return vm_instructions_en(chan, vmu, vms, skipadvanced);
 		}
 	}
 	return res;
 }
 
-static int vm_instructions(struct ast_channel *chan, struct vm_state *vms, int skipadvanced)
+static int vm_instructions(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced)
 {
 	if (vms->starting && !strcasecmp(chan->language, "tw")) { /* CHINESE (Taiwan) syntax */
-		return vm_instructions_tw(chan, vms, skipadvanced);
+		return vm_instructions_tw(chan, vmu, vms, skipadvanced);
 	} else {					/* Default to ENGLISH */
-		return vm_instructions_en(chan, vms, skipadvanced);
+		return vm_instructions_en(chan, vmu, vms, skipadvanced);
 	}
 }
 
@@ -7901,6 +7907,9 @@
 			if (vms.curmsg > 0) {
 				vms.curmsg--;
 				cmd = play_message(chan, vmu, &vms);
+			} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
+				vms.curmsg = vms.lastmsg;
+				cmd = play_message(chan, vmu, &vms);
 			} else {
 				cmd = ast_play_and_wait(chan, "vm-nomore");
 			}
@@ -7908,6 +7917,9 @@
 		case '6': /* Go to the next message */
 			if (vms.curmsg < vms.lastmsg) {
 				vms.curmsg++;
+				cmd = play_message(chan, vmu, &vms);
+			} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
+				vms.curmsg = 0;
 				cmd = play_message(chan, vmu, &vms);
 			} else {
 				cmd = ast_play_and_wait(chan, "vm-nomore");
@@ -7934,6 +7946,9 @@
 				if (ast_test_flag((&globalflags), VM_SKIPAFTERCMD)) {
 					if (vms.curmsg < vms.lastmsg) {
 						vms.curmsg++;
+						cmd = play_message(chan, vmu, &vms);
+					} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
+						vms.curmsg = 0;
 						cmd = play_message(chan, vmu, &vms);
 					} else {
 						cmd = ast_play_and_wait(chan, "vm-nomore");
@@ -8005,6 +8020,9 @@
 				if (vms.curmsg < vms.lastmsg) {
 					vms.curmsg++;
 					cmd = play_message(chan, vmu, &vms);
+				} else if (ast_test_flag(vmu, VM_MESSAGEWRAP) && vms.lastmsg > 0) {
+					vms.curmsg = 0;
+					cmd = play_message(chan, vmu, &vms);
 				} else {
 					cmd = ast_play_and_wait(chan, "vm-nomore");
 				}
@@ -8018,7 +8036,7 @@
 				if (!cmd)
 					cmd = ast_play_and_wait(chan, "vm-opts");
 				if (!cmd)
-					cmd = vm_instructions(chan, &vms, 1);
+					cmd = vm_instructions(chan, vmu, &vms, 1);
 			} else
 				cmd = 0;
 			break;
@@ -8028,7 +8046,7 @@
 				adsi_status(chan, &vms);
 			break;
 		default:	/* Nothing */
-			cmd = vm_instructions(chan, &vms, 0);
+			cmd = vm_instructions(chan, vmu, &vms, 0);
 			break;
 		}
 	}
@@ -9132,6 +9150,11 @@
 			ast_debug(1, "VM Temporary Greeting Reminder Option enabled globally\n");
 		}
 		ast_set2_flag((&globalflags), ast_true(val), VM_TEMPGREETWARN);
+		if (!(val = ast_variable_retrieve(cfg, "general", "messagewrap"))){
+			ast_debug(1, "VM next message wrap disabled globally\n");
+			val = "no";
+		}
+		ast_set2_flag((&globalflags), ast_true(val), VM_MESSAGEWRAP);	
 
 		if (!(val = ast_variable_retrieve(cfg, "general", "operator"))) {
 			ast_debug(1, "VM Operator break disabled globally\n");

Modified: team/murf/bug11210/cdr/cdr_csv.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/cdr/cdr_csv.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/cdr/cdr_csv.c (original)
+++ team/murf/bug11210/cdr/cdr_csv.c Fri Apr 11 16:11:56 2008
@@ -50,6 +50,7 @@
 static int usegmtime = 0;
 static int loguniqueid = 0;
 static int loguserfield = 0;
+static int loaded = 0;
 static char *config = "cdr.conf";
 
 /* #define CSV_LOGUNIQUEID 1 */
@@ -316,6 +317,7 @@
 static int unload_module(void)
 {
 	ast_cdr_unregister(name);
+	loaded = 0;
 	return 0;
 }
 
@@ -326,15 +328,23 @@
 	if(!load_config(0))
 		return AST_MODULE_LOAD_DECLINE;
 
-	if ((res = ast_cdr_register(name, ast_module_info->description, csv_log)))
+	if ((res = ast_cdr_register(name, ast_module_info->description, csv_log))) {
 		ast_log(LOG_ERROR, "Unable to register CSV CDR handling\n");
-
+	} else {
+		loaded = 1;
+	}
 	return res;
 }
 
 static int reload(void)
 {
-	load_config(1);
+	if (load_config(1)) {
+		loaded = 1;
+	} else {
+		loaded = 0;
+		ast_log(LOG_WARNING, "No [csv] section in cdr.conf.  Unregistering backend.\n");
+		ast_cdr_unregister(name);
+	}
 
 	return 0;
 }

Modified: team/murf/bug11210/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_h323.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/channels/chan_h323.c (original)
+++ team/murf/bug11210/channels/chan_h323.c Fri Apr 11 16:11:56 2008
@@ -254,10 +254,7 @@
 	.write = oh323_write,
 	.indicate = oh323_indicate,
 	.fixup = oh323_fixup,
-	/* disable, for now */
-#if 0
 	.bridge = ast_rtp_bridge,
-#endif
 };
 
 static const char* redirectingreason2str(int redirectingreason)
@@ -3092,10 +3089,12 @@
 		return AST_RTP_GET_FAILED;
 
 	ast_mutex_lock(&pvt->lock);
-	if (pvt->rtp && pvt->options.bridge) {
-		*rtp = pvt->rtp;
+	*rtp = pvt->rtp;
+#if 0
+	if (pvt->options.bridge) {
 		res = AST_RTP_TRY_NATIVE;
 	}
+#endif
 	ast_mutex_unlock(&pvt->lock);
 
 	return res;

Modified: team/murf/bug11210/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_iax2.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/channels/chan_iax2.c (original)
+++ team/murf/bug11210/channels/chan_iax2.c Fri Apr 11 16:11:56 2008
@@ -9211,9 +9211,13 @@
 					break;
 				}
 				if (authenticate_reply(iaxs[fr->callno], &iaxs[fr->callno]->addr, &ies, iaxs[fr->callno]->secret, iaxs[fr->callno]->outkey)) {
+					struct ast_frame hangup_fr = { .frametype = AST_FRAME_CONTROL,
+								.subclass = AST_CONTROL_HANGUP,
+					};
 					ast_log(LOG_WARNING, 
 						"I don't know how to authenticate %s to %s\n", 
 						ies.username ? ies.username : "<unknown>", ast_inet_ntoa(iaxs[fr->callno]->addr.sin_addr));
+					iax2_queue_frame(fr->callno, &hangup_fr);
 				}
 				if (!iaxs[fr->callno]) {
 					ast_mutex_unlock(&iaxsl[fr->callno]);
@@ -9811,6 +9815,7 @@
 			ast_debug(1, "Received out of order packet... (type=%d, subclass %d, ts = %d, last = %d)\n", f.frametype, f.subclass, fr->ts, iaxs[fr->callno]->last);
 		fr->outoforder = -1;
 	}
+	fr->cacheable = ((f.frametype == AST_FRAME_VOICE) || (f.frametype == AST_FRAME_VIDEO));
 	duped_fr = iaxfrdup2(fr);
 	if (duped_fr) {
 		schedule_delivery(duped_fr, updatehistory, 0, &fr->ts);

Modified: team/murf/bug11210/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_sip.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/channels/chan_sip.c (original)
+++ team/murf/bug11210/channels/chan_sip.c Fri Apr 11 16:11:56 2008
@@ -4525,6 +4525,7 @@
 /*! \brief Execute destruction of SIP dialog structure, release memory */
 static void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist)
 {
+
 	if (sip_debug_test_pvt(p))
 		ast_verbose("Really destroying SIP dialog '%s' Method: %s\n", p->callid, sip_methods[p->method].text);
 
@@ -4569,15 +4570,10 @@
 	if (p->options)
 		ast_free(p->options);
 
-	/* We absolutely cannot destroy the rtp struct while a bridge is active or we WILL crash */
 	if (p->rtp) {
-		while (ast_rtp_get_bridged(p->rtp))
-			usleep(1);
 		ast_rtp_destroy(p->rtp);
 	}
 	if (p->vrtp) {
-		while (ast_rtp_get_bridged(p->vrtp))
-			usleep(1);
 		ast_rtp_destroy(p->vrtp);
 	}
 	if (p->trtp) {
@@ -4621,6 +4617,7 @@
 	}
 
 	ast_string_field_free_memory(p);
+	return;
 }
 
 /*! \brief  update_call_counter: Handle call_limit for SIP users 
@@ -8935,7 +8932,7 @@
 	}
 
 	/* If custom URI options have been provided, append them */
-	if (p->options && p->options->uri_options)
+	if (p->options && !ast_strlen_zero(p->options->uri_options))
 		ast_str_append(&invite, 0, ";%s", p->options->uri_options);
 	
  	/* This is the request URI, which is the next hop of the call
@@ -10247,8 +10244,9 @@
 		free_old_route(p->route);
 		p->route = NULL;
 	}
-	
-	p->route_persistant = backwards;
+
+	/* We only want to create the route set the first time this is called */
+	p->route_persistant = 1;
 	
 	/* Build a tailq, then assign it to p->route when done.
 	 * If backwards, we add entries from the head so they end up
@@ -12942,6 +12940,16 @@
 		return 0;
 	}
 	
+	/* We absolutely cannot destroy the rtp struct while a bridge is active or we WILL crash */
+	if (dialog->rtp && ast_rtp_get_bridged(dialog->rtp)) {
+		ast_verbose("Bridge still active.  Delaying destroy of SIP dialog '%s' Method: %s\n", dialog->callid, sip_methods[dialog->method].text);
+		return 0;
+	}
+
+	if (dialog->vrtp && ast_rtp_get_bridged(dialog->vrtp)) {
+		ast_verbose("Bridge still active.  Delaying destroy of SIP dialog '%s' Method: %s\n", dialog->callid, sip_methods[dialog->method].text);
+		return 0;
+	}
 	/* Check RTP timeouts and kill calls if we have a timeout set and do not get RTP */
 	check_rtp_timeout(dialog, *t);
 
@@ -15667,6 +15675,9 @@
 			if (p->owner && !req->ignore)
 				ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 			p->needdestroy = 1;
+			/* If there's no dialog to end, then mark p as already gone */
+			if (!reinvite)
+				sip_alreadygone(p);
 		}
 		break;
 	case 491: /* Pending */

Modified: team/murf/bug11210/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_skinny.c?view=diff&rev=114069&r1=114068&r2=114069
==============================================================================
--- team/murf/bug11210/channels/chan_skinny.c (original)
+++ team/murf/bug11210/channels/chan_skinny.c Fri Apr 11 16:11:56 2008
@@ -1001,11 +1001,20 @@
 #define SKINNY_DEVICE_ATA186		12	/* Cisco ATA-186 */
 #define SKINNY_DEVICE_7941		115
 #define SKINNY_DEVICE_7971		119
+#define SKINNY_DEVICE_7914		124	/* Expansion module */
 #define SKINNY_DEVICE_7985		302
 #define SKINNY_DEVICE_7911		307
 #define SKINNY_DEVICE_7961GE		308
 #define SKINNY_DEVICE_7941GE		309
+#define SKINNY_DEVICE_7931		348
 #define SKINNY_DEVICE_7921		365
+#define SKINNY_DEVICE_7906		369
+#define SKINNY_DEVICE_7962		404	/* Not found */
+#define SKINNY_DEVICE_7937		431
+#define SKINNY_DEVICE_7942		434
+#define SKINNY_DEVICE_7945		435
+#define SKINNY_DEVICE_7965		436
+#define SKINNY_DEVICE_7975		437
 #define SKINNY_DEVICE_7905		20000
 #define SKINNY_DEVICE_7920		30002
 #define SKINNY_DEVICE_7970		30006
@@ -1340,12 +1349,16 @@
 		case SKINNY_DEVICE_7960:
 		case SKINNY_DEVICE_7961:
 		case SKINNY_DEVICE_7961GE:
+		case SKINNY_DEVICE_7962:
+		case SKINNY_DEVICE_7965:
 			for (i = 0; i < 6; i++)
 				(btn++)->buttonDefinition = BT_CUST_LINESPEEDDIAL;
 			break;
 		case SKINNY_DEVICE_7940:
 		case SKINNY_DEVICE_7941:
 		case SKINNY_DEVICE_7941GE:
+		case SKINNY_DEVICE_7942:
+		case SKINNY_DEVICE_7945:
 			for (i = 0; i < 2; i++)
 				(btn++)->buttonDefinition = BT_CUST_LINESPEEDDIAL;
 			break;
@@ -1359,6 +1372,7 @@
 			break;
 		case SKINNY_DEVICE_7970:
 		case SKINNY_DEVICE_7971:
+		case SKINNY_DEVICE_7975:
 		case SKINNY_DEVICE_CIPC:
 			for (i = 0; i < 8; i++)
 				(btn++)->buttonDefinition = BT_CUST_LINESPEEDDIAL;
@@ -1385,6 +1399,18 @@
 		case SKINNY_DEVICE_7902:
 			ast_log(LOG_WARNING, "Unsupported device type '%d (7902)' found.\n", d->type);
 			break;
+		case SKINNY_DEVICE_7906:
+			ast_log(LOG_WARNING, "Unsupported device type '%d (7906)' found.\n", d->type);
+			break;
+		case SKINNY_DEVICE_7931:
+			ast_log(LOG_WARNING, "Unsupported device type '%d (7931)' found.\n", d->type);
+			break;
+		case SKINNY_DEVICE_7937:
+			ast_log(LOG_WARNING, "Unsupported device type '%d (7937)' found.\n", d->type);
+			break;
+		case SKINNY_DEVICE_7914:
+			ast_log(LOG_WARNING, "Unsupported device type '%d (7914)' found.  Expansion module registered by itself?\n", d->type);
+			break;
 		case SKINNY_DEVICE_SCCPGATEWAY_AN:
 		case SKINNY_DEVICE_SCCPGATEWAY_BRI:
 			ast_log(LOG_WARNING, "Unsupported device type '%d (SCCP gateway)' found.\n", d->type);
@@ -1798,7 +1824,7 @@
 	int res = 0;
 
 	if (!s) {
-		ast_log(LOG_WARNING, "Asked to transmit to a non-existant session!\n");
+		ast_log(LOG_WARNING, "Asked to transmit to a non-existent session!\n");
 		return -1;
 	}
 
@@ -1863,7 +1889,7 @@
 		return;
 
 	if (skinnydebug)
-			ast_debug(1, "Setting Callinfo to %s(%s) from %s(%s) on %s(%d)\n", fromname, fromnum, toname, tonum, s->device->name, instance);
+			ast_verb(1, "Setting Callinfo to %s(%s) from %s(%s) on %s(%d)\n", fromname, fromnum, toname, tonum, s->device->name, instance);
 
 	if (fromname) {
 		ast_copy_string(req->data.callinfo.callingPartyName, fromname, sizeof(req->data.callinfo.callingPartyName));
@@ -1963,7 +1989,7 @@
 	struct skinny_req *req;
 
 	if (skinnydebug)
-		ast_debug(1, "Setting ringer mode to '%d'.\n", mode);
+		ast_verb(1, "Setting ringer mode to '%d'.\n", mode);
 
 	if (!(req = req_alloc(sizeof(struct set_ringer_message), SET_RINGER_MESSAGE)))
 		return;
@@ -1995,14 +2021,14 @@
 		req->data.clearpromptstatus.callReference = reference;
 
 		if (skinnydebug)
-			ast_debug(1, "Clearing Display\n");
+			ast_verb(1, "Clearing Display\n");
 	} else {
 		if (!(req = req_alloc(sizeof(struct displaytext_message), DISPLAYTEXT_MESSAGE)))
 			return;
 
 		ast_copy_string(req->data.displaytext.text, text, sizeof(req->data.displaytext.text));
 		if (skinnydebug)
-			ast_debug(1, "Displaying message '%s'\n", req->data.displaytext.text);
+			ast_verb(1, "Displaying message '%s'\n", req->data.displaytext.text);
 	}
 
 	transmit_response(s, req);
@@ -2019,7 +2045,7 @@
 	req->data.displaynotify.displayTimeout = htolel(t);
 
 	if (skinnydebug)
-		ast_debug(1, "Displaying notify '%s'\n", text);
+		ast_verb(1, "Displaying notify '%s'\n", text);
 
 	transmit_response(s, req);
 }
@@ -2036,7 +2062,7 @@
 		req->data.clearpromptstatus.callReference = htolel(callid);
 
 		if (skinnydebug)
-			ast_debug(1, "Clearing Prompt\n");
+			ast_verb(1, "Clearing Prompt\n");
 	} else {
 		if (!(req = req_alloc(sizeof(struct display_prompt_status_message), DISPLAY_PROMPT_STATUS_MESSAGE)))
 			return;
@@ -2047,7 +2073,7 @@
 		req->data.displaypromptstatus.callReference = htolel(callid);
 
 		if (skinnydebug)
-			ast_debug(1, "Displaying Prompt Status '%s'\n", text);
+			ast_verb(1, "Displaying Prompt Status '%s'\n", text);
 	}
 
 	transmit_response(s, req);
@@ -2230,10 +2256,10 @@
 	for (l = d->lines; l; l = l->next) {
 		if (has_voicemail(l)) {
 			if (skinnydebug)
-				ast_debug(1, "Checking for voicemail Skinny %s@%s\n", l->name, d->name);
+				ast_verb(1, "Checking for voicemail Skinny %s@%s\n", l->name, d->name);

[... 1237 lines stripped ...]



More information about the asterisk-commits mailing list