[asterisk-commits] murf: branch group/bug7433 r48076 - in /team/group/bug7433: ./ apps/ channels...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Nov 27 21:43:34 MST 2006


Author: murf
Date: Mon Nov 27 22:43:34 2006
New Revision: 48076

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48076
Log:
Merged revisions 47645,47649,47656,47672,47684,47690,47693,47697-47698,47701,47707,47709,47712,47733,47736,47744,47748,47751,47755,47758,47762,47764,47777,47781-47782,47803,47823,47843,47845,47850,47852,47856,47860,47863-47864,47892,47897,47911,47944,47959,47989,47992,48002,48015,48017,48031,48038,48046,48049,48054 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r47645 | file | 2006-11-14 21:45:24 -0700 (Tue, 14 Nov 2006) | 2 lines

If NAT detection is turned on or already detected then say NAT is active when setting the remote RTP peer when doing early bridging. (issue #8365 reported by marcelbarbulescu)

................
r47649 | oej | 2006-11-15 06:21:33 -0700 (Wed, 15 Nov 2006) | 2 lines

Block patch to 1.2 that already was fixed in 1.4.

................
r47656 | oej | 2006-11-15 08:25:50 -0700 (Wed, 15 Nov 2006) | 3 lines

Send error message when we can't allocate SIP dialog, possibly due to limitation of file descriptors.
(imported from 1.2)

................
r47672 | rizzo | 2006-11-15 10:46:45 -0700 (Wed, 15 Nov 2006) | 7 lines

fix longest match search in find_cli.
Trunk already fixed.

1.2 not affected (well, i have no idea, the code is totally
different there).


................
r47684 | kpfleming | 2006-11-15 11:43:30 -0700 (Wed, 15 Nov 2006) | 10 lines

Merged revisions 47682 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47682 | kpfleming | 2006-11-15 12:39:47 -0600 (Wed, 15 Nov 2006) | 2 lines

ouch... don't use printf, use ast_log/ast_verbose

........

................
r47690 | kpfleming | 2006-11-15 13:01:22 -0700 (Wed, 15 Nov 2006) | 20 lines

Merged revisions 47686,47688-47689 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47686 | kpfleming | 2006-11-15 13:42:05 -0600 (Wed, 15 Nov 2006) | 2 lines

clear the category's variable tail pointer as well when variables are detached from it

........
r47688 | kpfleming | 2006-11-15 13:47:43 -0600 (Wed, 15 Nov 2006) | 2 lines

when appending a list of variable to a category, ensure the tail pointer points to the last variable in the list

........
r47689 | kpfleming | 2006-11-15 13:58:46 -0600 (Wed, 15 Nov 2006) | 2 lines

when re-writing the config file, don't repeat the path if it hasn't changed

........

................
r47693 | kpfleming | 2006-11-15 13:27:38 -0700 (Wed, 15 Nov 2006) | 12 lines

Merged revisions 47677 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47677 | kpfleming | 2006-11-15 11:56:42 -0600 (Wed, 15 Nov 2006) | 4 lines

ensure that message duration is included in email notifications for forwarded messages (BE-96, fix by me after corydon used his clue-bat on me)
ensure that duration in the message metadata is updated if prepending is done during forwarding (related to BE-96)
remove prototype for API call that does not exist

........

................
r47697 | kpfleming | 2006-11-15 13:31:02 -0700 (Wed, 15 Nov 2006) | 2 lines

block fix that was found in this branch and backported to 1.2

................
r47698 | oej | 2006-11-15 13:31:11 -0700 (Wed, 15 Nov 2006) | 3 lines

- Improve SIP history
- Never send reply to ACK (again...)

................
r47701 | kpfleming | 2006-11-15 13:50:06 -0700 (Wed, 15 Nov 2006) | 2 lines

don't try to call fclose() if fopen() failed

................
r47707 | file | 2006-11-15 14:33:41 -0700 (Wed, 15 Nov 2006) | 2 lines

We need to ensure timelimit stuff is included as well so warnings get played. (issue #8050 reported by KNK)

................
r47709 | tilghman | 2006-11-15 14:56:55 -0700 (Wed, 15 Nov 2006) | 2 lines

Fix ODBC_STORAGE for when context is NULL

................
r47712 | file | 2006-11-15 15:31:17 -0700 (Wed, 15 Nov 2006) | 10 lines

Merged revisions 47711 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47711 | file | 2006-11-15 17:29:30 -0500 (Wed, 15 Nov 2006) | 2 lines

Make sure that the pvt structure exists before trying to do fixup on Local channels. (issue #7937 reported by mada123, fix by alamantia with mods by me)

........

................
r47733 | oej | 2006-11-16 08:03:49 -0700 (Thu, 16 Nov 2006) | 4 lines

- CANCEL is never authenticated (according to the RFC)
- Update docs on canreinvite. "nonat" is the recommended setting for most users with
  phones behind a NAT.

................
r47736 | oej | 2006-11-16 08:16:58 -0700 (Thu, 16 Nov 2006) | 2 lines

Warn users about change in canreinvite

................
r47744 | oej | 2006-11-16 09:51:59 -0700 (Thu, 16 Nov 2006) | 2 lines

Don't fixup if there's nothing to fixup 

................
r47748 | file | 2006-11-16 10:52:48 -0700 (Thu, 16 Nov 2006) | 2 lines

Don't unreference the SLA object if there is no SLA object in the devicestate callback. (issue #8354 reported by loloski)

................
r47751 | file | 2006-11-16 11:29:12 -0700 (Thu, 16 Nov 2006) | 10 lines

Merged revisions 47750 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47750 | file | 2006-11-16 13:26:50 -0500 (Thu, 16 Nov 2006) | 2 lines

Because of the way chan_local is written we should be extra careful and make sure our callback functions have a tech_pvt. (issue #8275 reported by mflorell)

........

................
r47755 | oej | 2006-11-16 12:24:23 -0700 (Thu, 16 Nov 2006) | 4 lines

Make the HOLD notification optional, in order to avoid a lot of extra database lookups
for all those realtime users out there.


................
r47758 | kpfleming | 2006-11-16 13:09:10 -0700 (Thu, 16 Nov 2006) | 2 lines

check for pre-1.4 versions of Zaptel and abort the configure script if found with an appropriate error message

................
r47762 | file | 2006-11-16 13:30:54 -0700 (Thu, 16 Nov 2006) | 9 lines

Blocked revisions 47761 via svnmerge

........
r47761 | file | 2006-11-16 15:29:28 -0500 (Thu, 16 Nov 2006) | 2 lines

Look for the header file specifically in all cases, not just the existence of the directory. (issue #8358 reported by mrness)

........

................
r47764 | file | 2006-11-16 14:11:06 -0700 (Thu, 16 Nov 2006) | 2 lines

Compare technology using the pointers instead of a straight comparison based on name. (issue #8228 reported by dean bath)

................
r47777 | kpfleming | 2006-11-16 16:00:10 -0700 (Thu, 16 Nov 2006) | 12 lines

update documentation regarding IAX2 transfers and CDRs

Merged revisions 47776 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47776 | kpfleming | 2006-11-16 16:57:31 -0600 (Thu, 16 Nov 2006) | 2 lines

update clearly wrong documentation regarding cdr_custom

........

................
r47781 | qwell | 2006-11-16 16:18:22 -0700 (Thu, 16 Nov 2006) | 9 lines

Blocked revisions 47780 via svnmerge

........
r47780 | qwell | 2006-11-16 17:16:35 -0600 (Thu, 16 Nov 2006) | 2 lines

Fix a couple of typos in applications..  Initially spotted by mrobinson.

........

................
r47782 | qwell | 2006-11-16 16:19:46 -0700 (Thu, 16 Nov 2006) | 2 lines

Fix a couple of typos.  Initially pointed out by mrobinson.

................
r47803 | kpfleming | 2006-11-17 12:02:38 -0700 (Fri, 17 Nov 2006) | 2 lines

block patch that was already present here

................
r47823 | rizzo | 2006-11-18 10:59:35 -0700 (Sat, 18 Nov 2006) | 5 lines

fix bug 7450 - Parsing fails if From header contains angle brackets 
(the bug was only in a corner case where the < was right after the
opening quote, and the fix is trivial).


................
r47843 | oej | 2006-11-20 04:29:19 -0700 (Mon, 20 Nov 2006) | 2 lines

Make sure we destroy scheduled items and not use them ever again after destruction (rizzo)

................
r47845 | oej | 2006-11-20 04:45:22 -0700 (Mon, 20 Nov 2006) | 4 lines

Explain properly how videosupport works. 

Committ from Asterisk Video Task Force meeting in Paris!

................
r47850 | file | 2006-11-20 08:51:37 -0700 (Mon, 20 Nov 2006) | 2 lines

Use a separate variable in the channel structure to store the context that the channel was dialed from. (issue #8382 reported by jiddings)

................
r47852 | file | 2006-11-20 08:58:50 -0700 (Mon, 20 Nov 2006) | 2 lines

Only remove/destroy the RTCP I/O item if it exists.

................
r47856 | file | 2006-11-20 09:17:47 -0700 (Mon, 20 Nov 2006) | 9 lines

Blocked revisions 47855 via svnmerge

........
r47855 | file | 2006-11-20 11:16:22 -0500 (Mon, 20 Nov 2006) | 2 lines

Free history items at the end of use of the temporary SIP pvt structure. (issue #8383 reported by benh)

........

................
r47860 | file | 2006-11-20 12:51:36 -0700 (Mon, 20 Nov 2006) | 10 lines

Merged revisions 47859 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47859 | file | 2006-11-20 14:50:21 -0500 (Mon, 20 Nov 2006) | 2 lines

Don't forget to byte swap if we are exiting the smoother feed early. (issue #8287 reported by arturs)

........

................
r47863 | tilghman | 2006-11-20 13:00:54 -0700 (Mon, 20 Nov 2006) | 10 lines

Merged revisions 47862 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47862 | tilghman | 2006-11-20 13:59:07 -0600 (Mon, 20 Nov 2006) | 2 lines

Failing to trap -1 error from mmap causes segfault (Issue 8385)

........

................
r47864 | tilghman | 2006-11-20 13:01:58 -0700 (Mon, 20 Nov 2006) | 2 lines

Oops, merge missed release of odbc object

................
r47892 | oej | 2006-11-21 08:20:03 -0700 (Tue, 21 Nov 2006) | 3 lines

Apparently Exosip sends a 101 after a 100 provisional response. Let's not treat that as
early media. (discovered at the AVTF meeting in Paris).

................
r47897 | file | 2006-11-21 10:32:27 -0700 (Tue, 21 Nov 2006) | 2 lines

If we have the non standard G726-32 setting turned on we want to return G726-32 to the SDP, not our AAL2 string. (issue #8330 reported by voipgate)

................
r47911 | murf | 2006-11-21 19:37:26 -0700 (Tue, 21 Nov 2006) | 1 line

blocking 47910 from 1.4; the time-limits on Dial are working OK
................
r47944 | file | 2006-11-22 14:47:43 -0700 (Wed, 22 Nov 2006) | 2 lines

Video will never reach Packet2Packet bridging and can do more harm then good.

................
r47959 | oej | 2006-11-23 04:01:47 -0700 (Thu, 23 Nov 2006) | 2 lines

Don't allocate unused variable.

................
r47989 | crichter | 2006-11-24 08:46:13 -0700 (Fri, 24 Nov 2006) | 9 lines

Merged revisions 47968 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47968 | crichter | 2006-11-23 17:10:23 +0100 (Do, 23 Nov 2006) | 1 line

fixed a litle bug regarding HOLD/RETRIEVE. beatufied some logs, changed some loglevels. changed the default value of block_on_alarm
........

................
r47992 | murf | 2006-11-24 10:17:07 -0700 (Fri, 24 Nov 2006) | 1 line

bug 8189 posted this fix for main/translate.c for PLC
................
r48002 | oej | 2006-11-25 02:28:28 -0700 (Sat, 25 Nov 2006) | 4 lines

Not having a HINT is not an ERROR. In 1.4 and future releases, you can disable
subscription support totally or per peer in sip.conf with allowsubscribe = yes | no


................
r48015 | murf | 2006-11-25 17:01:34 -0700 (Sat, 25 Nov 2006) | 1 line

A little bit of func_cdr documentation upgrade-- no bug# involved, although 8221 may have inspired it.
................
r48017 | murf | 2006-11-25 17:26:16 -0700 (Sat, 25 Nov 2006) | 1 line

might as well also document the raw values of the flag vars
................
r48031 | oej | 2006-11-26 23:41:33 -0700 (Sun, 26 Nov 2006) | 2 lines

Change logging message

................
r48038 | file | 2006-11-27 08:32:19 -0700 (Mon, 27 Nov 2006) | 10 lines

Merged revisions 48037 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48037 | file | 2006-11-27 10:30:37 -0500 (Mon, 27 Nov 2006) | 2 lines

Do not reference the freed outgoing structure in the debug message. (issue #8425 reported by arkadia)

........

................
r48046 | russell | 2006-11-27 10:17:40 -0700 (Mon, 27 Nov 2006) | 2 lines

Remove a couple of unused variables (issue #8380, casper)

................
r48049 | tilghman | 2006-11-27 10:20:37 -0700 (Mon, 27 Nov 2006) | 10 lines

Merged revisions 48045 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48045 | tilghman | 2006-11-27 11:15:54 -0600 (Mon, 27 Nov 2006) | 2 lines

Random MOH wasn't really random (bug 8381)

........

................
r48054 | file | 2006-11-27 11:06:50 -0700 (Mon, 27 Nov 2006) | 10 lines

Merged revisions 48053 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48053 | file | 2006-11-27 13:03:57 -0500 (Mon, 27 Nov 2006) | 2 lines

Use the proper function to get the new message count instead of always using the filesystem. (issue #8421 reported by slimey)

........

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

Modified:
    team/group/bug7433/   (props changed)
    team/group/bug7433/.cleancount
    team/group/bug7433/UPGRADE.txt
    team/group/bug7433/apps/app_db.c
    team/group/bug7433/apps/app_dial.c
    team/group/bug7433/apps/app_directed_pickup.c
    team/group/bug7433/apps/app_meetme.c
    team/group/bug7433/apps/app_voicemail.c
    team/group/bug7433/channels/chan_local.c
    team/group/bug7433/channels/chan_misdn.c
    team/group/bug7433/channels/chan_sip.c
    team/group/bug7433/channels/misdn/isdn_lib.c
    team/group/bug7433/channels/misdn_config.c
    team/group/bug7433/configs/sip.conf.sample
    team/group/bug7433/configure
    team/group/bug7433/configure.ac
    team/group/bug7433/doc/billing.txt
    team/group/bug7433/funcs/func_cdr.c
    team/group/bug7433/include/asterisk/channel.h
    team/group/bug7433/main/channel.c
    team/group/bug7433/main/cli.c
    team/group/bug7433/main/config.c
    team/group/bug7433/main/file.c
    team/group/bug7433/main/frame.c
    team/group/bug7433/main/manager.c
    team/group/bug7433/main/rtp.c
    team/group/bug7433/main/translate.c
    team/group/bug7433/pbx/pbx_spool.c
    team/group/bug7433/res/res_musiconhold.c

Propchange: team/group/bug7433/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/group/bug7433/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/bug7433/
------------------------------------------------------------------------------
    svnmerge-blocked = /branches/1.2:47648

Propchange: team/group/bug7433/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Nov 27 22:43:34 2006
@@ -1,1 +1,1 @@
-/branches/1.4:1-47643
+/branches/1.4:1-48075

Modified: team/group/bug7433/.cleancount
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/.cleancount?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/.cleancount (original)
+++ team/group/bug7433/.cleancount Mon Nov 27 22:43:34 2006
@@ -1,1 +1,1 @@
-25
+26

Modified: team/group/bug7433/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/UPGRADE.txt?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/UPGRADE.txt (original)
+++ team/group/bug7433/UPGRADE.txt Mon Nov 27 22:43:34 2006
@@ -323,6 +323,12 @@
   in coming versions of Asterisk. Please use the dialplan application
   sipaddheader() to add the "Alert-Info" header to the outbound invite.
 
+* The "canreinvite" option has changed. canreinvite=yes used to disable
+  re-invites if you had NAT=yes. In 1.4, you need to set canreinvite=nonat
+  to disable re-invites when NAT=yes. This is propably what you want.
+  The settings are now: "yes", "no", "nonat", "update". Please consult
+  sip.conf.sample for detailed information.
+
 The Zap channel:
 
 * Support for MFC/R2 has been removed, as it has not been functional for some

Modified: team/group/bug7433/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/apps/app_db.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/apps/app_db.c (original)
+++ team/group/bug7433/apps/app_db.c Mon Nov 27 22:43:34 2006
@@ -50,7 +50,7 @@
 
 /*! \todo XXX Remove this application after 1.4 is relased */
 static char *d_descrip =
-"  DBdel(family/key): This applicaiton will delete a key from the Asterisk\n"
+"  DBdel(family/key): This application will delete a key from the Asterisk\n"
 "database.\n"
 "  This application has been DEPRECATED in favor of the DB_DELETE function.\n";
 

Modified: team/group/bug7433/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/apps/app_dial.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/apps/app_dial.c (original)
+++ team/group/bug7433/apps/app_dial.c Mon Nov 27 22:43:34 2006
@@ -67,7 +67,7 @@
 
 static char *descrip =
 "  Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL]):\n"
-"This applicaiton will place calls to one or more specified channels. As soon\n"
+"This application will place calls to one or more specified channels. As soon\n"
 "as one of the requested channels answers, the originating channel will be\n"
 "answered, if it has not already been answered. These two channels will then\n"
 "be active in a bridged call. All other channels that were requested will then\n"
@@ -456,7 +456,7 @@
 						       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
 						       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 						       DIAL_NOFORWARDHTML);
-					ast_copy_string(c->context, "", sizeof(c->context));
+					ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
 					ast_copy_string(c->exten, "", sizeof(c->exten));
 				}
 				continue;
@@ -577,7 +577,7 @@
 							       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
 							       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 							       DIAL_NOFORWARDHTML);
-						ast_copy_string(c->context, "", sizeof(c->context));
+						ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
 						ast_copy_string(c->exten, "", sizeof(c->exten));
 						/* Setup RTP early bridge if appropriate */
 						ast_rtp_early_bridge(in, peer);
@@ -1175,7 +1175,7 @@
 			ast_app_group_set_channel(tmp->chan, outbound_group);
 
 		/* Inherit context and extension */
-		ast_copy_string(tmp->chan->context, chan->context, sizeof(tmp->chan->context));
+		ast_copy_string(tmp->chan->dialcontext, chan->context, sizeof(tmp->chan->dialcontext));
 		ast_copy_string(tmp->chan->exten, chan->exten, sizeof(tmp->chan->exten));
 
 		/* Place the call, but don't wait on the answer */

Modified: team/group/bug7433/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/apps/app_directed_pickup.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/apps/app_directed_pickup.c (original)
+++ team/group/bug7433/apps/app_directed_pickup.c Mon Nov 27 22:43:34 2006
@@ -97,7 +97,7 @@
 
 	while ((target = ast_channel_walk_locked(target))) {
 		if (!strcasecmp(target->exten, exten) &&
-		    !strcasecmp(target->context, context) &&
+		    !strcasecmp(target->dialcontext, context) &&
 		    can_pickup(target)) {
 			res = pickup_do(chan, target);
 			ast_channel_unlock(target);

Modified: team/group/bug7433/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/apps/app_meetme.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/apps/app_meetme.c (original)
+++ team/group/bug7433/apps/app_meetme.c Mon Nov 27 22:43:34 2006
@@ -2930,6 +2930,10 @@
 
 	/* Find conference */
 	sla = sla2 = ASTOBJ_CONTAINER_FIND(&slas, data);
+
+	if (!sla2)
+		return AST_DEVICE_INVALID;
+
 	ASTOBJ_UNREF(sla2, sla_destroy);
 
 	ast_log(LOG_DEBUG, "for '%s' conf = %p, sla = %p\n", data, conf, sla);

Modified: team/group/bug7433/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/apps/app_voicemail.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/apps/app_voicemail.c (original)
+++ team/group/bug7433/apps/app_voicemail.c Mon Nov 27 22:43:34 2006
@@ -1098,8 +1098,14 @@
 						fd = -1;
 						continue;
 					}
-					if (fd > -1)
-						fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+					if (fd > -1) {
+						if ((fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) == -1) {
+							ast_log(LOG_WARNING, "Could not mmap the output file: %s (%d)\n", strerror(errno), errno);
+							SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+							ast_odbc_release_obj(obj);
+							goto yuck;
+						}
+					}
 				}
 				if (fdm) {
 					memset(fdm, 0, fdlen);
@@ -3759,11 +3765,11 @@
 	return res;
 }
 
-static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vmfts, char *context, signed char record_gain)
+static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vmfmts,
+			     char *context, signed char record_gain, long *duration, struct vm_state *vms)
 {
 	int cmd = 0;
 	int retries = 0;
-	int duration = 0;
 	signed char zero_gain = 0;
 
 	while ((cmd >= 0) && (cmd != 't') && (cmd != '*')) {
@@ -3771,15 +3777,52 @@
 			retries = 0;
 		switch (cmd) {
 		case '1': 
-			/* prepend a message to the current message and return */
+			/* prepend a message to the current message, update the metadata and return */
 		{
-			char file[200];
-			snprintf(file, sizeof(file), "%s/msg%04d", curdir, curmsg);
+			char msgfile[PATH_MAX];
+			char textfile[PATH_MAX];
+			int prepend_duration = 0;
+			struct ast_config *msg_cfg;
+			const char *duration_str;
+
+			make_file(msgfile, sizeof(msgfile), curdir, curmsg);
+			strcpy(textfile, msgfile);
+			strncat(textfile, ".txt", sizeof(textfile) - 1);
+			*duration = 0;
+
+			/* if we can't read the message metadata, stop now */
+			if (!(msg_cfg = ast_config_load(textfile))) {
+				cmd = 0;
+				break;
+			}
+
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
-			cmd = ast_play_and_prepend(chan, NULL, file, 0, vmfmts, &duration, 1, silencethreshold, maxsilence);
+
+			cmd = ast_play_and_prepend(chan, NULL, msgfile, 0, vmfmts, &prepend_duration, 1, silencethreshold, maxsilence);
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
+
+			
+			if ((duration_str = ast_variable_retrieve(msg_cfg, "message", "duration")))
+				*duration = atoi(duration_str);
+
+			if (prepend_duration) {
+				struct ast_category *msg_cat;
+				/* need enough space for a maximum-length message duration */
+				char duration_str[12];
+
+				*duration += prepend_duration;
+				msg_cat = ast_category_get(msg_cfg, "message");
+				snprintf(duration_str, 11, "%ld", *duration);
+				if (!ast_variable_update(msg_cat, "duration", duration_str, NULL)) {
+					config_text_file_save(textfile, msg_cfg, "app_voicemail");
+					STORE(curdir, vmu->mailbox, context, curmsg, chan, vmu, vmfmts, *duration, vms);
+				}
+			}
+
+			ast_config_destroy(msg_cfg);
+
 			break;
 		}
 		case '2': 
@@ -4009,8 +4052,10 @@
 	} else {
 
 		/* Forward VoiceMail */
+		long duration = 0;
+
 		RETRIEVE(dir, curmsg);
-		cmd = vm_forwardoptions(chan, sender, dir, curmsg, vmfmts, context, record_gain);
+		cmd = vm_forwardoptions(chan, sender, dir, curmsg, vmfmts, S_OR(context, "default"), record_gain, &duration, vms);
 		if (!cmd) {
 			AST_LIST_TRAVERSE_SAFE_BEGIN(&extensions, vmtmp, list) {
 #ifdef IMAP_STORAGE
@@ -4071,7 +4116,7 @@
 				/* NULL category for IMAP storage */
 				sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, vms->fn, fmt, duration, attach_user_voicemail, chan, NULL);
 #else
-				copy_message(chan, sender, 0, curmsg, 0, vmtmp, fmt);
+				copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
 #endif
 				saved_messages++;
 				AST_LIST_REMOVE_CURRENT(&extensions, list);
@@ -6830,22 +6875,13 @@
 			}
 		}
 		AST_LIST_TRAVERSE(&users, vmu, list) {
-			char dirname[256];
-			DIR *vmdir;
-			struct dirent *vment;
-			int vmcount = 0;
-			char count[12];
+			int newmsgs = 0, oldmsgs = 0;
+			char count[12], tmp[256] = "";
 
 			if ((argc == 3) || ((argc == 5) && !strcmp(argv[4],vmu->context))) {
-				make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX");
-				if ((vmdir = opendir(dirname))) {
-					/* No matter what the format of VM, there will always be a .txt file for each message. */
-					while ((vment = readdir(vmdir)))
-						if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
-							vmcount++;
-					closedir(vmdir);
-				}
-				snprintf(count,sizeof(count),"%d",vmcount);
+				snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
+				inboxcount(tmp, &newmsgs, &oldmsgs);
+				snprintf(count,sizeof(count),"%d",newmsgs);
 				ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
 			}
 		}

Modified: team/group/bug7433/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/channels/chan_local.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/channels/chan_local.c (original)
+++ team/group/bug7433/channels/chan_local.c Mon Nov 27 22:43:34 2006
@@ -202,6 +202,9 @@
 	struct local_pvt *p = ast->tech_pvt;
 	int isoutbound;
 	int res = -1;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -276,6 +279,9 @@
 	int res = -1;
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	/* Just queue for delivery to the other side */
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -295,6 +301,10 @@
 static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct local_pvt *p = newchan->tech_pvt;
+
+	if (!p)
+		return -1;
+
 	ast_mutex_lock(&p->lock);
 
 	if ((p->owner != oldchan) && (p->chan != oldchan)) {
@@ -316,6 +326,9 @@
 	int res = 0;
 	struct ast_frame f = { AST_FRAME_CONTROL, };
 	int isoutbound;
+
+	if (!p)
+		return -1;
 
 	/* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
 	if (condition == AST_CONTROL_HOLD) {
@@ -343,6 +356,9 @@
 	struct ast_frame f = { AST_FRAME_DTMF_BEGIN, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = digit;
@@ -359,6 +375,9 @@
 	struct ast_frame f = { AST_FRAME_DTMF_END, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = digit;
@@ -374,6 +393,9 @@
 	int res = -1;
 	struct ast_frame f = { AST_FRAME_TEXT, };
 	int isoutbound;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -391,6 +413,9 @@
 	struct ast_frame f = { AST_FRAME_HTML, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+	
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = subclass;
@@ -409,6 +434,9 @@
 	int res;
 	struct ast_var_t *varptr = NULL, *new;
 	size_t len, namelen;
+
+	if (!p)
+		return -1;
 	
 	ast_mutex_lock(&p->lock);
 
@@ -449,6 +477,9 @@
 	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
 	struct ast_channel *ochan = NULL;
 	int glaredetect = 0;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);

Modified: team/group/bug7433/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/channels/chan_misdn.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/channels/chan_misdn.c (original)
+++ team/group/bug7433/channels/chan_misdn.c Mon Nov 27 22:43:34 2006
@@ -1046,8 +1046,8 @@
 			print_bc_info(fd, help, bc);
 		} else {
 			if (help->state == MISDN_HOLDED) {
-				chan_misdn_log(0, 0, "ITS A HOLDED BC:\n");
-				chan_misdn_log(0,0," --> l3_id: %x\n"
+				chan_misdn_log(2, 0, "ITS A HOLDED BC:\n");
+				chan_misdn_log(2,0," --> l3_id: %x\n"
 						" --> dad:%s oad:%s\n"
 						" --> hold_port: %d\n"
 						" --> hold_channel: %d\n"
@@ -1445,8 +1445,7 @@
 	
 	int port=bc->port;
 	
-	chan_misdn_log(5,port,"update_config: Getting Config\n");
-
+	chan_misdn_log(7,port,"update_config: Getting Config\n");
 
 	int hdlc=0;
 	misdn_cfg_get( port, MISDN_CFG_HDLC, &hdlc, sizeof(int));
@@ -1912,7 +1911,7 @@
 	
 	chan_misdn_log(1, port, "* CALL: %s\n",dest);
 	
-	chan_misdn_log(1, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
+	chan_misdn_log(2, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
 	
 	chan_misdn_log(3, port, " --> * adding2newbc ext %s\n",ast->exten);
 	if (ast->exten) {
@@ -1968,7 +1967,7 @@
 		return -1;
 	}
 	
-	chan_misdn_log(1, port, " --> * SEND: State Dialing pid:%d\n",newbc?newbc->pid:1);
+	chan_misdn_log(2, port, " --> * SEND: State Dialing pid:%d\n",newbc?newbc->pid:1);
 
 	ast_setstate(ast, AST_STATE_DIALING);
 	ast->hangupcause=16;
@@ -2138,12 +2137,11 @@
 		return -1;
 	}
 	
-	chan_misdn_log(1, p->bc->port, "* IND : Indication [%d] from %s\n",cond, ast->exten);
+	chan_misdn_log(5, p->bc->port, "* IND : Indication [%d] from %s\n",cond, ast->exten);
 	
 	switch (cond) {
 	case AST_CONTROL_BUSY:
-		chan_misdn_log(1, p->bc->port, "* IND :\tbusy\n");
-		chan_misdn_log(1, p->bc->port, " --> * SEND: State Busy pid:%d\n",p->bc?p->bc->pid:-1);
+		chan_misdn_log(1, p->bc->port, "* IND :\tbusy pid:%d\n",p->bc?p->bc->pid:-1);
 		ast_setstate(ast,AST_STATE_BUSY);
 
 		p->bc->out_cause=17;
@@ -2156,41 +2154,42 @@
 		return -1;
 		break;
 	case AST_CONTROL_RING:
-		chan_misdn_log(1, p->bc->port, " --> * IND :\tring pid:%d\n",p->bc?p->bc->pid:-1);
+		chan_misdn_log(1, p->bc->port, "* IND :\tring pid:%d\n",p->bc?p->bc->pid:-1);
 		return -1;
 		break;
 		
 	case AST_CONTROL_RINGING:
+		chan_misdn_log(1, p->bc->port, "* IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
 		switch (p->state) {
 			case MISDN_ALERTING:
-				chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d but I was Ringing before, so ignoreing it\n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(2, p->bc->port, " --> * IND :\tringing pid:%d but I was Ringing before, so ignoreing it\n",p->bc?p->bc->pid:-1);
 				break;
 			case MISDN_CONNECTED:
-				chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d but Connected, so just send TONE_ALERTING without state changes \n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(2, p->bc->port, " --> * IND :\tringing pid:%d but Connected, so just send TONE_ALERTING without state changes \n",p->bc?p->bc->pid:-1);
 				return -1;
 				break;
 			default:
 				p->state=MISDN_ALERTING;
-				chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(2, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
 				misdn_lib_send_event( p->bc, EVENT_ALERTING);
 			
 				if (p->other_ch && p->other_ch->bc) {
 					if (misdn_inband_avail(p->other_ch->bc)) {
-						chan_misdn_log(1,p->bc->port, " --> other End is mISDN and has inband info available\n");
+						chan_misdn_log(2,p->bc->port, " --> other End is mISDN and has inband info available\n");
 						break;
 					}
 
 					if (!p->other_ch->bc->nt) {
-						chan_misdn_log(1,p->bc->port, " --> other End is mISDN TE so it has inband info for sure (?)\n");
+						chan_misdn_log(2,p->bc->port, " --> other End is mISDN TE so it has inband info for sure (?)\n");
 						break;
 					}
 				}
 
-				chan_misdn_log(1, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
+				chan_misdn_log(3, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
 				ast_setstate(ast,AST_STATE_RINGING);
 			
 				if ( !p->bc->nt && (p->orginator==ORG_MISDN) && !p->incoming_early_audio ) 
-					chan_misdn_log(1,p->bc->port, " --> incoming_early_audio off\n");
+					chan_misdn_log(2,p->bc->port, " --> incoming_early_audio off\n");
 				else 
 					return -1;
 		}
@@ -2327,10 +2326,10 @@
 		}
     
 		chan_misdn_log(1, bc->port, "* IND : HANGUP\tpid:%d ctx:%s dad:%s oad:%s State:%s\n",p->bc?p->bc->pid:-1, ast->context, ast->exten, AST_CID_P(ast), misdn_get_ch_state(p));
-		chan_misdn_log(2, bc->port, " --> l3id:%x\n",p->l3id);
-		chan_misdn_log(1, bc->port, " --> cause:%d\n",bc->cause);
-		chan_misdn_log(1, bc->port, " --> out_cause:%d\n",bc->out_cause);
-		chan_misdn_log(1, bc->port, " --> state:%s\n", misdn_get_ch_state(p));
+		chan_misdn_log(3, bc->port, " --> l3id:%x\n",p->l3id);
+		chan_misdn_log(3, bc->port, " --> cause:%d\n",bc->cause);
+		chan_misdn_log(2, bc->port, " --> out_cause:%d\n",bc->out_cause);
+		chan_misdn_log(2, bc->port, " --> state:%s\n", misdn_get_ch_state(p));
 		
 		switch (p->state) {
 		case MISDN_CALLING:
@@ -2415,7 +2414,7 @@
 	}
 	
 
-	chan_misdn_log(1, bc->port, "Channel: %s hanguped new state:%s\n",ast->name,misdn_get_ch_state(p));
+	chan_misdn_log(3, bc->port, " --> Channel: %s hanguped new state:%s\n",ast->name,misdn_get_ch_state(p));
 	
 	return 0;
 }
@@ -2722,9 +2721,9 @@
 			/* got hangup .. */
 
 			if (!f) 
-				chan_misdn_log(1,ch1->bc->port,"Read Null Frame\n");
+				chan_misdn_log(4,ch1->bc->port,"Read Null Frame\n");
 			else
-				chan_misdn_log(1,ch1->bc->port,"Read Frame Controll class:%d\n",f->subclass);
+				chan_misdn_log(4,ch1->bc->port,"Read Frame Controll class:%d\n",f->subclass);
 			
 			*fo=f;
 			*rc=who;
@@ -3303,11 +3302,11 @@
 		return;
 	}
 
-	cb_log(1,port,"hangup_chan\n");
+	cb_log(5,port,"hangup_chan called\n");
 
 	if (ch->need_hangup) 
 	{
-		cb_log(1,port,"-> hangup\n");
+		cb_log(2,port," --> hangup\n");
 		send_cause2ast(ch->ast,ch->bc,ch);
 		ch->need_hangup=0;
 		ch->need_queue_hangup=0;
@@ -3317,7 +3316,7 @@
 	}
 
 	if (!ch->need_queue_hangup) {
-		cb_log(1,port,"No need to queue hangup\n");
+		cb_log(2,port," --> No need to queue hangup\n");
 	}
 
 	ch->need_queue_hangup=0;
@@ -3326,7 +3325,7 @@
 
 		if (ch->ast)
 			ast_queue_hangup(ch->ast);
-		cb_log(1,port,"-> queue_hangup\n");
+		cb_log(2,port," --> queue_hangup\n");
 	} else {
 		cb_log(1,port,"Cannot hangup chan, no ast\n");
 	}
@@ -3346,7 +3345,7 @@
 			ast=ch->ast;
 		} 
 		
-		chan_misdn_log(1, bc->port, "release_chan: bc with l3id: %x\n",bc->l3_id);
+		chan_misdn_log(5, bc->port, "release_chan: bc with l3id: %x\n",bc->l3_id);
 		
 		/*releaseing jitterbuffer*/
 		if (ch->jb ) {
@@ -3542,7 +3541,7 @@
 	tmp=pbx_builtin_getvar_helper(chan,"MISDN_PID");
 	if (tmp) {
 		ch->other_pid=atoi(tmp);
-		chan_misdn_log(1,bc->port,"IMPORT_PID: importing pid:%s\n",tmp);
+		chan_misdn_log(3,bc->port," --> IMPORT_PID: importing pid:%s\n",tmp);
 		if (ch->other_pid >0) {
 			ch->other_ch=find_chan_by_pid(cl_te,ch->other_pid);
 			if (ch->other_ch) ch->other_ch->other_ch=ch;
@@ -3553,7 +3552,7 @@
 void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch)
 {
 	char tmp[32];
-	chan_misdn_log(1,bc->port,"EXPORT_PID: pid:%d\n",bc->pid);
+	chan_misdn_log(3,bc->port," --> EXPORT_PID: pid:%d\n",bc->pid);
 	sprintf(tmp,"%d",bc->pid);
 	pbx_builtin_setvar_helper(chan,"_MISDN_PID",tmp);
 }
@@ -4165,15 +4164,15 @@
 		ast_queue_control(ch->ast, AST_CONTROL_RINGING);
 		ast_setstate(ch->ast, AST_STATE_RINGING);
 		
-		cb_log(1,bc->port,"Set State Ringing\n");
+		cb_log(7,bc->port," --> Set State Ringing\n");
 		
 		if ( misdn_cap_is_speech(bc->capability) && misdn_inband_avail(bc)) {
 			cb_log(1,bc->port,"Starting Tones, we have inband Data\n");
 			start_bc_tones(ch);
 		} else {
-			cb_log(1,bc->port,"We have no inband Data, the other end must create ringing\n");
+			cb_log(3,bc->port," --> We have no inband Data, the other end must create ringing\n");
 			if (ch->far_alerting) {
-				cb_log(1,bc->port,"The other end can not do ringing eh ?.. we must do all ourself..");
+				cb_log(1,bc->port," --> The other end can not do ringing eh ?.. we must do all ourself..");
 				start_bc_tones(ch);
 				/*tone_indicate(ch, TONE_FAR_ALERTING);*/
 			}
@@ -4445,6 +4444,9 @@
 		ch->bc=bc;
 		ch->state = MISDN_CONNECTED;
 
+		ch->hold_info.port=0;
+		ch->hold_info.channel=0;
+		
 		struct ast_channel *hold_ast=AST_BRIDGED_P(ch->ast);
 		
 		if (hold_ast) {

Modified: team/group/bug7433/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/bug7433/channels/chan_sip.c?view=diff&rev=48076&r1=48075&r2=48076
==============================================================================
--- team/group/bug7433/channels/chan_sip.c (original)
+++ team/group/bug7433/channels/chan_sip.c Mon Nov 27 22:43:34 2006
@@ -516,6 +516,7 @@
 static int global_limitonpeers;		/*!< Match call limit on peers only */
 static int global_rtautoclear;
 static int global_notifyringing;	/*!< Send notifications on ringing */
+static int global_notifyhold;		/*!< Send notifications on hold */
 static int global_alwaysauthreject;	/*!< Send 401 Unauthorized for all failing requests */
 static int srvlookup;			/*!< SRV Lookup on or off. Default is off, RFC behavior is on */
 static int pedanticsipchecking;		/*!< Extra checking ?  Default off */
@@ -542,7 +543,7 @@
 static int allow_external_domains;	/*!< Accept calls to external SIP domains? */
 static int global_callevents;		/*!< Whether we send manager events or not */
 static int global_t1min;		/*!< T1 roundtrip time minimum */
-static int global_autoframing;          /*!< ?????????? */
+static int global_autoframing;          /*!< Turn autoframing on or off. */
 static enum transfermodes global_allowtransfer;	/*!< SIP Refer restriction scheme */
 
 /*! \brief Codecs that we support by default: */
@@ -2038,6 +2039,7 @@
 				if (sipdebug && option_debug > 3)
 					ast_log(LOG_DEBUG, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
 				ast_sched_del(sched, cur->retransid);
+				cur->retransid = -1;
 			}
 			free(cur);
 			break;
@@ -2080,8 +2082,8 @@
 				if (option_debug > 3 && sipdebug)
 					ast_log(LOG_DEBUG, "*** SIP TIMER: Cancelling retransmission #%d - %s (got response)\n", cur->retransid, sip_methods[sipmethod].text);
 				ast_sched_del(sched, cur->retransid);
+				cur->retransid = -1;
 			}
-			cur->retransid = -1;
 			res = 0;
 			break;
 		}
@@ -2330,6 +2332,7 @@
 	}
 	if (peer->expire > -1)
 		ast_sched_del(sched, peer->expire);
+
 	if (peer->pokeexpire > -1)
 		ast_sched_del(sched, peer->pokeexpire);
 	register_peer_exten(peer, FALSE);
@@ -3308,7 +3311,7 @@
 					/* Do we need a timer here if we don't hear from them at all? */
 				} else {
 					/* Send a new request: CANCEL */
-					transmit_request_with_auth(p, SIP_CANCEL, p->ocseq, XMIT_RELIABLE, FALSE);
+					transmit_request(p, SIP_CANCEL, p->ocseq, XMIT_RELIABLE, FALSE);
 					/* Actually don't destroy us yet, wait for the 487 on our original 
 					   INVITE, but do set an autodestruct just in case we never get it. */
 					needdestroy = 0;
@@ -3511,6 +3514,11 @@
 	}
 	p = newchan->tech_pvt;
 
+	if (!p) {
+		ast_log(LOG_WARNING, "No pvt after masquerade. Strange things may happen\n");
+		return -1;
+	}
+
 	ast_mutex_lock(&p->lock);
 	append_history(p, "Masq", "Old channel: %s\n", oldchan->name);

[... 1205 lines stripped ...]


More information about the asterisk-commits mailing list