[asterisk-commits] murf: branch murf/bug_7638 r75563 - in /team/murf/bug_7638: ./ apps/ channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 18 08:24:24 CDT 2007


Author: murf
Date: Wed Jul 18 08:24:22 2007
New Revision: 75563

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75563
Log:
Merged revisions 75163-75164,75183,75200,75227,75254-75255,75259-75260,75307,75351,75365,75379,75381,75400,75402,75404,75406,75438,75442-75443,75446,75448,75451,75505,75530 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r75163 | russell | 2007-07-15 20:44:49 -0600 (Sun, 15 Jul 2007) | 4 lines

Cast the 2nd argument to iconv() to a void *, as some systems define it as a
(const char *), while others define it as (char *).  This is done to suppress
compiler warnings about it.

................
r75164 | russell | 2007-07-15 20:51:56 -0600 (Sun, 15 Jul 2007) | 5 lines

Merge a bunch of doxygen updates to header files.  This includes changes to
use the \retval tag for documenting return values, fixing various warnings
when generating the documentation, and various other things.
(closes issue #10203, snuffy)

................
r75183 | file | 2007-07-16 07:35:20 -0600 (Mon, 16 Jul 2007) | 2 lines

It is no longer required for each module that deals with a channel to call ast_module_user_hangup_all in it's unload function. The loader will automatically perform this action for it.

................
r75200 | file | 2007-07-16 08:39:29 -0600 (Mon, 16 Jul 2007) | 2 lines

Applications no longer need to call ast_module_user_add and ast_module_user_remove. This is now taken care of in the pbx_exec function outside of the application.

................
r75227 | file | 2007-07-16 09:57:01 -0600 (Mon, 16 Jul 2007) | 2 lines

I found this sillyness when I did my ast_module_user conversion. Return immediately if no data was passed to the Verbose application.

................
r75254 | mmichelson | 2007-07-16 12:18:19 -0600 (Mon, 16 Jul 2007) | 16 lines

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

........
r75253 | mmichelson | 2007-07-16 13:16:15 -0500 (Mon, 16 Jul 2007) | 8 lines

Restoring functionality from 1.2 wherein Retrydial will not exit if there is no announce file specified.
This change makes it so that if there is no announce file specified, the application will continue until finished (or caller hangs up).
If a bogus announce file is specified, then a warning message will be printed saying that the file could not be found, but execution will
still continue. 

(closes issue #10186, reported by jon, patched by me)


........

................
r75255 | file | 2007-07-16 12:24:29 -0600 (Mon, 16 Jul 2007) | 2 lines

For my next trick I will make it so dialplan functions no longer need to call ast_module_user_add and ast_module_user_remove. These are now called in the ast_func_read and ast_func_write functions outside of the module.

................
r75259 | file | 2007-07-16 12:36:02 -0600 (Mon, 16 Jul 2007) | 2 lines

Add in check for the GCC attribute deprecated. It may be used soon!

................
r75260 | file | 2007-07-16 12:38:28 -0600 (Mon, 16 Jul 2007) | 2 lines

Change the function name slightly... just for kpfleming!

................
r75307 | kpfleming | 2007-07-16 14:58:56 -0600 (Mon, 16 Jul 2007) | 19 lines

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

................
r75306 | kpfleming | 2007-07-16 15:53:24 -0500 (Mon, 16 Jul 2007) | 11 lines

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

........
r75304 | kpfleming | 2007-07-16 15:46:58 -0500 (Mon, 16 Jul 2007) | 3 lines

provide proper copyright/license attribution for this structure that was copied from a BSD-licensed header file long, long ago...


........

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

................
r75351 | qwell | 2007-07-17 06:01:05 -0600 (Tue, 17 Jul 2007) | 6 lines

Fix an incorrect parenthesization (TODO: Find a better word) in app_dial

Pointed out by Fanzhou Zhao

Closes issue #10216

................
r75365 | rizzo | 2007-07-17 06:46:25 -0600 (Tue, 17 Jul 2007) | 7 lines

Initialize a variable to avoid a warning when the compiler
(and/or the optimization level) may think it is used uninitialized.
The code was indeed correct, but unfortunately the result of
some compiler checks such as -Wunused and -Wuninitialized depends
heavily on the optimization level.


................
r75379 | rizzo | 2007-07-17 08:32:15 -0600 (Tue, 17 Jul 2007) | 16 lines

Introduce ast_parse_arg() , a generic function to parse strings
in a consistent way. This is meant to replace the custom code
which is repeated all over the place in the various files when
parsing config files, CLI entries and other string information.

Right now the code supports parsing int32, uint32 and sockaddr_in with
optional default values and bound checks. It contains minimal error
checking, but that can be easily extended as the need arises.

Being a new API i am introducing this only in trunk, though I believe
that once the interface has been ironed out it might become a
worthwhile addition to 1.4 as well - basically, the first time
we will need to fix a piece of argument parsing code, we might as
well bring in this change and use the new API instead.


................
r75381 | file | 2007-07-17 08:48:17 -0600 (Tue, 17 Jul 2007) | 2 lines

Make trunk build once again.

................
r75400 | murf | 2007-07-17 13:40:29 -0600 (Tue, 17 Jul 2007) | 1 line

via 10206, I have added an option (e) to Dial to allow the h exten to get run on peer. Had to upgrade ast_flag stuff to 64 bits to do this.
................
r75402 | russell | 2007-07-17 13:46:13 -0600 (Tue, 17 Jul 2007) | 11 lines

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

........
r75401 | russell | 2007-07-17 14:45:07 -0500 (Tue, 17 Jul 2007) | 3 lines

Remove a duplicated newline character in AGI debug output.
(closes issue #10207, patch by seanbright)

........

................
r75404 | russell | 2007-07-17 14:01:54 -0600 (Tue, 17 Jul 2007) | 20 lines

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

........
r75403 | russell | 2007-07-17 15:01:12 -0500 (Tue, 17 Jul 2007) | 12 lines

(closes issue #10209)
Reported by: juggie
Patches:
      10209-trunk-2.patch uploaded by juggie
Tested by: juggie, blitzrage

In ast_pbx_run(), mark a channel as hung up after an application returned -1, 
or when it runs out of extensions to execute.  This is so that code can detect
that this channel has been hung up for things like making sure DeadAGI is used
on actual dead channels, and is beneficial for other things, like making sure
someone doesn't try to start spying on a channel that is about to go away.

........

................
r75406 | mmichelson | 2007-07-17 14:05:19 -0600 (Tue, 17 Jul 2007) | 14 lines

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

........
r75405 | mmichelson | 2007-07-17 15:03:48 -0500 (Tue, 17 Jul 2007) | 6 lines

Fixing an error I made earlier. ast_fileexists can return -1 on failure, so I need to be sure that we only enter the if
statement if it is successful.

Related to my fix to issue #10186


........

................
r75438 | russell | 2007-07-17 14:34:52 -0600 (Tue, 17 Jul 2007) | 15 lines

Blocked revisions 75437 via svnmerge

........
r75437 | russell | 2007-07-17 15:33:06 -0500 (Tue, 17 Jul 2007) | 8 lines

(issue #10210)
Reported by: juggie
Patches:
      10210-1.4-grr.patch uploaded by juggie (license #24)
Tested by: juggie, blitzrage

Log a warning if someone uses DeadAGI on a live channel.

........

................
r75442 | russell | 2007-07-17 14:42:50 -0600 (Tue, 17 Jul 2007) | 20 lines

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

................
r75441 | russell | 2007-07-17 15:42:12 -0500 (Tue, 17 Jul 2007) | 12 lines

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

........
r75440 | russell | 2007-07-17 15:41:41 -0500 (Tue, 17 Jul 2007) | 4 lines

After parsing information elements in IAX frames, set the data length to zero,
so that code later on does not think it has data to copy.
(ASA-2007-015)

........

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

................
r75443 | file | 2007-07-17 14:44:55 -0600 (Tue, 17 Jul 2007) | 9 lines

Blocked revisions 75439 via svnmerge

........
r75439 | file | 2007-07-17 17:40:57 -0300 (Tue, 17 Jul 2007) | 2 lines

Ensure that the pointer to STUN data does not go to unaccessible memory. (ASA-2007-017)

........

................
r75446 | russell | 2007-07-17 14:49:09 -0600 (Tue, 17 Jul 2007) | 21 lines

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

................
r75445 | russell | 2007-07-17 15:48:21 -0500 (Tue, 17 Jul 2007) | 13 lines

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

........
r75444 | russell | 2007-07-17 15:45:27 -0500 (Tue, 17 Jul 2007) | 5 lines

Ensure that when encoding the contents of an ast_frame into an iax_frame, that
the size of the destination buffer is known in the iax_frame so that code
won't write past the end of the allocated buffer when sending outgoing frames.
(ASA-2007-014)

........

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

................
r75448 | russell | 2007-07-17 14:52:20 -0600 (Tue, 17 Jul 2007) | 8 lines

Blocked revisions 75447 via svnmerge

........
r75447 | russell | 2007-07-17 15:51:25 -0500 (Tue, 17 Jul 2007) | 1 line

cast arguments to ast_log so that it builds without warnings for me
........

................
r75451 | russell | 2007-07-17 14:58:40 -0600 (Tue, 17 Jul 2007) | 19 lines

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

................
r75450 | russell | 2007-07-17 15:57:56 -0500 (Tue, 17 Jul 2007) | 11 lines

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

........
r75449 | russell | 2007-07-17 15:57:09 -0500 (Tue, 17 Jul 2007) | 3 lines

Properly check for the length in the skinny packet to prevent an invalid memcpy.
(ASA-2007-016)

........

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

................
r75505 | murf | 2007-07-17 15:52:51 -0600 (Tue, 17 Jul 2007) | 1 line

Spotted this bug today myself, trying to reproduce a BE bug. Use a vert bar instead of a comma, when calling RAND.
................
r75530 | tilghman | 2007-07-18 06:38:36 -0600 (Wed, 18 Jul 2007) | 10 lines

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

........
r75529 | tilghman | 2007-07-18 07:29:41 -0500 (Wed, 18 Jul 2007) | 2 lines

Using a freed frame causes crashes (closes issue #9317)

........

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

Modified:
    team/murf/bug_7638/   (props changed)
    team/murf/bug_7638/apps/app_adsiprog.c
    team/murf/bug_7638/apps/app_alarmreceiver.c
    team/murf/bug_7638/apps/app_amd.c
    team/murf/bug_7638/apps/app_authenticate.c
    team/murf/bug_7638/apps/app_cdr.c
    team/murf/bug_7638/apps/app_chanisavail.c
    team/murf/bug_7638/apps/app_channelredirect.c
    team/murf/bug_7638/apps/app_chanspy.c
    team/murf/bug_7638/apps/app_controlplayback.c
    team/murf/bug_7638/apps/app_db.c
    team/murf/bug_7638/apps/app_dial.c
    team/murf/bug_7638/apps/app_dictate.c
    team/murf/bug_7638/apps/app_directed_pickup.c
    team/murf/bug_7638/apps/app_directory.c
    team/murf/bug_7638/apps/app_disa.c
    team/murf/bug_7638/apps/app_dumpchan.c
    team/murf/bug_7638/apps/app_echo.c
    team/murf/bug_7638/apps/app_exec.c
    team/murf/bug_7638/apps/app_externalivr.c
    team/murf/bug_7638/apps/app_festival.c
    team/murf/bug_7638/apps/app_flash.c
    team/murf/bug_7638/apps/app_followme.c
    team/murf/bug_7638/apps/app_forkcdr.c
    team/murf/bug_7638/apps/app_getcpeid.c
    team/murf/bug_7638/apps/app_ices.c
    team/murf/bug_7638/apps/app_image.c
    team/murf/bug_7638/apps/app_ivrdemo.c
    team/murf/bug_7638/apps/app_macro.c
    team/murf/bug_7638/apps/app_meetme.c
    team/murf/bug_7638/apps/app_milliwatt.c
    team/murf/bug_7638/apps/app_minivm.c
    team/murf/bug_7638/apps/app_mixmonitor.c
    team/murf/bug_7638/apps/app_morsecode.c
    team/murf/bug_7638/apps/app_mp3.c
    team/murf/bug_7638/apps/app_nbscat.c
    team/murf/bug_7638/apps/app_osplookup.c
    team/murf/bug_7638/apps/app_page.c
    team/murf/bug_7638/apps/app_parkandannounce.c
    team/murf/bug_7638/apps/app_playback.c
    team/murf/bug_7638/apps/app_privacy.c
    team/murf/bug_7638/apps/app_queue.c
    team/murf/bug_7638/apps/app_read.c
    team/murf/bug_7638/apps/app_readfile.c
    team/murf/bug_7638/apps/app_record.c
    team/murf/bug_7638/apps/app_rpt.c
    team/murf/bug_7638/apps/app_sayunixtime.c
    team/murf/bug_7638/apps/app_senddtmf.c
    team/murf/bug_7638/apps/app_sendtext.c
    team/murf/bug_7638/apps/app_setcallerid.c
    team/murf/bug_7638/apps/app_skel.c
    team/murf/bug_7638/apps/app_sms.c
    team/murf/bug_7638/apps/app_softhangup.c
    team/murf/bug_7638/apps/app_speech_utils.c
    team/murf/bug_7638/apps/app_stack.c
    team/murf/bug_7638/apps/app_system.c
    team/murf/bug_7638/apps/app_talkdetect.c
    team/murf/bug_7638/apps/app_test.c
    team/murf/bug_7638/apps/app_transfer.c
    team/murf/bug_7638/apps/app_url.c
    team/murf/bug_7638/apps/app_userevent.c
    team/murf/bug_7638/apps/app_verbose.c
    team/murf/bug_7638/apps/app_voicemail.c
    team/murf/bug_7638/apps/app_waitforring.c
    team/murf/bug_7638/apps/app_waitforsilence.c
    team/murf/bug_7638/apps/app_while.c
    team/murf/bug_7638/apps/app_zapateller.c
    team/murf/bug_7638/apps/app_zapbarge.c
    team/murf/bug_7638/apps/app_zapras.c
    team/murf/bug_7638/apps/app_zapscan.c
    team/murf/bug_7638/channels/chan_iax2.c
    team/murf/bug_7638/channels/chan_local.c
    team/murf/bug_7638/channels/chan_sip.c
    team/murf/bug_7638/channels/chan_skinny.c
    team/murf/bug_7638/channels/iax2-parser.c
    team/murf/bug_7638/channels/iax2-parser.h
    team/murf/bug_7638/channels/iax2-provision.c
    team/murf/bug_7638/channels/iax2-provision.h
    team/murf/bug_7638/configure
    team/murf/bug_7638/configure.ac
    team/murf/bug_7638/funcs/func_blacklist.c
    team/murf/bug_7638/funcs/func_curl.c
    team/murf/bug_7638/funcs/func_cut.c
    team/murf/bug_7638/funcs/func_enum.c
    team/murf/bug_7638/funcs/func_iconv.c
    team/murf/bug_7638/funcs/func_odbc.c
    team/murf/bug_7638/funcs/func_rand.c
    team/murf/bug_7638/funcs/func_realtime.c
    team/murf/bug_7638/funcs/func_version.c
    team/murf/bug_7638/funcs/func_vmcount.c
    team/murf/bug_7638/include/asterisk/abstract_jb.h
    team/murf/bug_7638/include/asterisk/adsi.h
    team/murf/bug_7638/include/asterisk/autoconfig.h.in
    team/murf/bug_7638/include/asterisk/cdr.h
    team/murf/bug_7638/include/asterisk/channel.h
    team/murf/bug_7638/include/asterisk/chanspy.h
    team/murf/bug_7638/include/asterisk/cli.h
    team/murf/bug_7638/include/asterisk/config.h
    team/murf/bug_7638/include/asterisk/crypto.h
    team/murf/bug_7638/include/asterisk/devicestate.h
    team/murf/bug_7638/include/asterisk/doxyref.h
    team/murf/bug_7638/include/asterisk/dundi.h
    team/murf/bug_7638/include/asterisk/enum.h
    team/murf/bug_7638/include/asterisk/features.h
    team/murf/bug_7638/include/asterisk/file.h
    team/murf/bug_7638/include/asterisk/frame.h
    team/murf/bug_7638/include/asterisk/image.h
    team/murf/bug_7638/include/asterisk/io.h
    team/murf/bug_7638/include/asterisk/jabber.h
    team/murf/bug_7638/include/asterisk/linkedlists.h
    team/murf/bug_7638/include/asterisk/manager.h
    team/murf/bug_7638/include/asterisk/module.h
    team/murf/bug_7638/include/asterisk/musiconhold.h
    team/murf/bug_7638/include/asterisk/pbx.h
    team/murf/bug_7638/include/asterisk/res_odbc.h
    team/murf/bug_7638/include/asterisk/say.h
    team/murf/bug_7638/include/asterisk/speech.h
    team/murf/bug_7638/include/asterisk/strings.h
    team/murf/bug_7638/include/asterisk/tdd.h
    team/murf/bug_7638/include/asterisk/translate.h
    team/murf/bug_7638/include/asterisk/utils.h
    team/murf/bug_7638/main/channel.c
    team/murf/bug_7638/main/config.c
    team/murf/bug_7638/main/dns.c
    team/murf/bug_7638/main/loader.c
    team/murf/bug_7638/main/pbx.c
    team/murf/bug_7638/main/rtp.c
    team/murf/bug_7638/pbx/pbx_ael.c
    team/murf/bug_7638/pbx/pbx_dundi.c
    team/murf/bug_7638/res/res_agi.c
    team/murf/bug_7638/res/res_config_odbc.c
    team/murf/bug_7638/res/res_config_pgsql.c
    team/murf/bug_7638/res/res_features.c
    team/murf/bug_7638/res/res_musiconhold.c
    team/murf/bug_7638/res/res_realtime.c
    team/murf/bug_7638/utils/ael_main.c
    team/murf/bug_7638/utils/check_expr.c
    team/murf/bug_7638/utils/conf2ael.c

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

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

Propchange: team/murf/bug_7638/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jul 18 08:24:22 2007
@@ -1,1 +1,1 @@
-/trunk:1-75159
+/trunk:1-75538

Modified: team/murf/bug_7638/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_adsiprog.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_adsiprog.c (original)
+++ team/murf/bug_7638/apps/app_adsiprog.c Wed Jul 18 08:24:22 2007
@@ -1548,10 +1548,7 @@
 
 static int adsi_exec(struct ast_channel *chan, void *data)
 {
-	int res=0;
-	struct ast_module_user *u;
-
-	u = ast_module_user_add(chan);
+	int res = 0;
 	
 	if (ast_strlen_zero(data))
 		data = "asterisk.adsi";
@@ -1564,22 +1561,13 @@
 			ast_verbose(VERBOSE_PREFIX_3 "ADSI Available on CPE.  Attempting Upload.\n");
 		res = adsi_prog(chan, data);
 	}
-
-	ast_module_user_remove(u);
 	
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	ast_module_user_hangup_all();
-
-	res = ast_unregister_application(app);	
-	
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/murf/bug_7638/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_alarmreceiver.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_alarmreceiver.c (original)
+++ team/murf/bug_7638/apps/app_alarmreceiver.c Wed Jul 18 08:24:22 2007
@@ -628,14 +628,11 @@
 static int alarmreceiver_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u;
 	event_node_t *elp, *efree;
 	char signalling_type[64] = "";
 
 	event_node_t *event_head = NULL;
 
-	u = ast_module_user_add(chan);
-
 	/* Set write and read formats to ULAW */
 
 	if(option_verbose >= 4)
@@ -643,13 +640,11 @@
 
 	if (ast_set_write_format(chan,AST_FORMAT_ULAW)){
 		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
-		ast_module_user_remove(u);
 		return -1;
 	}
 	
 	if (ast_set_read_format(chan,AST_FORMAT_ULAW)){
 		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",chan->name);
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -664,13 +659,8 @@
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Answering channel\n");
 
 	if (chan->_state != AST_STATE_UP) {
-	
-		res = ast_answer(chan);
-		
-		if (res) {
-			ast_module_user_remove(u);
+		if ((res = ast_answer(chan)))
 			return -1;
-		}
 	}
 
 	/* Wait for the connection to settle post-answer */
@@ -721,9 +711,6 @@
 		elp = elp->next;
 		ast_free(efree);
 	}
-
-
-	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -823,13 +810,7 @@
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/murf/bug_7638/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_amd.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_amd.c (original)
+++ team/murf/bug_7638/apps/app_amd.c Wed Jul 18 08:24:22 2007
@@ -318,11 +318,7 @@
 
 static int amd_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u = NULL;
-
-	u = ast_module_user_add(chan);
 	isAnsweringMachine(chan, data);
-	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -383,7 +379,6 @@
 
 static int unload_module(void)
 {
-	ast_module_user_hangup_all();
 	return ast_unregister_application(app);
 }
 

Modified: team/murf/bug_7638/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_authenticate.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_authenticate.c (original)
+++ team/murf/bug_7638/apps/app_authenticate.c Wed Jul 18 08:24:22 2007
@@ -90,7 +90,6 @@
 {
 	int res=0;
 	int retries;
-	struct ast_module_user *u;
 	char passwd[256];
 	char *prompt;
 	int maxdigits;
@@ -107,15 +106,10 @@
 		ast_log(LOG_WARNING, "Authenticate requires an argument(password)\n");
 		return -1;
 	}
-	
-	u = ast_module_user_add(chan);
 
 	if (chan->_state != AST_STATE_UP) {
-		res = ast_answer(chan);
-		if (res) {
-			ast_module_user_remove(u);
+		if ((res = ast_answer(chan)))
 			return -1;
-		}
 	}
 	
 	argcopy = ast_strdupa(data);
@@ -217,20 +211,13 @@
 			res = ast_waitstream(chan, "");
 		res = -1;
 	}
-	ast_module_user_remove(u);
+
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	ast_module_user_hangup_all();
-
-	res = ast_unregister_application(app);
-
-	
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/murf/bug_7638/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_cdr.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_cdr.c (original)
+++ team/murf/bug_7638/apps/app_cdr.c Wed Jul 18 08:24:22 2007
@@ -46,28 +46,15 @@
 
 static int nocdr_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
-	
-	u = ast_module_user_add(chan);
-
-	if (chan->cdr) {
+	if (chan->cdr)
 		ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED);
-	}
-
-	ast_module_user_remove(u);
 
 	return 0;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(nocdr_app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(nocdr_app);
 }
 
 static int load_module(void)

Modified: team/murf/bug_7638/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_chanisavail.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_chanisavail.c (original)
+++ team/murf/bug_7638/apps/app_chanisavail.c Wed Jul 18 08:24:22 2007
@@ -69,7 +69,6 @@
 {
 	int res=-1, inuse=-1, option_state=0, string_compare=0;
 	int status;
-	struct ast_module_user *u;
 	char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur;
 	struct ast_channel *tempchan;
 	AST_DECLARE_APP_ARGS(args,
@@ -81,8 +80,6 @@
 		ast_log(LOG_WARNING, "ChanIsAvail requires an argument (Zap/1&Zap/2)\n");
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 
 	info = ast_strdupa(data); 
 
@@ -108,7 +105,6 @@
 			number = strchr(tech, '/');
 			if (!number) {
 				ast_log(LOG_WARNING, "ChanIsAvail argument takes format ([technology]/[device])\n");
-				ast_module_user_remove(u);
 				return -1;
 			}
 			*number = '\0';
@@ -151,19 +147,12 @@
 		pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
 	}
 
-	ast_module_user_remove(u);
 	return 0;
 }
 
 static int unload_module(void)
 {
-	int res = 0;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-	
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/murf/bug_7638/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_channelredirect.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_channelredirect.c (original)
+++ team/murf/bug_7638/apps/app_channelredirect.c Wed Jul 18 08:24:22 2007
@@ -52,7 +52,6 @@
 static int asyncgoto_exec(struct ast_channel *chan, void *data)
 {
 	int res = -1;
-	struct ast_module_user *u;
 	char *info, *context, *exten, *priority;
 	int prio = 1;
 	struct ast_channel *chan2 = NULL;
@@ -66,8 +65,6 @@
 		ast_log(LOG_WARNING, "%s requires an argument (channel|[[context|]exten|]priority)\n", app);
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 
 	info = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, info);
@@ -115,20 +112,13 @@
  chanquit:
 	ast_mutex_unlock(&chan2->lock);
  quit:
-	ast_module_user_remove(u);
 
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;	
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/murf/bug_7638/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_chanspy.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_chanspy.c (original)
+++ team/murf/bug_7638/apps/app_chanspy.c Wed Jul 18 08:24:22 2007
@@ -626,7 +626,6 @@
 
 static int chanspy_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
 	char *options = NULL;
 	char *spec = NULL;
 	char *argv[2];
@@ -641,8 +640,6 @@
 
 	data = ast_strdupa(data);
 
-	u = ast_module_user_add(chan);
-
 	if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
 		spec = argv[0];
 		if (argc > 1)
@@ -680,7 +677,6 @@
 	oldwf = chan->writeformat;
 	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -702,14 +698,11 @@
 	if (oldwf && ast_set_write_format(chan, oldwf) < 0)
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
 static int extenspy_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
 	char *options = NULL;
 	char *exten = NULL;
 	char *context = NULL;
@@ -725,8 +718,6 @@
 
 	data = ast_strdupa(data);
 
-	u = ast_module_user_add(chan);
-
 	if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
 		context = argv[0];
 		if (!ast_strlen_zero(argv[0]))
@@ -765,7 +756,6 @@
 	oldwf = chan->writeformat;
 	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -787,8 +777,6 @@
 	if (oldwf && ast_set_write_format(chan, oldwf) < 0)
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
@@ -799,8 +787,6 @@
 	res |= ast_unregister_application(app_chan);
 	res |= ast_unregister_application(app_ext);
 
-	ast_module_user_hangup_all();
-
 	return res;
 }
 

Modified: team/murf/bug_7638/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_controlplayback.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_controlplayback.c (original)
+++ team/murf/bug_7638/apps/app_controlplayback.c Wed Jul 18 08:24:22 2007
@@ -93,7 +93,6 @@
 	int skipms = 0;
 	long offsetms = 0;
 	char offsetbuf[20];
-	struct ast_module_user *u;
 	char *tmp;
 	int argc;
 	char *argv[8] = { NULL, };
@@ -114,8 +113,6 @@
 		ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 	
 	tmp = ast_strdupa(data);
 
@@ -123,7 +120,6 @@
 
 	if (argc < 1) {
 		ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -165,8 +161,6 @@
 	snprintf(offsetbuf, sizeof(offsetbuf), "%ld", offsetms);
 	pbx_builtin_setvar_helper(chan, "CPLAYBACKOFFSET", offsetbuf);
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 

Modified: team/murf/bug_7638/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_db.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_db.c (original)
+++ team/murf/bug_7638/apps/app_db.c Wed Jul 18 08:24:22 2007
@@ -68,9 +68,6 @@
 static int deltree_exec(struct ast_channel *chan, void *data)
 {
 	char *argv, *family, *keytree;
-	struct ast_module_user *u;
-
-	u = ast_module_user_add(chan);
 
 	argv = ast_strdupa(data);
 
@@ -79,7 +76,6 @@
 		keytree = strsep(&argv, "\0");
 			if (!family || !keytree) {
 				ast_debug(1, "Ignoring; Syntax error in argument\n");
-				ast_module_user_remove(u);
 				return 0;
 			}
 		if (ast_strlen_zero(keytree))
@@ -101,18 +97,13 @@
 			ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: Error deleting key from database.\n");
 	}
 
-	ast_module_user_remove(u);
-
 	return 0;
 }
 
 static int del_exec(struct ast_channel *chan, void *data)
 {
 	char *argv, *family, *key;
-	struct ast_module_user *u;
 	static int deprecation_warning = 0;
-
-	u = ast_module_user_add(chan);
 
 	if (!deprecation_warning) {
 		deprecation_warning = 1;
@@ -126,7 +117,6 @@
 		key = strsep(&argv, "\0");
 		if (!family || !key) {
 			ast_debug(1, "Ignoring; Syntax error in argument\n");
-			ast_module_user_remove(u);
 			return 0;
 		}
 		if (option_verbose > 2)
@@ -138,8 +128,6 @@
 	} else {
 		ast_debug(1, "Ignoring, no parameters\n");
 	}
-
-	ast_module_user_remove(u);
 	
 	return 0;
 }

Modified: team/murf/bug_7638/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_dial.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_dial.c (original)
+++ team/murf/bug_7638/apps/app_dial.c Wed Jul 18 08:24:22 2007
@@ -109,7 +109,8 @@
 "           party has answered, but before the call gets bridged. The 'called'\n"
 "           DTMF string is sent to the called party, and the 'calling' DTMF\n"
 "           string is sent to the calling party. Both parameters can be used\n"
-"           alone.\n"  	
+"           alone.\n"
+"    e    - execute the 'h' extension for peer after the call ends\n"
 "    f    - Force the callerid of the *calling* channel to be set as the\n"
 "           extension associated with the channel using a dialplan 'hint'.\n"
 "           For example, some PSTNs do not allow CallerID to be set to anything\n"
@@ -256,10 +257,11 @@
 	OPT_IGNORE_FORWARDING = (1 << 27),
 	OPT_CALLEE_GOSUB =	(1 << 28),
 	OPT_CANCEL_ELSEWHERE =  (1 << 29),
+	OPT_PEER_H =            (1 << 30),
 };
 
-#define DIAL_STILLGOING			(1 << 30)
-#define DIAL_NOFORWARDHTML		(1 << 31)
+#define DIAL_STILLGOING			(1 << 31)
+#define DIAL_NOFORWARDHTML		((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
 
 enum {
 	OPT_ARG_ANNOUNCE = 0,
@@ -282,6 +284,7 @@
 	AST_APP_OPTION('c', OPT_CANCEL_ELSEWHERE),
 	AST_APP_OPTION('d', OPT_DTMF_EXIT),
 	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('g', OPT_GO_ON),
 	AST_APP_OPTION_ARG('G', OPT_GOTO, OPT_ARG_GOTO),
@@ -314,7 +317,7 @@
 struct chanlist {
 	struct chanlist *next;
 	struct ast_channel *chan;
-	unsigned int flags;
+	uint64_t flags;
 	int forwards;
 };
 
@@ -1195,7 +1198,6 @@
 static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags, int *continue_exec)
 {
 	int res = -1;	/* default: error */
-	struct ast_module_user *u;
 	char *rest, *cur;	/* scan the list of destinations */
 	struct chanlist *outgoing = NULL;	/* list of destinations */
 	struct ast_channel *peer;
@@ -1233,8 +1235,6 @@
 		pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);	/* XXX is this the right place ? */
 
 	parse = ast_strdupa(data);
 	
@@ -1570,7 +1570,7 @@
 			ast_parseable_goto(peer, opt_args[OPT_ARG_GOTO]);
 			peer->priority++;
 			ast_pbx_start(peer);
-			hanguptree(outgoing, NULL, ast_test_flag(&opts, OPT_CANCEL_ELSEWHERE ? 1 : 0));
+			hanguptree(outgoing, NULL, ast_test_flag(&opts, OPT_CANCEL_ELSEWHERE) ? 1 : 0);
 			if (continue_exec)
 				*continue_exec = 1;
 			res = 0;
@@ -1792,7 +1792,29 @@
 
 		snprintf(toast, sizeof(toast), "%ld", (long)(end_time - start_time));
 		pbx_builtin_setvar_helper(chan, "DIALEDTIME", toast);
-
+		
+		
+		if (ast_test_flag(&opts, OPT_PEER_H)) {
+			ast_log(LOG_NOTICE,"PEER context: %s; PEER exten: %s;  PEER priority: %d\n", 
+					peer->context, peer->exten, peer->priority);
+		}
+		
+		strcpy(peer->context, chan->context);
+
+		if (ast_test_flag(&opts, OPT_PEER_H) && ast_exists_extension(peer, peer->context, "h", 1, peer->cid.cid_num)) {
+			strcpy(peer->exten, "h");
+			peer->priority = 1;
+			while (ast_exists_extension(peer, peer->context, peer->exten, peer->priority, peer->cid.cid_num)) {
+				if ((res = ast_spawn_extension(peer, peer->context, peer->exten, peer->priority, peer->cid.cid_num))) {
+					/* Something bad happened, or a hangup has been requested. */
+					ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
+					if (option_verbose > 1)
+						ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
+					break;
+				}
+				peer->priority++;
+			}
+		}
 		if (res != AST_PBX_NO_HANGUP_PEER) {
 			if (!chan->_softhangup)
 				chan->hangupcause = peer->hangupcause;
@@ -1820,7 +1842,6 @@
 	}
 
 done:
-	ast_module_user_remove(u);    	/* XXX probably not the right place for this. */
 	return res;
 }
 
@@ -1838,15 +1859,12 @@
 	char *announce = NULL, *dialdata = NULL;
 	const char *context = NULL;
 	int sleep = 0, loops = 0, res = -1;
-	struct ast_module_user *u;
 	struct ast_flags peerflags;
 	
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "RetryDial requires an argument!\n");
 		return -1;
 	}	
-
-	u = ast_module_user_add(chan);
 
 	announce = ast_strdupa(data);
 
@@ -1895,22 +1913,33 @@
 		res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec);
 		if (continue_exec)
 			break;
