[asterisk-commits] mogorman: branch group/asterisk-imap r39399 - in /team/group/asterisk-imap: ....

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Aug 8 12:38:00 MST 2006


Author: mogorman
Date: Tue Aug  8 14:37:59 2006
New Revision: 39399

URL: http://svn.digium.com/view/asterisk?rev=39399&view=rev
Log:
Merged revisions 38762,38785,38801,38823,38826,38853,38871,38887,38905,38929,38951,38973,38994,39014,39032,39057-39058,39082,39109,39131-39132,39151,39171,39182,39203,39206,39229,39248,39272,39274,39295,39316,39332-39333,39349,39351,39353,39378,39380 via svnmerge from 
https://svn.digium.com/svn/asterisk/trunk

................
r38762 | tilghman | 2006-08-03 00:24:43 -0500 (Thu, 03 Aug 2006) | 10 lines

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

........
r38761 | tilghman | 2006-08-03 00:22:19 -0500 (Thu, 03 Aug 2006) | 2 lines

Bug 7648 - Checking wrong count for plurality on new messages for Dutch language

........

................
r38785 | tilghman | 2006-08-03 08:16:00 -0500 (Thu, 03 Aug 2006) | 2 lines

Update statement on FreeTDS with realtime, due to revisions in res_odbc

................
r38801 | crichter | 2006-08-03 11:38:00 -0500 (Thu, 03 Aug 2006) | 25 lines

* removed pp_l2_check (fixed L2 bug in mISDNuser)
* added blocking flag to stack object. A port can be blocked/unblocked from the
  cli
* added EVENT_PORT_ALARM to send alarm infos to the chan_misdn.c layer (later	
  we can add a manager event for that)
* added block_on_alarm option, to block the port whenever a ALARM occurs
* added need_busy flag to indicate if we've sended a CONTROL_BUSY already
* changed a bunch of cb_log(-1,..) to cb_log(0,..) due to funny behaviour in 
  recent asterisk ast_log messages..
* fixed a few ETSI state violations, especially when finishing calls in 
  different seldom states
