[asterisk-commits] murf: branch murf/fast-ast r42067 - in /team/murf/fast-ast: ./ apps/ cdr/ cha...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Sep 5 14:01:31 MST 2006


Author: murf
Date: Tue Sep  5 16:01:30 2006
New Revision: 42067

URL: http://svn.digium.com/view/asterisk?rev=42067&view=rev
Log:
Merged revisions 41560,41574,41595-41596,41611,41629-41630,41632-41633,41647-41648,41650-41651,41674,41689,41692-41696,41715,41717-41718,41735,41749,41765,41769,41788-41790,41810,41828-41829,41831,41849-41850,41864-41865,41879,41881,41883,41900-41901,41915-41916,41930,41944,41958-41960,41974,41990,42015,42021,42034,42055 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r41560 | oej | 2006-08-31 04:40:24 -0600 (Thu, 31 Aug 2006) | 2 lines

Use GLOBAL() in dialplan examples

................
r41574 | file | 2006-08-31 08:46:46 -0600 (Thu, 31 Aug 2006) | 2 lines

Only write a received packet out if we are actually bridged to something

................
r41595 | file | 2006-08-31 12:21:00 -0600 (Thu, 31 Aug 2006) | 2 lines

Add new frame types for DTMF

................
r41596 | file | 2006-08-31 12:47:51 -0600 (Thu, 31 Aug 2006) | 2 lines

Don't fail the write if they try to write a NULL or IAX frame as we just ignore these.

................
r41611 | file | 2006-08-31 13:03:13 -0600 (Thu, 31 Aug 2006) | 2 lines

Ignore DTMF begin frames in the waitstream core so that we don't get duplicate digits in our extension match

................
r41629 | russell | 2006-08-31 14:39:12 -0600 (Thu, 31 Aug 2006) | 4 lines

there is no need to use iax_frame_free here, as it will actually just end up
having a bunch of erroneous messages about attempting to double free frames
spammed to the console.  Problem reported to me by file ...

................
r41630 | anthonyl | 2006-08-31 14:49:26 -0600 (Thu, 31 Aug 2006) | 1 line

fix for bugid: 0007830
................
r41632 | file | 2006-08-31 15:00:16 -0600 (Thu, 31 Aug 2006) | 2 lines

Tweak the DTMF muting stuff a bit to take into account VLDTMF and compensation.

................
r41633 | mogorman | 2006-08-31 15:00:20 -0600 (Thu, 31 Aug 2006) | 5 lines

everything that loads a config that needs a config file to run
now reports AST_MODULE_LOAD_DECLINE when loading if config file
is not there, also fixed an error in res_config_pgsql where it 
had a non static function when it should.

................
r41647 | anthonyl | 2006-08-31 15:06:07 -0600 (Thu, 31 Aug 2006) | 1 line

small typo
................
r41648 | anthonyl | 2006-08-31 15:12:26 -0600 (Thu, 31 Aug 2006) | 1 line

spacing update
................
r41650 | russell | 2006-08-31 15:50:07 -0600 (Thu, 31 Aug 2006) | 2 lines

there is no need for __iax_frame_free ...

................
r41651 | russell | 2006-08-31 15:50:55 -0600 (Thu, 31 Aug 2006) | 2 lines

fix some breakage, MOG DID IT!!!

................
r41674 | murf | 2006-09-01 09:57:05 -0600 (Fri, 01 Sep 2006) | 4 lines

This small tweek will hopefully fix 7859, and silence all possible others
along that line.


................
r41689 | file | 2006-09-01 10:19:03 -0600 (Fri, 01 Sep 2006) | 2 lines