+
 		if (res == 0) {
 			if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) {
-				if (!(res = ast_streamfile(chan, announce, chan->language)))
-					res = ast_waitstream(chan, AST_DIGIT_ANY);
+				if (!ast_strlen_zero(announce)) {
+					if (ast_fileexists(announce, NULL, chan->language) > 0) {
+						if(!(res = ast_streamfile(chan, announce, chan->language)))								
+							ast_waitstream(chan, AST_DIGIT_ANY);
+					} else
+						ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
+				}
 				if (!res && sleep) {
 					if (!ast_test_flag(chan, AST_FLAG_MOH))
 						ast_moh_start(chan, NULL, NULL);
 					res = ast_waitfordigit(chan, sleep);
 				}
 			} else {
-				if (!(res = ast_streamfile(chan, announce, chan->language)))
-					res = ast_waitstream(chan, "");
+				if (!ast_strlen_zero(announce)) {
+					if (ast_fileexists(announce, NULL, chan->language) > 0) {
+						if (!(res = ast_streamfile(chan, announce, chan->language)))
+							res = ast_waitstream(chan, "");
+					} else
+						ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
+				}
 				if (sleep) {
 					if (!ast_test_flag(chan, AST_FLAG_MOH))
 						ast_moh_start(chan, NULL, NULL);
-					if (!res) 
+					if (!res)
 						res = ast_waitfordigit(chan, sleep);
 				}
 			}