* changed debug levels a lot to make the log more readable in low debuglevels
* some first fixes for the HOLD/RETRIEVE stuff (doesn't work totally still)
* removed the PRECONNECTED state stuff
* added cause 27 when we get a CLEANUP directly after a outgoing SETUP, this
  creates a CHANISUNAVAIL instead of a NOANSWER
* removed the addr pointer from "misdn show stacks" that's not needed anymore 
  and makes the output more unreadable
* added cause saving on RELEASE/RELEASE_COMPLETE
* set cause to 16 on prepare_bc
* removed stack getting from ph_control functions, we don't really need it 
  there
* added beroec api


................
r38823 | tilghman | 2006-08-03 14:05:06 -0500 (Thu, 03 Aug 2006) | 2 lines

Update documentation on realtime; add a workaround for lack of realtime hints by using func_odbc

................
r38826 | file | 2006-08-03 14:55:05 -0500 (Thu, 03 Aug 2006) | 10 lines

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

........
r38825 | file | 2006-08-03 15:54:02 -0400 (Thu, 03 Aug 2006) | 2 lines

Treat the file as invalid if we have no valid formats for it (issue #7643 reported by KNK)

........

................
r38853 | file | 2006-08-04 13:40:47 -0500 (Fri, 04 Aug 2006) | 2 lines

Don't assume that a referred by URI will always exist (issue #7641 reported and fixed by AuPix)

................
r38871 | file | 2006-08-04 18:17:40 -0500 (Fri, 04 Aug 2006) | 2 lines

Minor optimization but use a linkedlists.h macro that pops the head off the list instead of getting the first entry and then removing it.

................
r38887 | file | 2006-08-04 19:13:44 -0500 (Fri, 04 Aug 2006) | 2 lines

It is better to hold a lock then not hold a lock when you are supposed to.

................
r38905 | russell | 2006-08-05 00:26:29 -0500 (Sat, 05 Aug 2006) | 23 lines

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

........
r38903 | russell | 2006-08-05 01:07:39 -0400 (Sat, 05 Aug 2006) | 2 lines

suppress a compiler warning about the usage of a potentially uninitialized variable

........
r38904 | russell | 2006-08-05 01:08:50 -0400 (Sat, 05 Aug 2006) | 10 lines

Fix an issue that would cause a NewCallerID manager event to be generated
before the channel's NewChannel event.  This was due to a somewhat recent
change that included using ast_set_callerid() where it wasn't before.  This
function should not be used in the channel driver "new" functions.
(issue #7654, fixed by me)

Also, fix a couple minor bugs in usecount handling.  chan_iax2 could have
increased the usecount but then returned an error.  The place where chan_sip
increased the usecount did not call ast_update_usecount()

........

................
r38929 | russell | 2006-08-05 01:39:43 -0500 (Sat, 05 Aug 2006) | 11 lines

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

........
r38928 | russell | 2006-08-05 02:37:59 -0400 (Sat, 05 Aug 2006) | 3 lines

make sure the priv-callerintros directory exists before trying to create a file
there (issue #7659, patch by hads, with some modifications by me)

........

................
r38951 | russell | 2006-08-05 02:22:27 -0500 (Sat, 05 Aug 2006) | 11 lines

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

........
r38950 | russell | 2006-08-05 03:21:12 -0400 (Sat, 05 Aug 2006) | 3 lines

don't advertise that this function can set a SIP header when it can only
do reads

........

................
r38973 | russell | 2006-08-05 03:10:20 -0500 (Sat, 05 Aug 2006) | 11 lines

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

........
r38972 | russell | 2006-08-05 04:08:48 -0400 (Sat, 05 Aug 2006) | 3 lines

remove duplicate queue log entry when the caller exits on a timeout
(issue #7616, ppyy)

........

................
r38994 | russell | 2006-08-05 04:03:27 -0500 (Sat, 05 Aug 2006) | 14 lines

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

........
r38982 | russell | 2006-08-05 05:01:37 -0400 (Sat, 05 Aug 2006) | 6 lines

Always generate a Newstate event in ast_setstate() instead of making it a
Newchannel event if the state was AST_STATE_DOWN.  The Newchannel event will
always be generated in ast_request(), so this just causes a duplicated
Newchannel event in some cases.  
(issue #7506, repoted by capouch, fixed by me)

........

................
r39014 | russell | 2006-08-05 06:25:36 -0500 (Sat, 05 Aug 2006) | 3 lines

suppress a compiler warning about the usage of a potentially uninitialized
variable

................
r39032 | russell | 2006-08-05 15:58:47 -0500 (Sat, 05 Aug 2006) | 5 lines

- add DIALING_OFFHOOK and PRERING to ast_state2str
- don't include a newline character when building a response for an unknown
  state
(issue #7645, jonty)

................
r39057 | file | 2006-08-06 19:17:12 -0500 (Sun, 06 Aug 2006) | 10 lines

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

........
r39056 | file | 2006-08-06 20:15:51 -0400 (Sun, 06 Aug 2006) | 2 lines

Reset our stream and vstream pointers back to NULL so that any generator that uses them (file based MOH) will not try to close them again. (issue #7668 reported by jmls)

........

................
r39058 | russell | 2006-08-06 19:26:11 -0500 (Sun, 06 Aug 2006) | 5 lines

minor cleanups
- use appropriate types in some assignments
- use ast_strlen_zero()
- don't manually free cid fields since ast_set_callerid() will handle it

................
r39082 | russell | 2006-08-06 20:32:51 -0500 (Sun, 06 Aug 2006) | 15 lines

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

........
r39081 | russell | 2006-08-06 21:28:29 -0400 (Sun, 06 Aug 2006) | 7 lines

Fix a crash reported to me by hads on IRC.  This crash would occur with the use
of the "distinctiveringaftercid" option.  Also, on this user's system, the crash
would only occur when built without optimizations.  This is because the bug is
that the code would write past the end of an array that was allocated on the
stack, and the structure of the stack is different with or without optimizations
enabled.

........

................
r39109 | russell | 2006-08-06 23:15:52 -0500 (Sun, 06 Aug 2006) | 9 lines

Merge my applicationmap_fixup branch to address the issues described in this
post to the asterisk-dev mailing list:
  http://lists.digium.com/pipermail/asterisk-dev/2006-August/022174.html

This implements full control over both which channel(s) can activate a dynamic
feature, as well as which channel to run the application on.  I also updated
the documentation on the applicationmap in features.conf.sample in hopes that
the configuration is more clear.

................
r39131 | crichter | 2006-08-07 04:09:17 -0500 (Mon, 07 Aug 2006) | 1 line

changed naming of mISDN channels, so that hinting works proper
................
r39132 | oej | 2006-08-07 04:22:43 -0500 (Mon, 07 Aug 2006) | 3 lines

Issue #7651 - always send subscription-state (AuPix)
  Small change to the fix in the report.

................
r39151 | murf | 2006-08-07 07:59:47 -0500 (Mon, 07 Aug 2006) | 1 line

The contents of branch teams/murf/bug_7598 are being folded in here.
................
r39171 | oej | 2006-08-07 11:20:23 -0500 (Mon, 07 Aug 2006) | 2 lines

Fix accidental removal of if() in commit 38905

................
r39182 | oej | 2006-08-07 12:01:40 -0500 (Mon, 07 Aug 2006) | 4 lines

Add placeholder for sla.conf sample in configs/. Please update with
correct information not to overload the switchboard with calls to sales.
 Thank you! ;-)

................
r39203 | murf | 2006-08-07 13:12:51 -0500 (Mon, 07 Aug 2006) | 1 line

This commit folds in changes to both stringfields (some enhancements to the ...field_set() macro, to optimize setting strings to empty, resetting strings to shorter contents, etc.) and to chan_iax2.c, to use stringfields in the user, peer, and pvt structs. Has been running stably on iaxtel, but while iaxtel has a large registration volume, it doesn't seem to have a high call volume. So far, it seems to reduce heap usage by over half. YMMV\! Please report any IAX bugs that might involve stringfields\!
................
r39206 | kpfleming | 2006-08-07 13:47:33 -0500 (Mon, 07 Aug 2006) | 2 lines

remove some extraneous 'followme' in prompt names

................
r39229 | mogorman | 2006-08-07 16:15:28 -0500 (Mon, 07 Aug 2006) | 3 lines

Many many code cleanup changes given to me by Oej
Thanks, sorry I didn't put this in forever ago.

................
r39248 | mogorman | 2006-08-07 17:03:50 -0500 (Mon, 07 Aug 2006) | 4 lines

This patch allows for a user to send messages and 
monitor a jabber connection over manager.
patches from 7673 and 7666 with minor changes.

................
r39272 | russell | 2006-08-08 01:32:04 -0500 (Tue, 08 Aug 2006) | 56 lines

Merge team/russell/ast_verbose_threadstorage

- instead of defining a free() wrapper in a bunch of files, define it as
  ast_free() in utils.h and remove the copies from all the files.

- centralize and abstract the code used for doing thread storage. The code
  lives in threadstorage.h, with one function being implemented in utils.c.
  This new API includes generic thread storage as well as special functions
  for handling thread local dynamic length string buffers.

- update ast_inet_ntoa() to use the new threadstorage API
- update ast_state2str() to use the new threadstorage API
- update ast_cli() to use the new threadstorage API

- Modify manager_event() to use thread storage. Instead of using a buffer of
  4096 characters as the workspace for building the manager event, use a thread
  local dynamic string.  Now there is no length limitation on the length of the
  body of a manager event.

- Significantly simplify the handling of ast_verbose() ...
  - Instead of using a static char buffer and a lock to make sure only one
    thread can be using ast_verbose() at a time, use a thread local dynamic
    string as the workspace for preparing the verbose message. Instead of
    locking around the entire function, the only locking done now is when the
    message has been built and is being deliviered to the list of registered
    verbose message handlers.
  - This function was doing a strdup() on every message passed to it and
    keeping a queue of the last 200 messages in memory. This has been
    completely removed. The only place this was used was that if there were
    any messages in the verbose queue when a verbose handler was registered,
    all of the messages in the queue would be fed to it.  So, I just made sure
    that the console verbose handler and the network verbose handler (for
    remote asterisk consoles) were registered before any verbose messages.
    pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at
    startup, but I didn't feel the performance hit of this message queue was
    worth saving the initial verbose output for these very rarely used modules.
  - I have removed the last three arguments to the verbose handlers, leaving
    only the string itself because they aren't needed anymore. For example,
    ast_verbose had some logic for telling the verbose handler to add
    a newline if the buffer was completely full. Now that the buffer can grow
    as needed, this doesn't matter anymore.
  - remove unused function, ast_verbose_dmesg() which was to dispatch the
    message queue
  - Convert the list of verbose handlers to use the linked list macros.

- add missing newline characters to a few ast_verbose() calls

- convert the list of log channels to use the linked list macros in logger.c

- fix close_logger() to close all of the files it opened for logging

- update ast_log() to use a thread local dynamic string for its workspace
  for preparing log messages instead of a buffer of size BUFSIZ (8kB on my
  system) allocated on the stack.  The dynamic string in this case is limited
  to only growing to a maximum size of BUFSIZ.

................
r39274 | russell | 2006-08-08 01:36:47 -0500 (Tue, 08 Aug 2006) | 3 lines

change constant name from MAXSTRLEN to INITLEN since it is not the maximum
length, it is the initial length of the string when first allocated

................
r39295 | crichter | 2006-08-08 04:19:06 -0500 (Tue, 08 Aug 2006) | 14 lines

* added possibility to change echocancel settings during calls
* removed the holded element from the chan_list struct, we know this from the 
  state already
* added a few tweaks to make HOLD/RETRIEVE work again (TRANSFER does not work
  yet)
* added possibility to debug mISDN frames via syslog
* added misdn_lib_port_is_blocked function to check if a port is blocked
* removed ec_training=1 from empty_bc, we don't use ec_training anymore
* removed unused misdn_lib_get_l2_status function
* added the nt bit to dummy misdn_bchannel objects
* setting bc->out_fac_type to FACILITY_NONE defaultly
* removed HANDLER_DEBUG stuff for better readability


................
r39316 | oej | 2006-08-08 09:47:17 -0500 (Tue, 08 Aug 2006) | 3 lines

Marking PRI_CAUSE as deprecated to be replaced by hangup(cause)
(Issue #7610)

................
r39332 | tilghman | 2006-08-08 10:37:53 -0500 (Tue, 08 Aug 2006) | 2 lines

Bug 6237 - add volgain parameter, such that voicemail messages may be amplified after recording

................
r39333 | file | 2006-08-08 10:53:51 -0500 (Tue, 08 Aug 2006) | 2 lines

Clarify volgain option a bit, it needs sox to work.

................
r39349 | file | 2006-08-08 12:02:45 -0500 (Tue, 08 Aug 2006) | 2 lines

Add support for Sigma Designs cards. These basically allow you to offload dialtone generation to the board. If you're using a quicknet board where this might work, give it a try as well. (issue #6092 reported by ywalther - minor mods by moi)

................
r39351 | mogorman | 2006-08-08 12:07:41 -0500 (Tue, 08 Aug 2006) | 3 lines

some code clean up and catch for a act_hook being called
without a packet.

................
r39353 | russell | 2006-08-08 12:29:09 -0500 (Tue, 08 Aug 2006) | 9 lines

Blocked revisions 39350 via svnmerge

........
r39350 | russell | 2006-08-08 13:04:10 -0400 (Tue, 08 Aug 2006) | 2 lines

Increase the buffer size for the callid (issue #7675, reported by pssatcs)

........

................
r39378 | nadi | 2006-08-08 13:13:40 -0500 (Tue, 08 Aug 2006) | 7 lines

* first bits of decoding facility information elements
* fail on misdn_cfg_init() if elements in the config enum don't match with the config structs in misdn_config.c
* implemented first bits for encoding ISDN facility information elements via ASN.1 descriptions
* using unnamed semaphore for syncing in misdn_thread
* advanced fax detection: configurable detect timeout and context to jump into


................
r39380 | kpfleming | 2006-08-08 13:39:41 -0500 (Tue, 08 Aug 2006) | 10 lines

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

........
r39379 | kpfleming | 2006-08-08 13:39:16 -0500 (Tue, 08 Aug 2006) | 2 lines

add explicit listing of anthm's contributions (issue #7683)

........

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

Added:
    team/group/asterisk-imap/configs/sla.conf.sample
      - copied unchanged from r39380, trunk/configs/sla.conf.sample
    team/group/asterisk-imap/include/asterisk/threadstorage.h
      - copied unchanged from r39380, trunk/include/asterisk/threadstorage.h
    team/group/asterisk-imap/pbx/ael/ael-test/ael-ntest10/
      - copied from r39380, trunk/pbx/ael/ael-test/ael-ntest10/
    team/group/asterisk-imap/pbx/ael/ael-test/ael-ntest10/extensions.ael
      - copied unchanged from r39380, trunk/pbx/ael/ael-test/ael-ntest10/extensions.ael
    team/group/asterisk-imap/pbx/ael/ael-test/ael-test11/
      - copied from r39380, trunk/pbx/ael/ael-test/ael-test11/
    team/group/asterisk-imap/pbx/ael/ael-test/ael-test11/extensions.ael
      - copied unchanged from r39380, trunk/pbx/ael/ael-test/ael-test11/extensions.ael
    team/group/asterisk-imap/pbx/ael/ael-test/ref.ael-ntest10
      - copied unchanged from r39380, trunk/pbx/ael/ael-test/ref.ael-ntest10
    team/group/asterisk-imap/pbx/ael/ael-test/ref.ael-test11
      - copied unchanged from r39380, trunk/pbx/ael/ael-test/ref.ael-test11
Modified:
    team/group/asterisk-imap/   (props changed)
    team/group/asterisk-imap/CREDITS
    team/group/asterisk-imap/UPGRADE.txt
    team/group/asterisk-imap/apps/app_chanspy.c
    team/group/asterisk-imap/apps/app_dial.c
    team/group/asterisk-imap/apps/app_followme.c
    team/group/asterisk-imap/apps/app_queue.c
    team/group/asterisk-imap/apps/app_voicemail.c
    team/group/asterisk-imap/asterisk.c
    team/group/asterisk-imap/channel.c
    team/group/asterisk-imap/channels/chan_h323.c
    team/group/asterisk-imap/channels/chan_iax2.c
    team/group/asterisk-imap/channels/chan_jingle.c
    team/group/asterisk-imap/channels/chan_mgcp.c
    team/group/asterisk-imap/channels/chan_misdn.c
    team/group/asterisk-imap/channels/chan_phone.c
    team/group/asterisk-imap/channels/chan_sip.c
    team/group/asterisk-imap/channels/chan_skinny.c
    team/group/asterisk-imap/channels/chan_zap.c
    team/group/asterisk-imap/channels/misdn_config.c
    team/group/asterisk-imap/cli.c
    team/group/asterisk-imap/configs/features.conf.sample
    team/group/asterisk-imap/configs/followme.conf.sample
    team/group/asterisk-imap/configs/phone.conf.sample
    team/group/asterisk-imap/configs/voicemail.conf.sample
    team/group/asterisk-imap/include/asterisk/ael_structs.h
    team/group/asterisk-imap/include/asterisk/channel.h
    team/group/asterisk-imap/include/asterisk/compiler.h
    team/group/asterisk-imap/include/asterisk/logger.h
    team/group/asterisk-imap/include/asterisk/stringfields.h
    team/group/asterisk-imap/include/asterisk/utils.h
    team/group/asterisk-imap/logger.c
    team/group/asterisk-imap/manager.c
    team/group/asterisk-imap/pbx/ael/ael-test/ref.ael-test3
    team/group/asterisk-imap/pbx/ael/ael-test/ref.ael-test7
    team/group/asterisk-imap/pbx/ael/ael.tab.c
    team/group/asterisk-imap/pbx/ael/ael.y
    team/group/asterisk-imap/pbx/pbx_ael.c
    team/group/asterisk-imap/pbx/pbx_config.c
    team/group/asterisk-imap/res/res_agi.c
    team/group/asterisk-imap/res/res_features.c
    team/group/asterisk-imap/res/res_jabber.c
    team/group/asterisk-imap/utils.c

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

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

Propchange: team/group/asterisk-imap/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug  8 14:37:59 2006
@@ -1,1 +1,1 @@
-/trunk:1-38757
+/trunk:1-39397

Modified: team/group/asterisk-imap/CREDITS
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/CREDITS?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/CREDITS (original)
+++ team/group/asterisk-imap/CREDITS Tue Aug  8 14:37:59 2006
@@ -41,6 +41,39 @@
 	russelb at clemson.edu
 
 Anthony Minessale II - Countless big and small fixes, and relentless forward push
+also:
+app_chanspy
+app_forkcdr
+app_controlplayback
+app_while
+app_dumpchan
+app_dictate
+app_realtime
+app_macroif
+app_execif
+app_execiftime
+res_odbc
+res_config_odbc
+format_slin
+app_retrydial
+cdr_custom
+res_muxmon (now MixMonitor)
+res_sqlite
+format_mp3
+Several Features in app_dial including L(), G() and enhancements to M() and D()
+The concept design and initial implementation of dialplan functions with several examples.
+Several CDR enhancements including CDR variables.
+Attended Transfer
+One Touch Record
+Native Music On Hold
+Pluggable config backend (res_config)
+Realtime Caching options and SIP/IAX clusterability
+IAX codec preferences
+Modifications to the manager API to disable events.
+command line '-t' flag to allow recording/voicemail on nfs shares.
+#exec parser in config files.
+setvar from iax and sip peers.
+mulit-line comments in config files.
 	anthmct at yahoo.com              http://www.asterlink.com
 
 James Golovich - Innumerable contributions

Modified: team/group/asterisk-imap/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/UPGRADE.txt?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/UPGRADE.txt (original)
+++ team/group/asterisk-imap/UPGRADE.txt Tue Aug  8 14:37:59 2006
@@ -240,6 +240,10 @@
 * Builtin transfer functionality sets the variable ${TRANSFERERNAME} in the new
   created channel. This variables holds the channel name of the transferer.
 
+* The dial plan variable PRI_CAUSE will be removed from future versions 
+  of Asterisk.
+  It is replaced by adding a cause value to the hangup() application.
+
 Functions:
 
 * The function ${CHECK_MD5()} has been deprecated in favor of using an

Modified: team/group/asterisk-imap/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/app_chanspy.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/app_chanspy.c (original)
+++ team/group/asterisk-imap/apps/app_chanspy.c Tue Aug  8 14:37:59 2006
@@ -260,7 +260,7 @@
 		       const struct ast_flags *flags) 
 {
 	struct chanspy_translation_helper csth;
-	int running, res, x = 0;
+	int running = 0, res, x = 0;
 	char inp[24] = {0};
 	char *name;
 	struct ast_frame *f;

Modified: team/group/asterisk-imap/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/app_dial.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/app_dial.c (original)
+++ team/group/asterisk-imap/apps/app_dial.c Tue Aug  8 14:37:59 2006
@@ -37,6 +37,7 @@
 #include <stdio.h>
 #include <sys/time.h>
 #include <sys/signal.h>
+#include <sys/stat.h>
 #include <netinet/in.h>
 
 #include "asterisk/lock.h"
@@ -1001,7 +1002,13 @@
 			   unless it is already there-- this should be done before the 
 			   call is actually dialed  */
 
-			/* make sure the priv-callerintros dir exists? */
+			/* make sure the priv-callerintros dir actually exists */
+			snprintf(privintro, sizeof(privintro), "%s/sounds/priv-callerintros", ast_config_AST_DATA_DIR);
+			if (mkdir(privintro, 0755) && errno != EEXIST) {
+				ast_log(LOG_WARNING, "privacy: can't create directory priv-callerintros: %s\n", strerror(errno));
+				res = -1;
+				goto out;
+			}
 
 			snprintf(privintro,sizeof(privintro), "priv-callerintros/%s", privcid);
 			if( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) {

Modified: team/group/asterisk-imap/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/app_followme.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/app_followme.c (original)
+++ team/group/asterisk-imap/apps/app_followme.c Tue Aug  8 14:37:59 2006
@@ -158,10 +158,10 @@
 static char takecall[20] = "1", nextindp[20] = "2";
 static char callfromprompt[PATH_MAX] = "followme/call-from";
 static char norecordingprompt[PATH_MAX] = "followme/no-recording";
-static char optionsprompt[PATH_MAX] = "followme/followme-options";
+static char optionsprompt[PATH_MAX] = "followme/options";
 static char plsholdprompt[PATH_MAX] = "followme/pls-hold-while-try";
-static char statusprompt[PATH_MAX] = "followme/followme-status";
-static char sorryprompt[PATH_MAX] = "followme/followme-sorry";
+static char statusprompt[PATH_MAX] = "followme/status";
+static char sorryprompt[PATH_MAX] = "followme/sorry";
 
 
 static AST_LIST_HEAD_STATIC(followmes, ast_call_followme);
@@ -327,23 +327,23 @@
 	if (!ast_strlen_zero(tmpstr))
 		ast_copy_string(callfromprompt, tmpstr, sizeof(callfromprompt));
 
-	tmpstr = ast_variable_retrieve(cfg, "general", "followme-norecording-prompt");
+	tmpstr = ast_variable_retrieve(cfg, "general", "norecording-prompt");
 	if (!ast_strlen_zero(tmpstr))
 		ast_copy_string(norecordingprompt, tmpstr, sizeof(norecordingprompt));
 
-	tmpstr = ast_variable_retrieve(cfg, "general", "followme-options-prompt");
+	tmpstr = ast_variable_retrieve(cfg, "general", "options-prompt");
 	if (!ast_strlen_zero(tmpstr))
 		ast_copy_string(optionsprompt, tmpstr, sizeof(optionsprompt));
 
-	tmpstr = ast_variable_retrieve(cfg, "general", "followme-pls-hold-prompt");
+	tmpstr = ast_variable_retrieve(cfg, "general", "pls-hold-prompt");
 	if (!ast_strlen_zero(tmpstr))
 		ast_copy_string(plsholdprompt, tmpstr, sizeof(plsholdprompt));
 
-	tmpstr = ast_variable_retrieve(cfg, "general", "followme-status-prompt");
+	tmpstr = ast_variable_retrieve(cfg, "general", "status-prompt");
 	if (!ast_strlen_zero(tmpstr))
 		ast_copy_string(statusprompt, tmpstr, sizeof(statusprompt));
 
-	tmpstr = ast_variable_retrieve(cfg, "general", "followme-sorry-prompt");
+	tmpstr = ast_variable_retrieve(cfg, "general", "sorry-prompt");
 	if (!ast_strlen_zero(tmpstr))
 		ast_copy_string(sorryprompt, tmpstr, sizeof(sorryprompt));
 

Modified: team/group/asterisk-imap/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/app_queue.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/app_queue.c (original)
+++ team/group/asterisk-imap/apps/app_queue.c Tue Aug  8 14:37:59 2006
@@ -2135,7 +2135,6 @@
 		/* If we have timed out, break out */
 		if (qe->expire && (time(NULL) > qe->expire)) {
 			*reason = QUEUE_TIMEOUT;
-			ast_queue_log(qe->parent->name, qe->chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d", qe->pos);
 			break;
 		}
 

Modified: team/group/asterisk-imap/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/apps/app_voicemail.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/apps/app_voicemail.c (original)
+++ team/group/asterisk-imap/apps/app_voicemail.c Tue Aug  8 14:37:59 2006
@@ -332,6 +332,7 @@
 #ifdef IMAP_STORAGE
 		char imapuser[80];	/* IMAP server login */
 #endif
+	double volgain;		/*!< Volume gain for voicemails sent via email */
 	AST_LIST_ENTRY(ast_vm_user) list;
 };
 
@@ -519,6 +520,7 @@
 static char externnotify[160]; 
 static struct ast_smdi_interface *smdi_iface = NULL;
 static char vmfmts[80];
+static double volgain;
 static int vmminmessage;
 static int vmmaxmessage;
 static int maxgreet;
@@ -565,6 +567,7 @@
 		ast_copy_string(vmu->exit, exitcontext, sizeof(vmu->exit));
 	if (maxmsg)
 		vmu->maxmsg = maxmsg;
+	vmu->volgain = volgain;
 }
 
 static void apply_option(struct ast_vm_user *vmu, const char *var, const char *value)
@@ -625,6 +628,8 @@
 			ast_log(LOG_WARNING, "Maximum number of messages per folder is %i. Cannot accept value maxmsg=%s\n", MAXMSGLIMIT, value);
 			vmu->maxmsg = MAXMSGLIMIT;
 		}
+	} else if (!strcasecmp(var, "volgain")) {
+		sscanf(value, "%lf", &vmu->volgain);
 	} else if (!strcasecmp(var, "options")) {
 		apply_options(vmu, value);
 	}
@@ -1888,6 +1893,7 @@
 	char dur[256];
 	char tmp[80] = "/tmp/astmail-XXXXXX";
 	char tmp2[256];
+	char tmpcmd[256];
 	struct tm tm;
 
 	if (vmu && ast_strlen_zero(vmu->email)) {
@@ -2015,7 +2021,19 @@
 		if (attach_user_voicemail) {
 			/* Eww. We want formats to tell us their own MIME type */
 			char *ctype = (!strcasecmp(format, "ogg")) ?  "application/" : "audio/x-";
+			char tmpdir[256], newtmp[256];
+			int tmpfd;
 		
+			create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, vmu->mailbox, "tmp");
+			snprintf(newtmp, sizeof(newtmp), "%s/XXXXXX", tmpdir);
+			tmpfd = mkstemp(newtmp);
+			ast_log(LOG_DEBUG, "newtmp: %s\n", newtmp);
+			if (vmu->volgain < -.001 || vmu->volgain > .001) {
+				snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, attach, format, newtmp, format);
+				ast_safe_system(tmpcmd);
+				attach = newtmp;
+				ast_log(LOG_DEBUG, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", attach, format, vmu->volgain, mailbox);
+			}
 			fprintf(p, "--%s\n", bound);
 			fprintf(p, "Content-Type: %s%s; name=\"msg%04d.%s\"\n", ctype, format, msgnum, format);
 			fprintf(p, "Content-Transfer-Encoding: base64\n");
@@ -2039,6 +2057,9 @@
 			}
 #endif
 			fprintf(p, "\n\n--%s--\n.\n", bound);
+			if (tmpfd > -1)
+				close(tmpfd);
+			unlink(newtmp);
 		}
 		fclose(p);
 		snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
@@ -6903,6 +6924,7 @@
 	char *exitcxt = NULL;	
 	char *extpc;
 	char *emaildateformatstr;
+	char *volgainstr;
 	int x;
 	int tmpadsi[4];
 
@@ -6932,6 +6954,10 @@
 		if (!(astsearch = ast_variable_retrieve(cfg, "general", "searchcontexts")))
 			astsearch = "no";
 		ast_set2_flag((&globalflags), ast_true(astsearch), VM_SEARCH);
+
+		volgain = 0.0;
+		if ((volgainstr = ast_variable_retrieve(cfg, "general", "volgain")))
+			sscanf(volgainstr, "%lf", &volgain);
 
 #ifdef ODBC_STORAGE
 		strcpy(odbc_database, "asterisk");

Modified: team/group/asterisk-imap/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/asterisk.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/asterisk.c (original)
+++ team/group/asterisk-imap/asterisk.c Tue Aug  8 14:37:59 2006
@@ -746,23 +746,9 @@
 	ast_network_puts(string);
 }
 
-static void network_verboser(const char *s, int pos, int replace, int complete)
-	/* ARGUSED */
-{
-	if (replace) {
-		char *t;
-		if ((t = alloca(strlen(s) + 2))) {
-			sprintf(t, "\r%s", s);
-			if (complete)
-				ast_network_puts_mutable(t);
-		} else {
-			ast_log(LOG_ERROR, "Out of memory\n");
-			ast_network_puts_mutable(s);
-		}
-	} else {
-		if (complete)
-			ast_network_puts_mutable(s);
-	}
+static void network_verboser(const char *s)
+{
+	ast_network_puts_mutable(s);
 }
 
 static pthread_t lthread;
@@ -1203,29 +1189,25 @@
 	return NULL;
 }
 
-static void console_verboser(const char *s, int pos, int replace, int complete)
+static void console_verboser(const char *s)
 {
 	char tmp[80];
 	const char *c = NULL;
-	/* Return to the beginning of the line */
-	if (!pos) {
-		fprintf(stdout, "\r");
-		if ((c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_4)) ||
-			(c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_3)) ||
-			(c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_2)) ||
-			(c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_1)))
-			fputs(tmp, stdout);
-	}
-	if (c)
-		fputs(c + pos,stdout);
-	else
-		fputs(s + pos,stdout);
+
+	if ((c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_4)) ||
+	    (c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_3)) ||
+	    (c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_2)) ||
+	    (c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_1))) {
+		fputs(tmp, stdout);
+		fputs(c, stdout);
+	} else
+		fputs(s, stdout);
+
 	fflush(stdout);