If no number is specified in the SIP_HEADER dialplan function, then just use the first one. (issue #7854 reported by sxpert and issue #7863 reported by hristo)

................
r41692 | murf | 2006-09-01 10:33:22 -0600 (Fri, 01 Sep 2006) | 3 lines

PCadach wanted better formatting of those 'if' conditions for 7859.


................
r41693 | file | 2006-09-01 10:34:57 -0600 (Fri, 01 Sep 2006) | 10 lines

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

........
r41690 | file | 2006-09-01 12:28:08 -0400 (Fri, 01 Sep 2006) | 2 lines

Don't treat an unexpected control subclass as voice (issue #7858 reported by PCadach)

........

................
r41694 | file | 2006-09-01 10:40:18 -0600 (Fri, 01 Sep 2006) | 2 lines

0 is indeed considered a valid file descriptor (issue #7861 reported by PCadach)

................
r41695 | murf | 2006-09-01 10:48:06 -0600 (Fri, 01 Sep 2006) | 3 lines

Another formatting update for PCadach.


................
r41696 | file | 2006-09-01 10:50:02 -0600 (Fri, 01 Sep 2006) | 2 lines

You see nothing...

................
r41715 | mogorman | 2006-09-01 11:20:48 -0600 (Fri, 01 Sep 2006) | 2 lines

whitespace clean up

................
r41717 | kpfleming | 2006-09-01 11:41:52 -0600 (Fri, 01 Sep 2006) | 2 lines

block this rev... fix is already present in this branch

................
r41718 | file | 2006-09-01 11:54:22 -0600 (Fri, 01 Sep 2006) | 2 lines

If we are doing video and we can't reinvite, then resort to generic bridging instead of Packet2Packet since video isn't supported there yet. (reported by PCadach in #asterisk-bugs)

................
r41735 | file | 2006-09-01 12:57:10 -0600 (Fri, 01 Sep 2006) | 2 lines

Unbridge the RTP streams at the correct place

................
r41749 | mogorman | 2006-09-01 13:23:07 -0600 (Fri, 01 Sep 2006) | 2 lines

more staticness, and syntax cleaning

................
r41765 | mogorman | 2006-09-01 16:03:33 -0600 (Fri, 01 Sep 2006) | 2 lines

get rid of some useless debug messages and raise debug level of others

................
r41769 | file | 2006-09-01 16:51:46 -0600 (Fri, 01 Sep 2006) | 10 lines

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

........
r41768 | file | 2006-09-01 18:49:07 -0400 (Fri, 01 Sep 2006) | 2 lines

Only wipe the redirected audio & video IP/port if it's specified, and trigger a reinvite.

........

................
r41788 | qwell | 2006-09-01 19:39:15 -0600 (Fri, 01 Sep 2006) | 4 lines

Fix VLDTMF issues.

It still isn't variable length, but it does let you dial again.

................
r41789 | qwell | 2006-09-01 19:39:42 -0600 (Fri, 01 Sep 2006) | 2 lines

fix some module loader breakage

................
r41790 | qwell | 2006-09-01 19:44:50 -0600 (Fri, 01 Sep 2006) | 4 lines

It was pointed out to me, that using two frames is silly.

Thanks Josh.

................
r41810 | bweschke | 2006-09-02 12:36:53 -0600 (Sat, 02 Sep 2006) | 3 lines

 With the somewhat recent addition (from one of the Astridevcon Europe sessions) of more detailed device states, we need to change strategy in app_queue in how we determine whether a queue member is "in use" or not. Basically, instead of specifically looking for that device state as we did previously, now we're going to observe any other device state aside from the two that we know for sure are "not in use" as "in use". This will cause some other states to fall through that we know will never be available (eg - "INVALID","UNAVAILABLE",etc) but there's other code already within to handle those conditions. (#7433 - tgrman reporting)


................
r41828 | bweschke | 2006-09-03 08:26:44 -0600 (Sun, 03 Sep 2006) | 3 lines

 Block 30546 from coming into /trunk. Some old cleanup.


................
r41829 | bweschke | 2006-09-03 08:28:25 -0600 (Sun, 03 Sep 2006) | 11 lines

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

........
r41827 | bweschke | 2006-09-03 10:16:08 -0400 (Sun, 03 Sep 2006) | 3 lines

 Setting a retry of 0 is generally not a good idea and shouldn't be allowed. (#7574 - reported by regin)


........

................
r41831 | bweschke | 2006-09-03 08:54:02 -0600 (Sun, 03 Sep 2006) | 3 lines

 r41830 isn't going to merge cleanly into /trunk so it is blocked.


................
r41849 | russell | 2006-09-03 09:04:26 -0600 (Sun, 03 Sep 2006) | 2 lines

remove leading space in Packet manager event header

................
r41850 | bweschke | 2006-09-03 09:21:12 -0600 (Sun, 03 Sep 2006) | 3 lines

 We don't spy on Zap/psuedo channels. Not at all. Never. (#7871 - sxpert reporting)


................
r41864 | russell | 2006-09-03 10:41:02 -0600 (Sun, 03 Sep 2006) | 6 lines

Don't use ast_frdup() in the AST_LIST_INSERT_TAIL macro directly.  That was a
very stupid thing to do.  It ends up duplicating the frame twice, linking in
one of them and setting the tail pointer to the other one.  Sorry ...

Thanks to file for pointing out the breakage!!!  file rocks.

................
r41865 | file | 2006-09-03 10:44:49 -0600 (Sun, 03 Sep 2006) | 2 lines

Tweak the if statement a bit

................
r41879 | bweschke | 2006-09-03 11:12:30 -0600 (Sun, 03 Sep 2006) | 3 lines

 Don't keep trying the same member in certain strategies when members of the queue are unavailable (#7278 - diLLec reported and patched)


................
r41881 | bweschke | 2006-09-03 11:15:07 -0600 (Sun, 03 Sep 2006) | 3 lines

 Blocking 41880 from coming into /trunk since I already patched it in /trunk first. Ooops!


................
r41883 | bweschke | 2006-09-03 11:40:08 -0600 (Sun, 03 Sep 2006) | 11 lines

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

........
r41882 | bweschke | 2006-09-03 13:38:22 -0400 (Sun, 03 Sep 2006) | 3 lines

 Make sure the forwarded channel inherits variables appropriately when we receive a call forward in the queue. (#7867 - raarts reported and patched)


........

................
r41900 | bweschke | 2006-09-03 13:07:58 -0600 (Sun, 03 Sep 2006) | 3 lines

 Some changes/fixes for func_curl. curl_global_init is only supposed to be called once, and if it returns non-zero, we need to give up on further executions with that instance. Additionally, let's set absolute timeout values for the CURL connections to try and prevent possible Zap (and possibly other channel tech) channel lockouts.


................
r41901 | bweschke | 2006-09-03 13:32:51 -0600 (Sun, 03 Sep 2006) | 3 lines

 This was added to app_dial a while back, and now it's in app_queue as well. Provide an option to prevent members of the queue from forwarding calls from the queue to somewhere else. 


................
r41915 | bweschke | 2006-09-03 14:23:41 -0600 (Sun, 03 Sep 2006) | 5 lines

 Changes/fixes to the app_waitforsilence app to make it behave more the way the author originally intended for it 
 to function along with an option to keep backward compatible with "old-style" functionality in 1.2. 
 (#6595 - davetroy reported and patched w/some very minor mods/corrections)


................
r41916 | bweschke | 2006-09-03 14:44:14 -0600 (Sun, 03 Sep 2006) | 3 lines

 Fix enum indexing problem with m() in WaitExten. Reported by Pavel J, in asterisk-dev.


................
r41930 | bweschke | 2006-09-03 15:26:04 -0600 (Sun, 03 Sep 2006) | 3 lines

 Provide a little more protection to make sure that a MOH class is specified when using the 'm' option with WaitExten, and prevent a segfault in the process.


................
r41944 | russell | 2006-09-03 16:56:01 -0600 (Sun, 03 Sep 2006) | 9 lines

when calling this function to append to a dynamic string and the buffer was not
large enough and had to be reallocated, cut off the partially appended data.
Otherwise, the function will get called over and over again appending to the
end every time and never thinking it has enough room.

Thanks to jmls for access to his machine for debugging!

(issue #7691)

................
r41958 | russell | 2006-09-03 17:14:54 -0600 (Sun, 03 Sep 2006) | 4 lines

Add the ability to specify that a frame should not be considered for caching
for uses in cases where you *know* that it will do no good.  This patch was
inspired by file for use in some work of his on mixmonitor/chanspy.

................
r41959 | file | 2006-09-03 17:30:37 -0600 (Sun, 03 Sep 2006) | 2 lines

Make the difference clear about what the responsibilities of the core and a spy are when it comes to spying on a channel. The core is responsible for adding a spy to a channel, feeding frames into the spy, removing the spy from the channel, and notifying the spy that is has been detached. The spy is responsible for reading frames in, and cleaning itself up. Each side will not try to do the other's job.

................
r41960 | file | 2006-09-03 17:45:03 -0600 (Sun, 03 Sep 2006) | 2 lines

Use tabs instead of spaces (I <3 tabs -- this is for you Qwell)

................
r41974 | file | 2006-09-03 21:18:12 -0600 (Sun, 03 Sep 2006) | 2 lines

Remove old unused functions

................
r41990 | oej | 2006-09-04 09:57:26 -0600 (Mon, 04 Sep 2006) | 2 lines

Make sure we handle CANCEL/ACK properly (imported with mods from 1.2)

................
r42015 | qwell | 2006-09-05 10:38:22 -0600 (Tue, 05 Sep 2006) | 12 lines

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

........
r42014 | qwell | 2006-09-05 09:27:46 -0700 (Tue, 05 Sep 2006) | 4 lines

Small typo in zapata.conf.sample

Reported by ppyy in 7881

........

................
r42021 | file | 2006-09-05 11:01:02 -0600 (Tue, 05 Sep 2006) | 2 lines

Minor tweak - we need to lock the channel when we are removing the spy from it.

................
r42034 | tilghman | 2006-09-05 11:23:50 -0600 (Tue, 05 Sep 2006) | 2 lines

Missing field terminator

................
r42055 | file | 2006-09-05 14:03:53 -0600 (Tue, 05 Sep 2006) | 9 lines

Blocked revisions 42054 via svnmerge

........
r42054 | file | 2006-09-05 16:02:48 -0400 (Tue, 05 Sep 2006) | 2 lines

Merge in last round of spy fixes. This should hopefully eliminate all the issues people have been seeing by distinctly separating what each component (core/spy) is responsible for. Core is responsible for adding a spy to a channel, feeding frames to the spy, removing the spy from a channel, and telling the spy to stop. Spy is responsible for reading frames in, and cleaning up after itself.

........

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

Modified:
    team/murf/fast-ast/   (props changed)
    team/murf/fast-ast/UPGRADE.txt
    team/murf/fast-ast/apps/app_alarmreceiver.c
    team/murf/fast-ast/apps/app_chanspy.c
    team/murf/fast-ast/apps/app_festival.c
    team/murf/fast-ast/apps/app_followme.c
    team/murf/fast-ast/apps/app_mixmonitor.c
    team/murf/fast-ast/apps/app_osplookup.c
    team/murf/fast-ast/apps/app_queue.c
    team/murf/fast-ast/apps/app_record.c
    team/murf/fast-ast/apps/app_rpt.c
    team/murf/fast-ast/apps/app_voicemail.c
    team/murf/fast-ast/apps/app_waitforsilence.c
    team/murf/fast-ast/cdr/cdr_csv.c
    team/murf/fast-ast/cdr/cdr_custom.c
    team/murf/fast-ast/cdr/cdr_manager.c
    team/murf/fast-ast/cdr/cdr_odbc.c
    team/murf/fast-ast/cdr/cdr_pgsql.c
    team/murf/fast-ast/cdr/cdr_radius.c
    team/murf/fast-ast/cdr/cdr_tds.c
    team/murf/fast-ast/channels/chan_agent.c
    team/murf/fast-ast/channels/chan_h323.c
    team/murf/fast-ast/channels/chan_iax2.c
    team/murf/fast-ast/channels/chan_jingle.c
    team/murf/fast-ast/channels/chan_mgcp.c
    team/murf/fast-ast/channels/chan_misdn.c
    team/murf/fast-ast/channels/chan_oss.c
    team/murf/fast-ast/channels/chan_phone.c
    team/murf/fast-ast/channels/chan_sip.c
    team/murf/fast-ast/channels/chan_skinny.c
    team/murf/fast-ast/channels/chan_vpb.cc
    team/murf/fast-ast/channels/chan_zap.c
    team/murf/fast-ast/channels/iax2-parser.c
    team/murf/fast-ast/configs/extensions.ael.sample
    team/murf/fast-ast/configs/extensions.conf.sample
    team/murf/fast-ast/configs/zapata.conf.sample
    team/murf/fast-ast/funcs/func_curl.c
    team/murf/fast-ast/funcs/func_odbc.c
    team/murf/fast-ast/include/asterisk/chanspy.h
    team/murf/fast-ast/include/asterisk/frame.h
    team/murf/fast-ast/main/channel.c
    team/murf/fast-ast/main/file.c
    team/murf/fast-ast/main/frame.c
    team/murf/fast-ast/main/pbx.c
    team/murf/fast-ast/main/rtp.c
    team/murf/fast-ast/main/utils.c
    team/murf/fast-ast/pbx/pbx_config.c
    team/murf/fast-ast/pbx/pbx_dundi.c
    team/murf/fast-ast/res/res_config_pgsql.c
    team/murf/fast-ast/res/res_features.c
    team/murf/fast-ast/res/res_indications.c
    team/murf/fast-ast/res/res_jabber.c
    team/murf/fast-ast/res/res_odbc.c
    team/murf/fast-ast/res/res_smdi.c
    team/murf/fast-ast/res/res_snmp.c

Propchange: team/murf/fast-ast/
------------------------------------------------------------------------------
    automerge = on

Propchange: team/murf/fast-ast/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/murf/fast-ast/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/murf/fast-ast/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Sep  5 16:01:30 2006
@@ -1,1 +1,1 @@
-/trunk:1-41559
+/trunk:1-42057

Modified: team/murf/fast-ast/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/UPGRADE.txt?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/UPGRADE.txt (original)
+++ team/murf/fast-ast/UPGRADE.txt Tue Sep  5 16:01:30 2006
@@ -216,6 +216,12 @@
   previously used only by EXTENDED_ODBC_STORAGE. This means that you will need to update
   your table format using the schema provided in doc/odbcstorage.txt
 
+* app_waitforsilence: Fixes have been made to this application which changes the 
+  default behavior with how quickly it returns. You can maintain "old-style" behavior
+  with the addition/use of a third "timeout" parameter.
+  Please consult the application documentation and make changes to your dialplan 
+  if appropriate.
+
 Manager:
 
 * After executing the 'status' manager action, the "Status" manager events

Modified: team/murf/fast-ast/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_alarmreceiver.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_alarmreceiver.c (original)
+++ team/murf/fast-ast/apps/app_alarmreceiver.c Tue Sep  5 16:01:30 2006
@@ -743,6 +743,7 @@
 	
 		if(option_verbose >= 4)
 			ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: No config file\n");
+		return 0;
 	}
 	else{
 
@@ -809,7 +810,7 @@
 		}
 		ast_config_destroy(cfg);
 	}
-	return 0;
+	return 1;
 
 }
 
@@ -831,8 +832,10 @@
 
 static int load_module(void)
 {
-	load_config();
-	return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
+	if(load_config())
+		return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
+	else
+		return AST_MODULE_LOAD_DECLINE;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Alarm Receiver for Asterisk");

Modified: team/murf/fast-ast/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_chanspy.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_chanspy.c (original)
+++ team/murf/fast-ast/apps/app_chanspy.c Tue Sep  5 16:01:30 2006
@@ -211,21 +211,6 @@
 	return res;
 }
 
-static void stop_spying(struct ast_channel_spy *spy) 
-{
-	/* If our status has changed to DONE, then the channel we're spying on is gone....
-	   DON'T TOUCH IT!!!  RUN AWAY!!! */
-	if (spy->status == CHANSPY_DONE)
-		return;
-
-	if (!spy->chan)
-		return;
-
-	ast_channel_lock(spy->chan);
-	ast_channel_spy_remove(spy->chan, spy);
-	ast_channel_unlock(spy->chan);
-};
-
 /* Map 'volume' levels from -4 through +4 into
    decibel (dB) settings for channel drivers
 */
@@ -327,10 +312,11 @@
 	*/
 	while ((res = ast_waitfor(chan, -1) > -1) &&
 	       csth.spy.status == CHANSPY_RUNNING &&
-	       !ast_check_hangup(chan) &&
 	       csth.spy.chan) {
-		if (!(f = ast_read(chan)))
+		if (!(f = ast_read(chan)) || ast_check_hangup(chan)) {
+			running = -1;
 			break;
+		}
 
 		if (ast_test_flag(flags, OPTION_WHISPER) &&
 		    (f->frametype == AST_FRAME_VOICE)) {
@@ -381,13 +367,18 @@
 	else
 		ast_deactivate_generator(chan);
 
-	stop_spying(&csth.spy);
+	/* If a channel still exists on our spy structure then we need to remove ourselves */
+	if (csth.spy.chan) {
+		csth.spy.status = CHANSPY_DONE;
+		ast_channel_lock(csth.spy.chan);
+		ast_channel_spy_remove(csth.spy.chan, &csth.spy);
+		ast_channel_unlock(csth.spy.chan);
+	}
+	ast_channel_spy_free(&csth.spy);
 	
 	if (option_verbose >= 2)
 		ast_verbose(VERBOSE_PREFIX_2 "Done Spying on channel %s\n", name);
 	
-	ast_mutex_destroy(&csth.spy.lock);
-
 	return running;
 }
 
@@ -396,6 +387,7 @@
 {
 	struct ast_channel *this;
 
+	redo:
 	if (spec)
 		this = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
 	else if (exten)
@@ -403,8 +395,11 @@
 	else
 		this = ast_channel_walk_locked(last);
 
-	if (this)
+	if (this) {
 		ast_channel_unlock(this);
+		if (!strncmp(this->name, "Zap/pseudo", 10))
+			goto redo;
+	}
 
 	return this;
 }
@@ -528,6 +523,8 @@
 				peer = NULL;
 			}
 		}
+		if (res == -1)
+			break;
 	}
 	
 	ast_clear_flag(chan, AST_FLAG_SPYING);

Modified: team/murf/fast-ast/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_festival.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_festival.c (original)
+++ team/murf/fast-ast/apps/app_festival.c Tue Sep  5 16:01:30 2006
@@ -533,6 +533,12 @@
 
 static int load_module(void)
 {
+	struct ast_config *cfg = ast_config_load(FESTIVAL_CONFIG);
+	if (!cfg) {
+		ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG);
+		return AST_MODULE_LOAD_DECLINE;
+	}
+	ast_config_destroy(cfg);
 	return ast_register_application(app, festival_exec, synopsis, descrip);
 }
 

Modified: team/murf/fast-ast/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_followme.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_followme.c (original)
+++ team/murf/fast-ast/apps/app_followme.c Tue Sep  5 16:01:30 2006
@@ -1098,7 +1098,8 @@
 
 static int load_module(void)
 {
-	reload_followme();
+	if(!reload_followme())
+		return AST_MODULE_LOAD_DECLINE;
 
 	return ast_register_application(app, app_exec, synopsis, descrip);
 }

Modified: team/murf/fast-ast/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_mixmonitor.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_mixmonitor.c (original)
+++ team/murf/fast-ast/apps/app_mixmonitor.c Tue Sep  5 16:01:30 2006
@@ -122,23 +122,6 @@
 	AST_APP_OPTION_ARG('W', MUXFLAG_VOLUME, OPT_ARG_VOLUME),
 });
 