@@ -1934,7 +1963,6 @@
 	if (ast_test_flag(chan, AST_FLAG_MOH))
 		ast_moh_stop(chan);
  done:
-	ast_module_user_remove(u);
 	return res;
 }
 
@@ -1946,11 +1974,8 @@
 	res = ast_unregister_application(app);
 	res |= ast_unregister_application(rapp);
 
-	ast_module_user_hangup_all();
-
-	if ((con = ast_context_find("app_dial_gosub_virtual_context"))) {
+	if ((con = ast_context_find("app_dial_gosub_virtual_context")))
 		ast_context_remove_extension2(con, "s", 1, NULL);
-	}
 
 	return res;
 }

Modified: team/murf/bug_7638/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_dictate.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_dictate.c (original)
+++ team/murf/bug_7638/apps/app_dictate.c Wed Jul 18 08:24:22 2007
@@ -89,7 +89,6 @@
 	struct ast_flags flags = {0};
 	struct ast_filestream *fs;
 	struct ast_frame *f = NULL;
-	struct ast_module_user *u;
 	int ffactor = 320 * 80,
 		res = 0,
 		done = 0,
@@ -101,8 +100,6 @@
 		len = 0,
 		maxlen = 0,
 		mode = 0;
-		
-	u = ast_module_user_add(chan);
 	
 	snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
 	if (!ast_strlen_zero(data)) {
@@ -122,7 +119,6 @@
 	oldr = chan->readformat;
 	if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) {
 		ast_log(LOG_WARNING, "Unable to set to linear mode.\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -330,7 +326,6 @@
 	if (oldr) {
 		ast_set_read_format(chan, oldr);
 	}
-	ast_module_user_remove(u);
 	return 0;
 }
 

Modified: team/murf/bug_7638/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_directed_pickup.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_directed_pickup.c (original)
+++ team/murf/bug_7638/apps/app_directed_pickup.c Wed Jul 18 08:24:22 2007
@@ -133,7 +133,6 @@
 static int pickup_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u = NULL;
 	char *tmp = ast_strdupa(data);
 	char *exten = NULL, *context = NULL;
 
@@ -141,8 +140,6 @@
 		ast_log(LOG_WARNING, "Pickup requires an argument (extension)!\n");
 		return -1;	
 	}