-	if (complete) {
-		/* Wake up a poll()ing console */
-		if (ast_opt_console && consolethread != AST_PTHREADT_NULL)
-			pthread_kill(consolethread, SIGURG);
-	}
+	
+	/* Wake up a poll()ing console */
+	if (ast_opt_console && consolethread != AST_PTHREADT_NULL)
+		pthread_kill(consolethread, SIGURG);
 }
 
 static int ast_all_zeros(char *s)
@@ -2427,6 +2409,14 @@
 		}
 	}
 
+	if (ast_opt_console || option_verbose || (ast_opt_remote && !ast_opt_exec)) {
+		ast_register_verbose(console_verboser);
+		WELCOME_MESSAGE;
+	}
+
+	if (ast_opt_console && !option_verbose) 
+		ast_verbose("[ Booting...\n");
+
 	if (ast_opt_always_fork && (ast_opt_remote || ast_opt_console)) {
 		ast_log(LOG_WARNING, "'alwaysfork' is not compatible with console or remote console mode; ignored\n");
 		ast_clear_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK);
@@ -2443,7 +2433,7 @@
 	}
 
 	if (ast_opt_console && !option_verbose) 
-		ast_verbose("[ Reading Master Configuration ]");
+		ast_verbose("[ Reading Master Configuration ]\n");
 	ast_readconfig();
 
 	if (ast_opt_dump_core) {
@@ -2526,7 +2516,7 @@
 	fflush(stdout);
 
 	if (ast_opt_console && !option_verbose) 
-		ast_verbose("[ Initializing Custom Configuration Options ]");
+		ast_verbose("[ Initializing Custom Configuration Options ]\n");
 	/* custom config setup */
 	register_config_cli();
 	read_config_maps();
@@ -2548,8 +2538,6 @@
 				exit(0);
 			}
 			printf(term_quit());