-static void stopmon(struct ast_channel_spy *spy) 
-{
-	struct ast_channel *chan = spy->chan;
-
-	/* If our status has changed to DONE, then the channel we're spying on is gone....
-	   DON'T TOUCH IT!!!  RUN AWAY!!! */
-	if (spy->status == CHANSPY_DONE)
-		return;
-  
-	if (!chan)
-		return;
-
-	ast_channel_lock(chan);
-	ast_channel_spy_remove(chan, spy);
-	ast_channel_unlock(chan);
-}
-
 static int startmon(struct ast_channel *chan, struct ast_channel_spy *spy) 
 {
 	struct ast_channel *peer;
@@ -176,9 +159,8 @@
 
 		ast_channel_spy_trigger_wait(&mixmonitor->spy);
 		
-		if (!mixmonitor->spy.chan || mixmonitor->spy.status != CHANSPY_RUNNING) {
+		if (!mixmonitor->spy.chan || mixmonitor->spy.status != CHANSPY_RUNNING)
 			break;
-		}
 		
 		while (1) {
 			if (!(f = ast_channel_spy_read_frame(&mixmonitor->spy, SAMPLES_PER_FRAME)))
@@ -194,15 +176,15 @@
 				next = AST_LIST_NEXT(f, frame_list);
 				if (write)
 					ast_writestream(mixmonitor->fs, f);
-				ast_frfree(f);
+				ast_frame_free(f, 0);
 			}
 		}
 	}
 
 	ast_mutex_unlock(&mixmonitor->spy.lock);
