[asterisk-commits] rmudgett: branch rmudgett/misdn_facility r168731 - in /team/rmudgett/misdn_fa...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 15 13:47:02 CST 2009


Author: rmudgett
Date: Thu Jan 15 13:47:02 2009
New Revision: 168731

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168731
Log:
Resolved conflicts in channels/chan_misdn.c and restart automerge.

Merged revisions 168555,168635,168651 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/issue8824

................
  r168555 | rmudgett | 2009-01-13 12:47:57 -0600 (Tue, 13 Jan 2009) | 6 lines
  
  Expand upon JIRA ABE-1747 in relation to AST-165
  *  Added the following new parameters: unknownprefix, netspecificprefix,
  subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
  received number from the ISDN link if that number has the corresponding
  Type-Of-Number.
................
  r168635 | rmudgett | 2009-01-14 21:23:18 -0600 (Wed, 14 Jan 2009) | 345 lines
  
  Resolved conflicts in channels/chan_misdn.c
  
  Merged revisions 168479,168481,168485,168497,168508,168517,168522-168523,168526,168539,168547,168562,168575,168578-168579,168585,168588,168591,168594,168599,168601,168604,168609-168610,168613,168615,168619,168623 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/trunk
  
  ................
    r168479 | oej | 2009-01-12 08:35:09 -0600 (Mon, 12 Jan 2009) | 2 lines
    
    Don't include swap.h unless we have swapctl
  ................
    r168481 | russell | 2009-01-12 08:57:49 -0600 (Mon, 12 Jan 2009) | 10 lines
    
    Merged revisions 168480 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
    r168480 | russell | 2009-01-12 08:57:27 -0600 (Mon, 12 Jan 2009) | 2 lines
    
    s/ringdance/ringcadence/ for Bulgaria
    
    ........
  ................
    r168485 | mmichelson | 2009-01-12 09:00:00 -0600 (Mon, 12 Jan 2009) | 13 lines
    
    Merged revisions 168482 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
    r168482 | mmichelson | 2009-01-12 08:58:25 -0600 (Mon, 12 Jan 2009) | 5 lines
    
    I am reverting the fix made in revision 168128 (and its upward merges)
    after being contacted by Olle Johansson and being shown how this fix is
    incorrect. Thanks to Olle for clearing this up for me.
    
    
    ........
  ................
    r168497 | oej | 2009-01-12 10:31:27 -0600 (Mon, 12 Jan 2009) | 2 lines
    
    Better to use the proper app name
  ................
    r168508 | jpeeler | 2009-01-12 14:53:04 -0600 (Mon, 12 Jan 2009) | 15 lines
    
    Merged revisions 168507 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168507 | jpeeler | 2009-01-12 14:26:22 -0600 (Mon, 12 Jan 2009) | 9 lines
      
      (closes issue #12269)
      Reported by: IgorG
      Tested by: denisgalvao
      
      This gits rid of the notion of an owning_app allowing the request and hangup to be initiated by different threads. Originating from an active agent channel requires this. The implementation primarily changes __login_exec to wait on a condition variable rather than a lock.
      
      Review: http://reviewboard.digium.com/r/35/
    ........
  ................
    r168517 | jpeeler | 2009-01-12 15:51:46 -0600 (Mon, 12 Jan 2009) | 12 lines
    
    Merged revisions 168516 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168516 | jpeeler | 2009-01-12 15:42:34 -0600 (Mon, 12 Jan 2009) | 5 lines
      
      (closes issue #13881)
      Reported by: hoowa
      
      Update the app CDR field for AGI commands that are not executing an application via "exec".
    ........
  ................
    r168522 | tilghman | 2009-01-12 17:06:12 -0600 (Mon, 12 Jan 2009) | 3 lines
    
    Some platforms (notably, the BSDs) have a more efficient implementation called
    closefrom(3).
  ................
    r168523 | mmichelson | 2009-01-12 17:12:30 -0600 (Mon, 12 Jan 2009) | 11 lines
    
    bump the verbosity of a message in srv.c up by one. It used to be
    at this level prior to a large patch merge which converted ast_verbose
    calls to ast_verb
    
    (closes issue #14221)
    Reported by: jcovert
    Patches:
          srv.c.patch uploaded by jcovert (license 551)
  ................
    r168526 | tilghman | 2009-01-12 17:45:51 -0600 (Mon, 12 Jan 2009) | 12 lines
    
    Merged revisions 167095 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r167095 | tilghman | 2008-12-31 18:01:22 -0600 (Wed, 31 Dec 2008) | 5 lines
      
      Repeat attempts to write when we receive -EAGAIN from the driver, as detailed
      in the ALSA sample code (see http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a32)
      Reported by: Jerry Geis (via the -users list)
      Fixed by: me (license 14)
    ........
  ................
    r168539 | dhubbard | 2009-01-13 10:02:13 -0600 (Tue, 13 Jan 2009) | 1 line
    
    correct a CLI description
  ................
    r168547 | tilghman | 2009-01-13 11:51:12 -0600 (Tue, 13 Jan 2009) | 13 lines
    
    Merged revisions 168546 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168546 | tilghman | 2009-01-13 11:48:00 -0600 (Tue, 13 Jan 2009) | 6 lines
      
      If either conditional is NULL, don't try copying it.
      (closes issue #14226)
       Reported by: caspy
       Patches: 
             20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)
    ........
  ................
    r168562 | russell | 2009-01-13 13:22:13 -0600 (Tue, 13 Jan 2009) | 10 lines
    
    Merged revisions 168561 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
    r168561 | russell | 2009-01-13 13:13:05 -0600 (Tue, 13 Jan 2009) | 2 lines
    
    Revert unnecessary indications API change from rev 122314
    
    ........
  ................
    r168575 | mmichelson | 2009-01-13 15:18:13 -0600 (Tue, 13 Jan 2009) | 13 lines
    
    Allow specifying a port number in the user portion of a register => line in sip.conf
    
    With this commit, a register => line in sip.conf may contain a port number in the
    "user" section of the line. Please see CHANGES and sip.conf.sample for more
    details regarding this.
    
    (closes issue #14198)
    Reported by: Nick_Lewis
    Patches:
          chan_sip.c-domainport2.patch uploaded by Nick (license 657)
    Tested by: Nick_Lewis
  ................
    r168578 | twilson | 2009-01-13 16:22:34 -0600 (Tue, 13 Jan 2009) | 14 lines
    
    Merged revisions 168551 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168551 | twilson | 2009-01-13 12:34:14 -0600 (Tue, 13 Jan 2009) | 7 lines
      
      Don't pass a value with a side effect to a macro
      
      (closes issue #14176)
      Reported by: paraeco
      Patches: 
            chan_sip.c.diff uploaded by paraeco (license 658)
    ........
  ................
    r168579 | mmichelson | 2009-01-13 16:30:59 -0600 (Tue, 13 Jan 2009) | 13 lines
    
    Clarify a message that app_queue prints and change to a debug-level message
    
    The "No one is answering..." verbose message contained 3 numbers that were not
    explained in any way to whoever was viewing the message. It is more helpful now
    since the message explains what the numbers mean. Also, the message has been
    downgraded to "DEBUG" level.
    
    (closes issue #14172)
    Reported by: caio1982
    Patches:
          queue_answering_debug.diff uploaded by caio1982 (license 22)
  ................
    r168585 | twilson | 2009-01-13 17:00:27 -0600 (Tue, 13 Jan 2009) | 8 lines
    
    Add option to hide console connect messages
    
    (closes issue #14222)
    Reported by: jamesgolovich
    Patches: 
          asterisk-hideconnect.diff.txt uploaded by jamesgolovich (license 176)
    Tested by: otherwiseguy
  ................
    r168588 | twilson | 2009-01-13 17:05:43 -0600 (Tue, 13 Jan 2009) | 5 lines
    
    Fully overwrite a same-named file when uploading
    
    (closes issue #14190)
    Reported by: timking
  ................
    r168591 | tilghman | 2009-01-13 17:57:46 -0600 (Tue, 13 Jan 2009) | 6 lines
    
    Janitor patch for chan_misdn (make channel variable access safe)
    (closes issue #12887)
     Reported by: pputman
     Patches: 
           chan_misdn_threadsafe.patch uploaded by pputman (license 81)
  ................
    r168594 | twilson | 2009-01-13 20:00:40 -0600 (Tue, 13 Jan 2009) | 27 lines
    
    Merged revisions 168593 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168593 | twilson | 2009-01-13 19:27:18 -0600 (Tue, 13 Jan 2009) | 20 lines
      
      Don't overflow when paging more than 128 extensions
      
      The number of available slots for calls in app_page was hardcoded to 128.
      Proper bounds checking was not in place to enforce this limit, so if more than
      128 extensions were passed to the Page() app, Asterisk would crash.  This patch
      instead dynamically allocates memory for the ast_dial structures and removes
      the (non-functional) arbitrary limit.
      
      This issue would have special importance to anyone who is dynamically creating
      the argument passed to the Page application and allowing more than 128
      extensions to be added by an outside user via some external interface.
      
      The patch posted by a_villacis was slightly modified for some coding guidelines
      and other cleanups.  Thanks, a_villacis!
      (closes issue #14217)
      Reported by: a_villacis
      Patches: 
            20080912-asterisk-app_page-fix-buffer-overflow.patch uploaded by a (license 660)
      Tested by: otherwiseguy
    ........
  ................
    r168599 | mmichelson | 2009-01-14 10:20:37 -0600 (Wed, 14 Jan 2009) | 15 lines
    
    Blocked revisions 168598 via svnmerge
    
    ........
    r168598 | mmichelson | 2009-01-14 10:19:26 -0600 (Wed, 14 Jan 2009) | 8 lines
    
    Fix a logic error I found while searching through chan_agent.c
    
    I found that the allow_multiple_logins function would never return
    0 due to an incorrect comparison being used when traversing the
    list of agents. While I was modifying this function, I also did
    a little bit of coding guidelines cleanup, too.
    
    
    ........
  ................
    r168601 | tilghman | 2009-01-14 12:27:57 -0600 (Wed, 14 Jan 2009) | 2 lines
    
    Mostly spacing changes; no functionality change at all.
  ................
    r168604 | tilghman | 2009-01-14 13:11:14 -0600 (Wed, 14 Jan 2009) | 14 lines
    
    Merged revisions 168603 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168603 | tilghman | 2009-01-14 13:02:55 -0600 (Wed, 14 Jan 2009) | 7 lines
      
      Don't read into a buffer without first checking if a value is beyond the end.
      (closes issue #13600)
       Reported by: atis
       Patches: 
             20090106__bug13600.diff.txt uploaded by Corydon76 (license 14)
       Tested by: atis
    ........
  ................
    r168609 | mvanbaak | 2009-01-14 13:36:57 -0600 (Wed, 14 Jan 2009) | 13 lines
    
    Fix compilation on FreeBSD and OSX
    
    This started as work to fix the 'core show sysinfo'
    CLI command but while working on it oej
    pointed out that read_credentials did not compile neither.
    So while being there, fix that as well.
    
    Thanks for all the testing oej!
    
    (closes issue #14129)
    Reported by: ys
    Tested by: oej, mvanbaak
  ................
    r168610 | mmichelson | 2009-01-14 14:13:48 -0600 (Wed, 14 Jan 2009) | 9 lines
    
    Restore the "sip show users" and "sip show user" CLI commands
    
    (closes issue #14180)
    Reported by: amorsen
    Patches:
          sip_show_users_161v3.diff uploaded by putnopvut (license 60)
    Tested by: blitzrage, amorsen
  ................
    r168613 | murf | 2009-01-14 14:51:26 -0600 (Wed, 14 Jan 2009) | 9 lines
    
    Merged revisions 168608 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168608 | murf | 2009-01-14 12:34:35 -0700 (Wed, 14 Jan 2009) | 1 line
      
      app_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets rid of the warning.
    ........
  ................
    r168615 | seanbright | 2009-01-14 14:58:26 -0600 (Wed, 14 Jan 2009) | 16 lines
    
    Merged revisions 168614 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168614 | seanbright | 2009-01-14 15:52:00 -0500 (Wed, 14 Jan 2009) | 9 lines
      
      Update autosupport script to supply info for both Zaptel and DAHDI in 1.4 and
      be sure to run dahdi_test in 1.6.x and trunk instead of zttest.
      
      (closes issue #14132)
      Reported by: dsedivec
      Patches:
            asterisk-1.4-autosupport.patch uploaded by dsedivec (license 638)
            asterisk-trunk-autosupport.patch uploaded by dsedivec (license 638)
    ........
  ................
    r168619 | dbailey | 2009-01-14 15:19:45 -0600 (Wed, 14 Jan 2009) | 8 lines
    
    This fixes a problem where MWI FSK spills were being injected onto off hook fxs lines.
    (closes issue #14143)
    Reported by: alecdavis
    Patches:
          chan_dahdi-14143.patch.txt uploaded by dbailey (license )
    Tested by: alecdavis
  ................
    r168623 | rmudgett | 2009-01-14 15:51:06 -0600 (Wed, 14 Jan 2009) | 11 lines
    
    Merged revisions 168622 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r168622 | rmudgett | 2009-01-14 15:48:22 -0600 (Wed, 14 Jan 2009) | 4 lines
      
      *  Fixed create_process() allocation of process ID values.
      The allocated process IDs could overflow their respective
      NT and TE fields.  Affects outgoing calls.
    ........
  ................
................
  r168651 | root | 2009-01-15 08:39:36 -0600 (Thu, 15 Jan 2009) | 61 lines
  
  Merged revisions 168626,168629,168636,168638-168639 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r168626 | seanbright | 2009-01-14 17:10:48 -0600 (Wed, 14 Jan 2009) | 7 lines
    
    Don't crash when typing 'core set verbose' or 'core set debug' by themselves.
    
    (closes issue #14219)
    Reported by: jamesgolovich
    Patches:
          asterisk-setverbosecrash.diff.txt uploaded by jamesgolovich (license 176)
  ................
    r168629 | mmichelson | 2009-01-14 18:14:17 -0600 (Wed, 14 Jan 2009) | 24 lines
    
    Merged revisions 168628 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
    r168628 | mmichelson | 2009-01-14 18:11:01 -0600 (Wed, 14 Jan 2009) | 16 lines
    
    Fix some crashes from bad datastore handling in app_queue.c
    
    * The queue_transfer_fixup function was searching for and removing
      the datastore from the incorrect channel, so this was fixed.
    
    * Most datastore operations regarding the queue_transfer datastore
      were being done without the channel locked, so proper channel locking
      was added, too.
    
    (closes issue #14086)
    Reported by: ZX81
    Patches:
          14086v2.patch uploaded by putnopvut (license 60)
    Tested by: ZX81, festr
    
    
    ........
  ................
    r168636 | oej | 2009-01-15 07:01:52 -0600 (Thu, 15 Jan 2009) | 5 lines
    
    Add support for setting the Reason header when cancelling a call in the queue 
    because someone else answered. Previously, only dial() was supported.
    
    EDV-102
  ................
    r168638 | oej | 2009-01-15 07:35:50 -0600 (Thu, 15 Jan 2009) | 8 lines
    
    Add capability to remove added SIP headers *before* INVITE is generated.
    
    (closes issue #14246)
    Reported by: klaus3000
    Patches: 
          2patch_chan_sip_SIPRemoveHeader_trunk.txt uploaded by klaus3000 (license 65)
  ................
    r168639 | oej | 2009-01-15 07:37:46 -0600 (Thu, 15 Jan 2009) | 3 lines
    
    Related to issue #14246
    Update changes for SIPRemoveHeader()
  ................
................

Modified:
    team/rmudgett/misdn_facility/   (props changed)
    team/rmudgett/misdn_facility/CHANGES
    team/rmudgett/misdn_facility/CREDITS
    team/rmudgett/misdn_facility/Makefile
    team/rmudgett/misdn_facility/apps/app_disa.c
    team/rmudgett/misdn_facility/apps/app_minivm.c
    team/rmudgett/misdn_facility/apps/app_page.c
    team/rmudgett/misdn_facility/apps/app_queue.c
    team/rmudgett/misdn_facility/apps/app_read.c
    team/rmudgett/misdn_facility/apps/app_readexten.c
    team/rmudgett/misdn_facility/channels/chan_agent.c
    team/rmudgett/misdn_facility/channels/chan_alsa.c
    team/rmudgett/misdn_facility/channels/chan_dahdi.c
    team/rmudgett/misdn_facility/channels/chan_misdn.c
    team/rmudgett/misdn_facility/channels/chan_sip.c
    team/rmudgett/misdn_facility/channels/chan_skinny.c
    team/rmudgett/misdn_facility/channels/chan_unistim.c
    team/rmudgett/misdn_facility/channels/misdn/chan_misdn_config.h
    team/rmudgett/misdn_facility/channels/misdn_config.c
    team/rmudgett/misdn_facility/configs/indications.conf.sample
    team/rmudgett/misdn_facility/configs/misdn.conf.sample
    team/rmudgett/misdn_facility/configs/sip.conf.sample
    team/rmudgett/misdn_facility/configure
    team/rmudgett/misdn_facility/configure.ac
    team/rmudgett/misdn_facility/contrib/scripts/autosupport
    team/rmudgett/misdn_facility/funcs/func_channel.c
    team/rmudgett/misdn_facility/funcs/func_logic.c
    team/rmudgett/misdn_facility/include/asterisk/autoconfig.h.in
    team/rmudgett/misdn_facility/include/asterisk/channel.h
    team/rmudgett/misdn_facility/include/asterisk/indications.h
    team/rmudgett/misdn_facility/include/asterisk/options.h
    team/rmudgett/misdn_facility/main/app.c
    team/rmudgett/misdn_facility/main/asterisk.c
    team/rmudgett/misdn_facility/main/channel.c
    team/rmudgett/misdn_facility/main/cli.c
    team/rmudgett/misdn_facility/main/indications.c
    team/rmudgett/misdn_facility/main/pbx.c
    team/rmudgett/misdn_facility/main/srv.c
    team/rmudgett/misdn_facility/main/taskprocessor.c
    team/rmudgett/misdn_facility/main/udptl.c
    team/rmudgett/misdn_facility/res/res_agi.c
    team/rmudgett/misdn_facility/res/res_http_post.c
    team/rmudgett/misdn_facility/res/res_indications.c
    team/rmudgett/misdn_facility/res/snmp/agent.c

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- misdn-facility (original)
+++ misdn-facility Thu Jan 15 13:47:02 2009
@@ -1,1 +1,1 @@
-/team/group/issue8824:1-168360
+/team/group/issue8824:1-168708

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 15 13:47:02 2009
@@ -1,1 +1,1 @@
-/trunk:1-168343
+/trunk:1-168650

Modified: team/rmudgett/misdn_facility/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/CHANGES?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/CHANGES (original)
+++ team/rmudgett/misdn_facility/CHANGES Thu Jan 15 13:47:02 2009
@@ -39,6 +39,11 @@
   * Made use the nationalprefix and internationalprefix misdn.conf
     parameters to prefix any received number from the ISDN link if that
     number has the corresponding Type-Of-Number.
+  * Added the following new parameters: unknownprefix, netspecificprefix,
+    subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
+    received number from the ISDN link if that number has the corresponding
+    Type-Of-Number.
+
 
 SIP channel driver (chan_sip) changes
 -------------------------------------------
@@ -80,6 +85,11 @@
    option is required to interoperate with devices that have non-standard SDP
    session version implementations (observed with Microsoft OCS).  This option
    is diabled by default.
+ * The parsing of register => lines in sip.conf has been modified to allow a port
+   to be present in the "user" portion. Please see the sip.conf.sample file for more
+   information
+ * Added a function to remove SIP headers added in the dialplan before the
+   first INVITE is generated - SIPRemoveHeader()
 
 Skinny Changes
 --------------

Modified: team/rmudgett/misdn_facility/CREDITS
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/CREDITS?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/CREDITS (original)
+++ team/rmudgett/misdn_facility/CREDITS Thu Jan 15 13:47:02 2009
@@ -192,6 +192,8 @@
 	- See http://voip-info.org/users/view/sergee
 	serg(AT)voipsolutions.ru
 
+Klaus Darillon - the SIPremoveHeader function in chan_sip
+
 === OTHER CONTRIBUTIONS ===
 John Todd - Monkey sounds and associated teletorture prompt
 Michael Jerris - bug marshaling

Modified: team/rmudgett/misdn_facility/Makefile
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/Makefile?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/Makefile (original)
+++ team/rmudgett/misdn_facility/Makefile Thu Jan 15 13:47:02 2009
@@ -726,6 +726,7 @@
 		echo ";rungroup = asterisk ; The group to run as" ; \
 		echo ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
 		echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
+		echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
 		echo "" ; \
 		echo "; Changing the following lines may compromise your security." ; \
 		echo ";[files]" ; \

Modified: team/rmudgett/misdn_facility/apps/app_disa.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/apps/app_disa.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/apps/app_disa.c (original)
+++ team/rmudgett/misdn_facility/apps/app_disa.c Thu Jan 15 13:47:02 2009
@@ -124,7 +124,7 @@
 
 static void play_dialtone(struct ast_channel *chan, char *mailbox)
 {
-	const struct ind_tone_zone_sound *ts = NULL;
+	const struct tone_zone_sound *ts = NULL;
 	if(ast_app_has_voicemail(mailbox, NULL))
 		ts = ast_get_indication_tone(chan->zone, "dialrecall");
 	else

Modified: team/rmudgett/misdn_facility/apps/app_minivm.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/apps/app_minivm.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/apps/app_minivm.c (original)
+++ team/rmudgett/misdn_facility/apps/app_minivm.c Thu Jan 15 13:47:02 2009
@@ -2261,7 +2261,7 @@
 	if(!(vmu = find_account(domain, username, TRUE))) {
 		/* We could not find user, let's exit */
 		ast_log(LOG_WARNING, "Could not allocate temporary memory for '%s@%s'\n", username, domain);
-		pbx_builtin_setvar_helper(chan, "MVM_NOTIFY_STATUS", "FAILED");
+		pbx_builtin_setvar_helper(chan, "MVM_ACCMESS_STATUS", "FAILED");
 		return -1;
 	}
 
@@ -2292,7 +2292,7 @@
 	if(ast_test_flag(vmu, MVM_ALLOCED))
 		free_user(vmu);
 
-	pbx_builtin_setvar_helper(chan, "MVM_NOTIFY_STATUS", "SUCCESS");
+	pbx_builtin_setvar_helper(chan, "MVM_ACCMESS_STATUS", "SUCCESS");
 
 	/* Ok, we're ready to rock and roll. Return to dialplan */
 	return 0;

Modified: team/rmudgett/misdn_facility/apps/app_page.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/apps/app_page.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/apps/app_page.c (original)
+++ team/rmudgett/misdn_facility/apps/app_page.c Thu Jan 15 13:47:02 2009
@@ -117,7 +117,6 @@
 	AST_APP_OPTION('i', PAGE_IGNORE_FORWARDS),
 });
 
-#define MAX_DIALS 128
 
 static int page_exec(struct ast_channel *chan, void *data)
 {
@@ -127,7 +126,8 @@
 	unsigned int confid = ast_random();
 	struct ast_app *app;
 	int res = 0, pos = 0, i = 0;
-	struct ast_dial *dials[MAX_DIALS];
+	struct ast_dial **dial_list;
+	unsigned int num_dials;
 	int timeout = 0;
 	char *parse;
 
@@ -166,6 +166,18 @@
 
 	snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe,%ud,%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
 		(ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
+
+	/* Count number of extensions in list by number of ampersands + 1 */
+	num_dials = 1;
+	tmp = args.devices;
+	while (*tmp && *tmp++ == '&') {
+		num_dials++;
+	}
+
+	if (!(dial_list = ast_calloc(num_dials, sizeof(void *)))) {
+		ast_log(LOG_ERROR, "Can't allocate %ld bytes for dial list\n", (long)(sizeof(void *) * num_dials));
+		return -1;
+	}
 
 	/* Go through parsing/calling each device */
 	while ((tech = strsep(&args.devices, "&"))) {
@@ -222,7 +234,7 @@
 		ast_dial_run(dial, chan, 1);
 
 		/* Put in our dialing array */
-		dials[pos++] = dial;
+		dial_list[pos++] = dial;
 	}
 
 	if (!ast_test_flag(&flags, PAGE_QUIET)) {
@@ -239,7 +251,7 @@
 
 	/* Go through each dial attempt cancelling, joining, and destroying */
 	for (i = 0; i < pos; i++) {
-		struct ast_dial *dial = dials[i];
+		struct ast_dial *dial = dial_list[i];
 
 		/* We have to wait for the async thread to exit as it's possible Meetme won't throw them out immediately */
 		ast_dial_join(dial);

Modified: team/rmudgett/misdn_facility/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/apps/app_queue.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/apps/app_queue.c (original)
+++ team/rmudgett/misdn_facility/apps/app_queue.c Thu Jan 15 13:47:02 2009
@@ -2235,9 +2235,13 @@
 	struct callattempt *oo;
 
 	while (outgoing) {
+		/* If someone else answered the call we should indicate this in the CANCEL */
 		/* Hangup any existing lines we have open */
-		if (outgoing->chan && (outgoing->chan != exception))
+		if (outgoing->chan && (outgoing->chan != exception)) {
+			if (exception)
+				ast_set_flag(outgoing->chan, AST_FLAG_ANSWERED_ELSEWHERE);
 			ast_hangup(outgoing->chan);
+		}
 		oo = outgoing;
 		outgoing = outgoing->q_next;
 		if (oo->member)
@@ -2782,7 +2786,7 @@
 			if (numlines == (numbusies + numnochan)) {
 				ast_debug(1, "Everyone is busy at this time\n");
 			} else {
-				ast_log(LOG_NOTICE, "No one is answering queue '%s' (%d/%d/%d)\n", queue, numlines, numbusies, numnochan);
+				ast_debug(3, "No one is answering queue '%s' (%d numlines / %d busies / %d failed channels)\n", queue, numlines, numbusies, numnochan);
 			}
 			*to = 0;
 			return NULL;
@@ -3402,8 +3406,9 @@
 
 	update_queue(qe->parent, member, callcompletedinsl, (time(NULL) - callstart));
 	
-	if ((datastore = ast_channel_datastore_find(new_chan, &queue_transfer_info, NULL))) {
-		ast_channel_datastore_remove(new_chan, datastore);
+	/* No need to lock the channels because they are already locked in ast_do_masquerade */
+	if ((datastore = ast_channel_datastore_find(old_chan, &queue_transfer_info, NULL))) {
+		ast_channel_datastore_remove(old_chan, datastore);
 	} else {
 		ast_log(LOG_WARNING, "Can't find the queue_transfer datastore.\n");
 	}
@@ -3414,6 +3419,8 @@
  * When a caller is atxferred, then the queue_transfer_info datastore
  * is removed from the channel. If it's still there after the bridge is
  * broken, then the caller was not atxferred.
+ *
+ * \note Only call this with chan locked
  */
 static int attended_transfer_occurred(struct ast_channel *chan)
 {
@@ -3752,9 +3759,11 @@
 	 * to which the datastore was moved hangs up, it will attempt to free this
 	 * datastore again, causing a crash
 	 */
+	ast_channel_lock(qe->chan);
 	if (datastore && !ast_channel_datastore_remove(qe->chan, datastore)) {
 		ast_datastore_free(datastore);
 	}
+	ast_channel_unlock(qe->chan);
 	ao2_lock(qe->parent);
 	if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
 		store_next_rr(qe, outgoing);
@@ -4163,6 +4172,7 @@
 		/* If the queue member did an attended transfer, then the TRANSFER already was logged in the queue_log
 		 * when the masquerade occurred. These other "ending" queue_log messages are unnecessary
 		 */
+		ast_channel_lock(qe->chan);
 		if (!attended_transfer_occurred(qe->chan)) {
 			struct ast_datastore *tds;
 			if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
@@ -4179,17 +4189,16 @@
 					(long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
 				send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
 			}
-			ast_channel_lock(qe->chan);
-			if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {
+			if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {	
 				ast_channel_datastore_remove(qe->chan, tds);
 			}
-			ast_channel_unlock(qe->chan);
 			update_queue(qe->parent, member, callcompletedinsl, (time(NULL) - callstart));
 		}
 
 		if (transfer_ds) {
 			ast_datastore_free(transfer_ds);
 		}
+		ast_channel_unlock(qe->chan);
 		ast_hangup(peer);
 		res = bridge ? bridge : 1;
 		ao2_ref(member, -1);

Modified: team/rmudgett/misdn_facility/apps/app_read.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/apps/app_read.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/apps/app_read.c (original)
+++ team/rmudgett/misdn_facility/apps/app_read.c Thu Jan 15 13:47:02 2009
@@ -132,7 +132,7 @@
 	int tries = 1, to = 0, x = 0;
 	double tosec;
 	char *argcopy = NULL;
-	struct ind_tone_zone_sound *ts = NULL;
+	struct tone_zone_sound *ts = NULL;
 	struct ast_flags flags = {0};
 	const char *status = "ERROR";
 

Modified: team/rmudgett/misdn_facility/apps/app_readexten.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/apps/app_readexten.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/apps/app_readexten.c (original)
+++ team/rmudgett/misdn_facility/apps/app_readexten.c Thu Jan 15 13:47:02 2009
@@ -132,7 +132,7 @@
 	int maxdigits = sizeof(exten) - 1;
 	int timeout = 0, digit_timeout = 0, x = 0;
 	char *argcopy = NULL, *status = "";
-	struct ind_tone_zone_sound *ts = NULL;
+	struct tone_zone_sound *ts = NULL;
 	struct ast_flags flags = {0};
 
 	 AST_DECLARE_APP_ARGS(arglist,

Modified: team/rmudgett/misdn_facility/channels/chan_agent.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/channels/chan_agent.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/channels/chan_agent.c (original)
+++ team/rmudgett/misdn_facility/channels/chan_agent.c Thu Jan 15 13:47:02 2009
@@ -256,7 +256,8 @@
 	char name[AST_MAX_AGENT];
 	int inherited_devicestate;     /*!< Does the underlying channel have a devicestate to pass? */
 	ast_mutex_t app_lock;          /**< Synchronization between owning applications */
-	volatile pthread_t owning_app; /**< Owning application thread id */
+	int app_lock_flag;
+	ast_cond_t app_complete_cond;
 	volatile int app_sleep_cond;   /**< Sleep condition for the login app */
 	struct ast_channel *owner;     /**< Agent */
 	char loginchan[80];            /**< channel they logged in from */
@@ -451,7 +452,8 @@
 		ast_copy_string(p->agent, agt, sizeof(p->agent));
 		ast_mutex_init(&p->lock);
 		ast_mutex_init(&p->app_lock);
-		p->owning_app = (pthread_t) -1;
+		ast_cond_init(&p->app_complete_cond, NULL);
+		p->app_lock_flag = 0;
 		p->app_sleep_cond = 1;
 		p->group = group;
 		p->pending = pending;
@@ -509,12 +511,14 @@
 	chan->tech_pvt = NULL;
 	p->app_sleep_cond = 1;
 	/* Release ownership of the agent to other threads (presumably running the login app). */
-	ast_mutex_unlock(&p->app_lock);
+	p->app_lock_flag = 0;
+	ast_cond_signal(&p->app_complete_cond);
 	if (chan)
 		ast_channel_free(chan);
 	if (p->dead) {
 		ast_mutex_destroy(&p->lock);
 		ast_mutex_destroy(&p->app_lock);
+		ast_cond_destroy(&p->app_complete_cond);
 		ast_free(p);
         }
 	return 0;
@@ -1000,6 +1004,7 @@
 	} else if (p->dead) {
 		ast_mutex_destroy(&p->lock);
 		ast_mutex_destroy(&p->app_lock);
+		ast_cond_destroy(&p->app_complete_cond);
 		ast_free(p);
 	} else {
 		if (p->chan) {
@@ -1010,8 +1015,10 @@
 			ast_mutex_unlock(&p->lock);
 		}
 		/* Release ownership of the agent to other threads (presumably running the login app). */
-		if (ast_strlen_zero(p->loginchan))
-			ast_mutex_unlock(&p->app_lock);
+		if (ast_strlen_zero(p->loginchan)) {
+			p->app_lock_flag = 0;
+			ast_cond_signal(&p->app_complete_cond);
+		}
 	}
 	return 0;
 }
@@ -1098,6 +1105,7 @@
 static struct ast_channel *agent_new(struct agent_pvt *p, int state)
 {
 	struct ast_channel *tmp;
+	int alreadylocked;
 #if 0
 	if (!p->chan) {
 		ast_log(LOG_WARNING, "No channel? :(\n");
@@ -1143,11 +1151,15 @@
 	 * implemented in the kernel for this.
 	 */
 	p->app_sleep_cond = 0;
-	if(ast_strlen_zero(p->loginchan) && ast_mutex_trylock(&p->app_lock)) {
+
+	alreadylocked = p->app_lock_flag;
+	p->app_lock_flag = 1;
+
+	if(ast_strlen_zero(p->loginchan) && alreadylocked) {
 		if (p->chan) {
 			ast_queue_frame(p->chan, &ast_null_frame);
 			ast_mutex_unlock(&p->lock);	/* For other thread to read the condition. */
-			ast_mutex_lock(&p->app_lock);
+			p->app_lock_flag = 1;
 			ast_mutex_lock(&p->lock);
 		} else {
 			ast_log(LOG_WARNING, "Agent disconnected while we were connecting the call\n");
@@ -1156,7 +1168,8 @@
 			p->app_sleep_cond = 1;
 			ast_channel_free( tmp );
 			ast_mutex_unlock(&p->lock);	/* For other thread to read the condition. */
-			ast_mutex_unlock(&p->app_lock);
+			p->app_lock_flag = 0;
+			ast_cond_signal(&p->app_complete_cond);
 			return NULL;
 		}
 	} else if (!ast_strlen_zero(p->loginchan)) {
@@ -1174,14 +1187,6 @@
 	} 
 	if (p->chan)
 		ast_indicate(p->chan, AST_CONTROL_UNHOLD);
-	p->owning_app = pthread_self();
-	/* After the above step, there should not be any blockers. */
-	if (p->chan) {
-		if (ast_test_flag(p->chan, AST_FLAG_BLOCKING)) {
-			ast_log( LOG_ERROR, "A blocker exists after agent channel ownership acquired\n" );
-			ast_assert(ast_test_flag(p->chan, AST_FLAG_BLOCKING) == 0);
-		}
-	}
 	return tmp;
 }
 
@@ -1346,6 +1351,7 @@
 				if (!p->chan) {
 					ast_mutex_destroy(&p->lock);
 					ast_mutex_destroy(&p->app_lock);
+					ast_cond_destroy(&p->app_complete_cond);
 					ast_free(p);
 				} else {
 					/* Cause them to hang up */
@@ -2232,15 +2238,17 @@
 							ast_mutex_unlock(&p->lock);
 							AST_LIST_UNLOCK(&agents);
 							/*	Synchronize channel ownership between call to agent and itself. */
-							ast_mutex_lock( &p->app_lock );
+							ast_mutex_lock(&p->app_lock);
+							if (p->app_lock_flag == 1) {
+								ast_cond_wait(&p->app_complete_cond, &p->app_lock);
+							}
+							ast_mutex_unlock(&p->app_lock);
 							ast_mutex_lock(&p->lock);
-							p->owning_app = pthread_self();
 							ast_mutex_unlock(&p->lock);
 							if (p->ackcall > 1) 
 								res = agent_ack_sleep(p);
 							else
 								res = ast_safe_sleep_conditional( chan, 1000, agent_cont_sleep, p );
-							ast_mutex_unlock( &p->app_lock );
 							if ((p->ackcall > 1)  && (res == 1)) {
 								AST_LIST_LOCK(&agents);
 								ast_mutex_lock(&p->lock);
@@ -2275,6 +2283,7 @@
 						if (p->dead && !p->owner) {
 							ast_mutex_destroy(&p->lock);
 							ast_mutex_destroy(&p->app_lock);
+							ast_cond_destroy(&p->app_complete_cond);
 							ast_free(p);
 						}
 					}

Modified: team/rmudgett/misdn_facility/channels/chan_alsa.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/channels/chan_alsa.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/channels/chan_alsa.c (original)
+++ team/rmudgett/misdn_facility/channels/chan_alsa.c Thu Jan 15 13:47:02 2009
@@ -381,13 +381,17 @@
 		state = snd_pcm_state(alsa.ocard);
 		if (state == SND_PCM_STATE_XRUN)
 			snd_pcm_prepare(alsa.ocard);
-		res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2);
+		while ((res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2)) == -EAGAIN) {
+			usleep(1);
+		}
 		if (res == -EPIPE) {
 #if DEBUG
 			ast_debug(1, "XRUN write\n");
 #endif
 			snd_pcm_prepare(alsa.ocard);
-			res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2);
+			while ((res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2)) == -EAGAIN) {
+				usleep(1);
+			}
 			if (res != len / 2) {
 				ast_log(LOG_ERROR, "Write error: %s\n", snd_strerror(res));
 				res = -1;

Modified: team/rmudgett/misdn_facility/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/channels/chan_dahdi.c?view=diff&rev=168731&r1=168730&r2=168731
==============================================================================
--- team/rmudgett/misdn_facility/channels/chan_dahdi.c (original)
+++ team/rmudgett/misdn_facility/channels/chan_dahdi.c Thu Jan 15 13:47:02 2009
@@ -728,6 +728,7 @@
 	struct ast_event_sub *mwi_event_sub;
 	char dialdest[256];
 	int onhooktime;
+	int fxsoffhookstate;
 	int msgstate;
 	int distinctivering;				/*!< Which distinctivering to use */
 	int cidrings;					/*!< Which ring to deliver CID on */
@@ -3433,6 +3434,7 @@
 					tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_CONGESTION);
 				else
 					tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
+				p->fxsoffhookstate = par.rxisoffhook;
 			}
 			break;
 		case SIG_FXSGS:
@@ -4648,6 +4650,7 @@
 			case SIG_FXOGS:
 			case SIG_FXOKS:
 				p->onhooktime = time(NULL);
+				p->fxsoffhookstate = 0;
 				p->msgstate = -1;
 				/* Check for some special conditions regarding call waiting */
 				if (idx == SUB_REAL) {
@@ -4799,6 +4802,7 @@
 			case SIG_FXOLS:
 			case SIG_FXOGS:
 			case SIG_FXOKS:
+				p->fxsoffhookstate = 1;
 				switch (ast->_state) {
 				case AST_STATE_RINGING:
 					dahdi_enable_ec(p);
@@ -7887,6 +7891,7 @@
 		case SIG_FXOGS:
 		case SIG_FXOKS:
 			res = dahdi_set_hook(i->subs[SUB_REAL].dfd, DAHDI_OFFHOOK);
+			i->fxsoffhookstate = 1;
 			if (res && (errno == EBUSY))
 				break;
 			if (i->cidspill) {
@@ -8040,6 +8045,9 @@
 			res = tone_zone_play_tone(i->subs[SUB_REAL].dfd, -1);
 			return -1;
 		}
+		if (i->sig == SIG_FXOLS || i->sig == SIG_FXOGS || i->sig == SIG_FXOKS) {
+			i->fxsoffhookstate = 0;
+		}
 		break;
 	case DAHDI_EVENT_POLARITY:
 		switch (i->sig) {
@@ -8182,7 +8190,10 @@
 				if (!found && ((i == last) || ((i == iflist) && !last))) {
 					last = i;
 					if (last) {
-						if (!last->mwisendactive &&	 last->sig & __DAHDI_SIG_FXO) {
+						/* Only allow MWI to be initiated on a quiescent fxs port */
+						if (!last->mwisendactive &&	last->sig & __DAHDI_SIG_FXO &&

[... 4951 lines stripped ...]



More information about the asterisk-commits mailing list