-			ast_register_verbose(console_verboser);
-			WELCOME_MESSAGE;
 			ast_remotecontrol(NULL);
 			quit_handler(0, 0, 0, 0);
 			exit(0);
@@ -2597,15 +2585,6 @@
 	sigaddset(&sigs, SIGPIPE);
 	sigaddset(&sigs, SIGWINCH);
 	pthread_sigmask(SIG_BLOCK, &sigs, NULL);
-	if (ast_opt_console || option_verbose || ast_opt_remote)
-		ast_register_verbose(console_verboser);
-	/* Print a welcome message if desired */
-	if (option_verbose || ast_opt_console) {
-		WELCOME_MESSAGE;
-	}
-	if (ast_opt_console && !option_verbose) 
-		ast_verbose("[ Booting...");
-
 	signal(SIGURG, urg_handler);
 	signal(SIGINT, __quit_handler);
 	signal(SIGTERM, __quit_handler);

Modified: team/group/asterisk-imap/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/channel.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/channel.c (original)
+++ team/group/asterisk-imap/channel.c Tue Aug  8 14:37:59 2006
@@ -66,6 +66,7 @@
 #include "asterisk/transcap.h"
 #include "asterisk/devicestate.h"
 #include "asterisk/sha1.h"
+#include "asterisk/threadstorage.h"
 #include "asterisk/slinfactory.h"
 
 struct channel_spy_trans {
@@ -99,8 +100,7 @@
 
 unsigned long global_fin = 0, global_fout = 0;
 
-static pthread_key_t state2str_buf_key;
-static pthread_once_t state2str_buf_once = PTHREAD_ONCE_INIT;
+AST_THREADSTORAGE(state2str_threadbuf, state2str_threadbuf_init);
 #define STATE2STR_BUFSIZE   32
 
 struct chanlist {
@@ -167,15 +167,6 @@
 	{ AST_CAUSE_INTERWORKING, "INTERWORKING", "Interworking, unspecified" },
 };
 
-#ifdef __AST_DEBUG_MALLOC
-static void FREE(void *ptr)
-{
-	free(ptr);
-}
-#else
-#define FREE free
-#endif
-
 struct ast_variable *ast_channeltype_list(void)
 {
 	struct chanlist *cl;
@@ -500,11 +491,6 @@
 	return -1;
 }
 
-static void state2str_buf_key_create(void)
-{
-	pthread_key_create(&state2str_buf_key, FREE);
-}
- 
 /*! \brief Gives the string form of a given channel state */
 char *ast_state2str(int state)
 {
@@ -527,14 +513,14 @@
 		return "Up";
 	case AST_STATE_BUSY:
 		return "Busy";
+	case AST_STATE_DIALING_OFFHOOK:
+		return "Dialing Offhook";
+	case AST_STATE_PRERING:
+		return "Pre-ring";
 	default:
-		pthread_once(&state2str_buf_once, state2str_buf_key_create);
-		if (!(buf = pthread_getspecific(state2str_buf_key))) {
-			if (!(buf = ast_malloc(STATE2STR_BUFSIZE)))
-				return NULL;
-			pthread_setspecific(state2str_buf_key, buf);
-		}
-		snprintf(buf, STATE2STR_BUFSIZE, "Unknown (%d)\n", state);
+		if (!(buf = ast_threadstorage_get(&state2str_threadbuf, STATE2STR_BUFSIZE)))
+			return "Unknown";
+		snprintf(buf, STATE2STR_BUFSIZE, "Unknown (%d)", state);
 		return buf;
 	}
 }