-	
-	stopmon(&mixmonitor->spy);
-
+
+	ast_channel_spy_free(&mixmonitor->spy);
+	
 	if (option_verbose > 1)
 		ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", mixmonitor->name);
 
@@ -211,8 +193,6 @@
 			ast_verbose(VERBOSE_PREFIX_2 "Executing [%s]\n", mixmonitor->post_process);
 		ast_safe_system(mixmonitor->post_process);
 	}
-
-	ast_mutex_destroy(&mixmonitor->spy.lock);
 		
 	ast_closestream(mixmonitor->fs);
 

Modified: team/murf/fast-ast/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_osplookup.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_osplookup.c (original)
+++ team/murf/fast-ast/apps/app_osplookup.c Tue Sep  5 16:01:30 2006
@@ -1431,10 +1431,11 @@
 		ast_config_destroy(cfg);
 	} else {
 		ast_log(LOG_WARNING, "OSP: Unable to find configuration. OSP support disabled\n");
+		return 0;
 	}
 	ast_log(LOG_DEBUG, "OSP: osp_initialized '%d'\n", osp_initialized);
 
-	return 0;
+	return 1;
 }
 
 static int osp_unload(void)
@@ -1606,7 +1607,9 @@
 {
 	int res;
 	
-	osp_load();
+	if(!osp_load())
+		return AST_MODULE_LOAD_DECLINE;
+
 	res = ast_cli_register(&osp_cli);
 	res |= ast_register_application(app1, ospauth_exec, synopsis1, descrip1);
 	res |= ast_register_application(app2, osplookup_exec, synopsis2, descrip2);

Modified: team/murf/fast-ast/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_queue.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_queue.c (original)
+++ team/murf/fast-ast/apps/app_queue.c Tue Sep  5 16:01:30 2006
@@ -139,6 +139,8 @@
 "      'H' -- allow caller to hang up by hitting *.\n"
 "      'n' -- no retries on the timeout; will exit this application and \n"
 "             go to the next step.\n"
+"      'i' -- ignore call forward requests from queue members and do nothing\n"
+"             when they are requested.\n"
 "      'r' -- ring instead of playing MOH\n"
 "      't' -- allow the called user transfer the calling user\n"
 "      'T' -- to allow the calling user to transfer the call.\n"
@@ -839,7 +841,7 @@
 		q->periodicannouncefrequency = atoi(val);
 	} else if (!strcasecmp(param, "retry")) {
 		q->retry = atoi(val);
-		if (q->retry < 0)
+		if (q->retry <= 0)
 			q->retry = DEFAULT_RETRY;
 	} else if (!strcasecmp(param, "wrapuptime")) {
 		q->wrapuptime = atoi(val);
@@ -1561,7 +1563,7 @@
 		return 0;
 	}
 