-
-	u = ast_module_user_add(chan);
 	
 	/* Parse extension (and context if there) */
 	while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
@@ -157,8 +154,6 @@
 		}
 		ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);
 	}
-
-	ast_module_user_remove(u);
 
 	return res;
 }

Modified: team/murf/bug_7638/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug_7638/apps/app_directory.c?view=diff&rev=75563&r1=75562&r2=75563
==============================================================================
--- team/murf/bug_7638/apps/app_directory.c (original)
+++ team/murf/bug_7638/apps/app_directory.c Wed Jul 18 08:24:22 2007
@@ -566,7 +566,6 @@
 static int directory_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u;
 	struct ast_config *cfg, *ucfg;
 	int last = 1;
 	int readext = 0;
@@ -584,8 +583,6 @@
 		return -1;
 	}
 
-	u = ast_module_user_add(chan);
-
 	parse = ast_strdupa(data);
 
 	AST_STANDARD_APP_ARGS(args, parse);
@@ -605,7 +602,6 @@
 	cfg = realtime_directory(args.vmcontext);
 	if (!cfg) {
 		ast_log(LOG_ERROR, "Unable to read the configuration data!\n");
-		ast_module_user_remove(u);
 		return -1;

[... 8249 lines stripped ...]



More information about the asterisk-commits mailing list