@@ -1498,10 +1484,16 @@
 		return 0;
 	}
 	free_translation(chan);
-	if (chan->stream) 		/* Close audio stream */
+	/* Close audio stream */
+	if (chan->stream) {
 		ast_closestream(chan->stream);
-	if (chan->vstream)		/* Close video stream */
+		chan->stream = NULL;
+	}
+	/* Close video stream */
+	if (chan->vstream) {
 		ast_closestream(chan->vstream);
+		chan->vstream = NULL;
+	}
 	if (chan->sched) {
 		sched_context_destroy(chan->sched);
 		chan->sched = NULL;
@@ -3357,8 +3349,7 @@
 
 	chan->_state = state;
 	ast_device_state_changed_literal(chan->name);
-	manager_event(EVENT_FLAG_CALL,
-		      (oldstate == AST_STATE_DOWN) ? "Newchannel" : "Newstate",
+	manager_event(EVENT_FLAG_CALL, "Newstate",
 		      "Channel: %s\r\n"
 		      "State: %s\r\n"
 		      "CallerID: %s\r\n"
@@ -3625,7 +3616,7 @@
 	}
 
 	for (/* ever */;;) {
-		struct timeval now;
+		struct timeval now = { 0, };
 		int to;
 
 		to = -1;

Modified: team/group/asterisk-imap/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-imap/channels/chan_h323.c?rev=39399&r1=39398&r2=39399&view=diff
==============================================================================
--- team/group/asterisk-imap/channels/chan_h323.c (original)
+++ team/group/asterisk-imap/channels/chan_h323.c Tue Aug  8 14:37:59 2006
@@ -796,18 +796,19 @@
 		if (pvt->amaflags) {
 			ch->amaflags = pvt->amaflags;
 		}
-		/*
-		 * If cid_num and cd.call_source_e164 are both null, then
-		 * ast_set_callerid will do the right thing and leave the
-		 * cid_num and cid_ani for the channel alone.
-		 */
-		ast_set_callerid(ch,
-			!ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164,
-			!ast_strlen_zero(pvt->cid_name) ? pvt->cid_name : pvt->cd.call_source_name,
-			!ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164);
-		if (!ast_strlen_zero(pvt->rdnis)) {
-			ch->cid.cid_rdnis = strdup(pvt->rdnis);
-		}
+		
+		/* Don't use ast_set_callerid() here because it will
+		 * generate a NewCallerID event before the NewChannel event */
+		if (!ast_strlen_zero(pvt->cid_num)) {
+			ch->cid.cid_num = ast_strdup(pvt->cid_num);
+			ch->cid.cid_ani = ast_strdup(pvt->cid_num);
+		} else {
+			ch->cid.cid_num = ast_strdup(pvt->cd.call_source_e164);
+			ch->cid.cid_ani = ast_strdup(pvt->cd.call_source_e164);
+		}
+		ch->cid.cid_name = ast_strdup(pvt->cid_name);
+		ch->cid.cid_rdnis = ast_strdup(pvt->rdnis);
+		
 		if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
 			ch->cid.cid_dnid = strdup(pvt->exten);
 		}


[... 7286 lines stripped ...]


More information about the asterisk-commits mailing list