-	if (!qe->parent->ringinuse && (tmp->member->status == AST_DEVICE_INUSE)) {
+	if (!qe->parent->ringinuse && (tmp->member->status != AST_DEVICE_NOT_INUSE) && (tmp->member->status != AST_DEVICE_UNKNOWN)) {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "%s in use, can't receive call\n", tmp->interface);
 		if (qe->chan->cdr)
@@ -1600,6 +1602,11 @@
 			ast_cdr_busy(qe->chan->cdr);
 		tmp->stillgoing = 0;
 		update_dial_status(qe->parent, tmp->member, status);
+
+		ast_mutex_lock(&qe->parent->lock);
+		qe->parent->rrpos++;
+		ast_mutex_unlock(&qe->parent->lock);
+
 		(*busies)++;
 		return 0;
 	} else if (status != tmp->oldstatus)
@@ -1826,7 +1833,7 @@
 
 #define AST_MAX_WATCHERS 256
 
-static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect)
+static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed)
 {
 	char *queue = qe->parent->name;
 	struct callattempt *o;
@@ -1887,8 +1894,12 @@
 					peer = o;
 				}
 			} else if (o->chan && (o->chan == winner)) {
-				ast_copy_string(on, o->member->interface, sizeof(on));
-				if (!ast_strlen_zero(o->chan->call_forward)) {
+				if (!ast_strlen_zero(o->chan->call_forward) && !forwardsallowed) {
+					ast_copy_string(on, o->member->interface, sizeof(on));
+					if (option_verbose > 2)
+						ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s' prevented.\n", in->name, o->chan->call_forward);
+                                        winner = o->chan = NULL;
+				} else if (!ast_strlen_zero(o->chan->call_forward)) {
 					char tmpchan[256];
 					char *stuff;
 					char *tech;
@@ -1914,6 +1925,7 @@
 						o->stillgoing = 0;
 						numnochan++;
 					} else {
+						ast_channel_inherit_variables(in, o->chan);
 						if (o->chan->cid.cid_num)
 							free(o->chan->cid.cid_num);
 						o->chan->cid.cid_num = ast_strdup(in->cid.cid_num);
@@ -2280,6 +2292,7 @@
 	struct ast_app *mixmonapp = NULL;
 	char *p;
 	char vars[2048];
+	int forwardsallowed = 1;
 
 	memset(&bridge_config, 0, sizeof(bridge_config));
 	time(&now);
@@ -2311,6 +2324,9 @@
 			if ((now - qe->start >= qe->parent->timeout))
 				*go_on = 1;
 			break;
+		case 'i':
+			forwardsallowed = 0;
+			break;
 		}
 
 	/* Hold the lock while we setup the outgoing calls */
@@ -2364,7 +2380,7 @@
 	ast_mutex_unlock(&qe->parent->lock);
 	if (use_weight)
 		AST_LIST_UNLOCK(&queues);
-	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT));
+	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed);
 	ast_mutex_lock(&qe->parent->lock);
 	if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
 		store_next(qe, outgoing);
@@ -3642,7 +3658,7 @@
 	.read = queue_function_queuememberlist,
 };
 
-static void reload_queues(void)
+static int reload_queues(void)
 {
 	struct call_queue *q;
 	struct ast_config *cfg;
@@ -3656,7 +3672,7 @@
 	
 	if (!(cfg = ast_config_load("queues.conf"))) {
 		ast_log(LOG_NOTICE, "No call queueing config file (queues.conf), so no call queues\n");
-		return;
+		return 0;
 	}
 	memset(interface, 0, sizeof(interface));
 	AST_LIST_LOCK(&queues);
@@ -3794,6 +3810,7 @@
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
 	AST_LIST_UNLOCK(&queues);
+	return 1;
 }
 
 static int __queues_show(struct mansession *s, int manager, int fd, int argc, char **argv, int queue_show)
@@ -4359,7 +4376,10 @@
 static int load_module(void)
 {
 	int res;
-	
+	if(!reload_queues())
+		return AST_MODULE_LOAD_DECLINE;
+	if (queue_persistent_members)
+		reload_queue_members();
 	res = ast_register_application(app, queue_exec, synopsis, descrip);
 	res |= ast_cli_register(&cli_show_queue);
 	res |= ast_cli_register(&cli_show_queues);
@@ -4381,12 +4401,6 @@
 	res |= ast_custom_function_register(&queuewaitingcount_function);
 	res |= ast_devstate_add(statechange_queue, NULL);
 
-	if (!res) {	
-		reload_queues();
-		if (queue_persistent_members)
-			reload_queue_members();
-	}
-
 	return res;
 }
 

Modified: team/murf/fast-ast/apps/app_record.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_record.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_record.c (original)
+++ team/murf/fast-ast/apps/app_record.c Tue Sep  5 16:01:30 2006
@@ -302,6 +302,11 @@
 			}
 		} else if ((f->frametype == AST_FRAME_DTMF) &&
 		    (f->subclass == terminator)) {
+			 res = ast_writestream(s,f);
+			 
+		         if (res) {
+			 	ast_log(LOG_WARNING,"Problem writing final record frame\n");
+			 }		 
 			ast_frfree(f);
 			break;
 		}

Modified: team/murf/fast-ast/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_rpt.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_rpt.c (original)
+++ team/murf/fast-ast/apps/app_rpt.c Tue Sep  5 16:01:30 2006
@@ -7150,7 +7150,7 @@
 }
 
 	
-static void *rpt_master(void *ignore)
+static void *rpt_master(void *config)
 {
 int	i,n;
 pthread_attr_t attr;
@@ -7160,7 +7160,7 @@
 	/* go thru all the specified repeaters */
 	this = NULL;
 	n = 0;
-	rpt_vars[n].cfg = ast_config_load("rpt.conf");
+	rpt_vars[n].cfg = config;
 	cfg = rpt_vars[n].cfg;
 	if (!cfg) {
 		ast_log(LOG_NOTICE, "Unable to open radio repeater configuration rpt.conf.  Radio Repeater disabled.\n");
@@ -8030,7 +8030,12 @@
 
 static int load_module(void)
 {
-	ast_pthread_create(&rpt_master_thread,NULL,rpt_master,NULL);
+	struct ast_config *cfg = ast_config_load("rpt.conf");
+	if (!cfg) {
+		ast_log(LOG_WARNING, "No such configuration file rpt.conf\n");
+		return AST_MODULE_LOAD_DECLINE;
+	}
+	ast_pthread_create(&rpt_master_thread,NULL,rpt_master,cfg);
 
 	/* Register cli extensions */
 	ast_cli_register(&cli_debug);

Modified: team/murf/fast-ast/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast/apps/app_voicemail.c?rev=42067&r1=42066&r2=42067&view=diff
==============================================================================
--- team/murf/fast-ast/apps/app_voicemail.c (original)
+++ team/murf/fast-ast/apps/app_voicemail.c Tue Sep  5 16:01:30 2006
@@ -89,10 +89,10 @@
 #endif
 
 #ifdef IMAP_STORAGE
-char *curhst = NIL;           /* currently connected host */
-char *curusr = NIL;           /* current login user */
-
-char temp[1024];
+static char *curhst = NIL;	/* currently connected host */
+static char *curusr = NIL;	/* current login user */
+
+static char temp[1024];
 
 static char imapserver[48];
 static char imapport[8];
@@ -104,10 +104,10 @@
 
 struct vm_state;
 
-int init_mailstream (struct vm_state *vms);
-void write_file (char *filename, char *buffer, unsigned long len);
-void status (MAILSTREAM *stream);
-void display_body (BODY *body, char *pfx, long i);
+static int init_mailstream (struct vm_state *vms);
+static void write_file (char *filename, char *buffer, unsigned long len);
+static void status (MAILSTREAM *stream);
+static void display_body (BODY *body, char *pfx, long i);
 static char *get_header_by_tag(char *header, char *tag);
 static void vm_imap_delete(int msgnum, struct vm_state *vms);
 static char *get_user_by_mailbox(char *mailbox);
@@ -122,12 +122,12 @@
 static int save_body(BODY *body, struct vm_state *vms, char *section, char *format);
 static int make_gsm_file(char *dest, char *imapuser, char *dir, int num);
 static void get_mailbox_delimiter(MAILSTREAM *stream);
-void mm_parsequota (MAILSTREAM *stream, unsigned char *msg, QUOTALIST *pquota);
+static void mm_parsequota (MAILSTREAM *stream, unsigned char *msg, QUOTALIST *pquota);
 /* should define TMP in config file... */
 #define TMP "/tmp"
 struct vmstate {
-      struct vm_state *vms;
-      struct vmstate *next;
+	struct vm_state *vms;
+	struct vmstate *next;
 };
 AST_MUTEX_DEFINE_STATIC(vmstate_lock);
 static struct vmstate *vmstates = NULL;
@@ -309,7 +309,7 @@
 	int saydurationm;
 	int maxmsg;                      /*!< Maximum number of msgs per folder for this mailbox */
 #ifdef IMAP_STORAGE
-		char imapuser[80];	/* IMAP server login */
+	char imapuser[80];	/* IMAP server login */
 #endif
 	double volgain;		/*!< Volume gain for voicemails sent via email */
 	AST_LIST_ENTRY(ast_vm_user) list;
@@ -908,10 +908,11 @@
 		ast_log(LOG_WARNING, "msgnum %d, mailbox message %lu is zero.\n",msgnum,messageNum);
 		return;
 	}
-	ast_log(LOG_DEBUG, "deleting msgnum %d, which is mailbox message %lu\n",msgnum,messageNum);
+	if(option_debug > 2)
+		ast_log(LOG_DEBUG, "deleting msgnum %d, which is mailbox message %lu\n",msgnum,messageNum);
 	/* delete message */
-        sprintf (arg,"%lu",messageNum);
-        mail_setflag (vms->mailstream,arg,"\\DELETED");
+	sprintf (arg,"%lu",messageNum);
+	mail_setflag (vms->mailstream,arg,"\\DELETED");
 }
 
 #endif
@@ -1990,16 +1991,14 @@
 			base_encode(fname, p);
 #ifdef IMAP_STORAGE
 			/* only attach if necessary */
-			ast_log(LOG_DEBUG, "Before second attachment with format set to:%s\n",format);
 			if (strcmp(format, "gsm")) {
-			   fprintf(p, "--%s\n", bound);
-			   fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\n", msgnum, format);
-			   fprintf(p, "Content-Transfer-Encoding: base64\n");
-			   fprintf(p, "Content-Description: Voicemail sound attachment.\n");
-			   fprintf(p, "Content-Disposition: attachment; filename=\"msg%04d.gsm\"\n\n", msgnum);
-
-			   snprintf(fname, sizeof(fname), "%s.gsm", attach);
-			   base_encode(fname, p);
+				fprintf(p, "--%s\n", bound);
+				fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\n", msgnum, format);
+				fprintf(p, "Content-Transfer-Encoding: base64\n");
+				fprintf(p, "Content-Description: Voicemail sound attachment.\n");
+				fprintf(p, "Content-Disposition: attachment; filename=\"msg%04d.gsm\"\n\n", msgnum);
+				snprintf(fname, sizeof(fname), "%s.gsm", attach);
+				base_encode(fname, p);
 			}
 #endif
 			fprintf(p, "\n\n--%s--\n.\n", bound);
@@ -2151,13 +2150,13 @@
 	static const char *msgs[] = {
 		"INBOX",
 		"Old",
-		"Work",   
+		"Work",
 		"Family",
 		"Friends",
 		"Cust1",
 		"Cust2",
 		"Cust3",
-		"Cust4",  
+		"Cust4",
 		"Cust5",
 	};
 	return (id >= 0 && id < (sizeof(msgs)/sizeof(msgs[0]))) ? msgs[id] : "Unknown";
@@ -2187,10 +2186,10 @@
 	ast_copy_string(tmp, mailbox, sizeof(tmp));
 	
 	context = strchr(tmp, '@');
-	if (context) {   
+	if (context) {
 		*context = '\0';
 		context++;
-	} else  
+	} else
 		context = "default";
 	
 	obj = odbc_request_obj(odbc_database, 0);
@@ -2302,7 +2301,7 @@
 		}
 		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/%s'", odbc_table, VM_SPOOL_DIR, context, mailbox, folder);
 		res = SQLPrepare(stmt, sql, SQL_NTS);
-		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {  
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
 			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 			goto yuck;
@@ -2355,8 +2354,8 @@
 #ifdef IMAP_STORAGE
 static int count_messages_imap(const char *mailbox, int *newmsgs, int *oldmsgs)
 {
-   	SEARCHPGM *pgm;
-   	SEARCHHEADER *hdr;
+	SEARCHPGM *pgm;
+	SEARCHHEADER *hdr;
  
  	struct ast_vm_user *vmu;
  	struct vm_state *vms_p;
@@ -2370,7 +2369,8 @@
  	if (oldmsgs)
  		*oldmsgs = 0;
  
- 	ast_log (LOG_DEBUG,"Mailbox is set to %s\n",mailbox);
+	if(option_debug > 2)
+	 	ast_log (LOG_DEBUG,"Mailbox is set to %s\n",mailbox);
  	/* If no mailbox, return immediately */
  	if (ast_strlen_zero(mailbox))
  		return 0;
@@ -2406,15 +2406,15 @@
  	}
  
  	/* We have to get the user before we can open the stream! */
-   	/*ast_log (LOG_DEBUG,"Before find_user, context is %s and mailbox is %s\n",context,mailbox); */
+ 	/*ast_log (LOG_DEBUG,"Before find_user, context is %s and mailbox is %s\n",context,mailbox); */
  	vmu = find_user(NULL, context, mailboxnc);
  	if (vmu == NULL) {
-   		ast_log (LOG_ERROR,"Couldn't find mailbox %s in context %s\n",mailboxnc,context);
+		ast_log (LOG_ERROR,"Couldn't find mailbox %s in context %s\n",mailboxnc,context);
  		return -1;
  	} else {
  		/* No IMAP account available */
  		if (vmu->imapuser[0] == '\0') {
-   			ast_log (LOG_WARNING,"IMAP user not set for mailbox %s\n",vmu->mailbox);
+			ast_log (LOG_WARNING,"IMAP user not set for mailbox %s\n",vmu->mailbox);
  			return -1;
  		}
  	}
@@ -2425,7 +2425,8 @@
  		vms_p = get_vm_state_by_mailbox(mailboxnc,1);
  	}
  	if (vms_p != NULL) {
-   		ast_log (LOG_DEBUG,"Returning before search - user is logged in\n");
+		if(option_debug > 2)
+			ast_log (LOG_DEBUG,"Returning before search - user is logged in\n");
  		*newmsgs = vms_p->newmessages;
  		*oldmsgs = vms_p->oldmessages;
  		return 0;
@@ -2438,12 +2439,14 @@
  	}
  
  	if (vms_p == NULL) {
-   		ast_log (LOG_DEBUG,"Adding new vmstate for %s\n",vmu->imapuser);
+		if(option_debug > 2)
+			ast_log (LOG_DEBUG,"Adding new vmstate for %s\n",vmu->imapuser);
  		vms_p = (struct vm_state *)malloc(sizeof(struct vm_state));
  		strcpy(vms_p->imapuser,vmu->imapuser);
  		strcpy(vms_p->username,mailboxnc); /* save for access from interactive entry point */
  		vms_p->mailstream = NIL; /* save for access from interactive entry point */
-   		ast_log (LOG_DEBUG,"Copied %s to %s\n",vmu->imapuser,vms_p->imapuser);
+		if(option_debug > 2)
+			ast_log (LOG_DEBUG,"Copied %s to %s\n",vmu->imapuser,vms_p->imapuser);
  		vms_p->updated = 1;
  		vms_p->interactive = 0;
  		/* set mailbox to INBOX! */
@@ -2454,13 +2457,13 @@
  	if (vms_p->mailstream == NULL)
  		ret = init_mailstream(vms_p);

[... 4242 lines stripped ...]


More information about the asterisk-commits mailing list