Commit Graph

298 Commits

Author SHA1 Message Date
David M. Lee c5acf22cec Fix DBDelTree error codes for AMI, CLI and AGI
The AMI DBDelTree command will return Success/Key tree deleted successfully even
if the given key does not exist. The CLI command 'database deltree' had a
similar problem, but was saved because it actually responded with '0 database
entries removed'. AGI had a slightly different error, where it would return
success if the database was unavailable.

This came from confusion about the ast_db_deltree retval, which is -1 in the
event of a database error, or number of entries deleted (including 0 for
deleting nothing).

* Changed some poorly named res variables to num_deleted
* Specified specific errors when calling ast_db_deltree (database unavailable
  vs. entry not found vs. success)
* Fixed similar bug in AGI database deltree, where 'Database unavailable'
  results in successful result

(closes issue AST-967)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2138/
........

Merged revisions 374426 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374427 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374428 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 15:48:24 +00:00
Richard Mudgett 1f9d7090df Include channel uniqueid in "AsyncAGI" and "AGIExec" events.
* Added AMI event documentation for AsyncAGI and AGIExec events.

(closes issue ASTERISK-20318)
Reported by: Dan Cropp
Patches:
      res_agi_patch.txt (license #6422) patch uploaded by Dan Cropp
      modified for trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 22:11:19 +00:00
Joshua Colp b6a00a1d97 Update documentation to make it explicit that "stream file" will not restart musiconhold.
(issue ASTERISK-17367)
Reported by: oej
........

Merged revisions 373989 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373990 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373991 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 12:17:41 +00:00
Jonathan Rose 39b78f6250 res_agi: async_agi responsiveness improvement on datastore problems
This patch changes get_agi_cmd so that the return can be checked
to differentiate between an empty list success and something that
triggered an error. This in turn allows launch_asyncagi to detect
these errors and break free from the command processing loop so
that the async agi can be ended more cleanly

(closes issue ASTERISK-20109)
Reported by: Jeremiah Gowdy
Patches: jgowdy-7-9-2012.diff uploaded by Jeremiah Gowdy (license 6358)
           (Modified by me to fix some logical issues and apply to trunk)
Review: https://reviewboard.asterisk.org/r/2117/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 14:53:42 +00:00
Kinsey Moore 9b16c8b0f6 Clean up and ensure proper usage of alloca()
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 20:21:43 +00:00
Jonathan Rose 79de3f7fe8 res_agi: Add message indicating need for \n character in verbose message
The while loop responsible for reading AGI messages from a fastAGI service
can end up looping indefinitely when an AGI script fails to indicate the end
of a message with a \n character. This patch adds an indication that we are
expecting a \n character to end the message to make it more clear to users
that this is necessary if they are receiving this warning over and over.

(issue ASTERISK-20061)
Reported by: Eike Kuiper
........

Merged revisions 370494 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370495 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-25 21:22:34 +00:00
Matthew Jordan 016dfa01f1 Fix places in resources where a negative return value could impact execution
This patch addresses a number of modules in resources that did not handle the
negative return value from function calls adequately.  This includes:

* res_agi.c: if the result of the read function is a negative number,
indicating some failure, the result would instead be treated as the number
of bytes read.  This patch now treats negative results in the same manner
as an end of file condition, with the exception that it also logs the
error code indicated by the return.

* res_musiconhold.c: if spawn_mp3 fails to assign a file descriptor to srcfd,
and instead assigns a negative value, that file descriptor could later be
passed to functions that require a valid file descriptor.  If spawn_mp3 fails,
we now immediately retry instead of continuing in the logic.

* res_rtp_asterisk.c: if no codec can be matched between two RTP instances
in a peer to peer bridge, we immediately return instead of attempting to
use the codec payload type as an index to determine the appropriate negotiated
codec.

(issue ASTERISK-19655)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/1863/
........

Merged revisions 362362 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362364 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 21:14:49 +00:00
Terry Wilson 786f5898d1 Finalize ast_channel opaquification
Review: https://reviewboard.asterisk.org/r/1786/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 18:20:34 +00:00
Sean Bright 62aae50142 Add IPv6 support to FastAGI.
Review: https://reviewboard.asterisk.org/r/1774/
Reviewed by: Simon Perreault, Mark Michelson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 20:31:48 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 16:52:47 +00:00
Terry Wilson ebaf59a656 Opaquification for ast_format structs in struct ast_channel
Review: https://reviewboard.asterisk.org/r/1770/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 00:32:20 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Russell Bryant 33322e38f0 res_agi: Add AGIEXITONHANGUP variable.
This patch adds a variable AGIEXITONHANGUP for res_agi.  If this variable is
set to "yes" on a channel, AGI() will exit immediately once a channel hangup
has been detected.  This was the behavior of AGI() in Asterisk 1.4 and earlier
and is still desired by some people.

Review: https://reviewboard.asterisk.org/r/1734/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 00:43:50 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Terry Wilson 99cae5b750 Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

Review: https://reviewboard.asterisk.org/r/1661/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

Review: https://reviewboard.asterisk.org/r/1655/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Richard Mudgett a86037d959 Make FastAGI HANGUP show up in AGI debug output.
* Change from using send() to ast_agi_send() so the HANGUP shows up in the
AGI debug output.

(closes issue ASTERISK-18723)
Reported by: James Van Vleet
Patches:
      jira_asterisk_18723_v1.8.patch (license #5621) patch uploaded by rmudgett
........

Merged revisions 345431 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 345432 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-15 20:11:06 +00:00
Richard Mudgett b961d57c4c Fix AGI exec Park to honor the Park application parameters.
The fix for ASTERISK-12715 and ASTERISK-12685 added a check for the Park
application because the channel needed to be masqueraded to prevent a
crash.  Since the Park application now always masquerades the channel into
the parking lot, the special check is no longer needed.  The fix also
resulted in AGI exec Park attempting to double park the call and not honor
the Park application parameters.

* Removed no longer necessary call to ast_masq_park_call() by AGI exec for
the Park application.  (Reverts -r146923)

* Fix Park application to only return 0 or -1.  The AGI exec Park was
causing broken pipe error messages because the Park application returned 1
on successful park.

(closes issue ASTERISK-18737)
........

Merged revisions 341717 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 341718 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-20 22:03:35 +00:00
Matthew Nicholson bb07ca66a1 Merged revisions 340109 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r340109 | mnicholson | 2011-10-10 09:15:41 -0500 (Mon, 10 Oct 2011) | 18 lines
  
  Merged revisions 340108 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r340108 | mnicholson | 2011-10-10 09:14:48 -0500 (Mon, 10 Oct 2011) | 11 lines
    
    Load the proper XML documentation when multiple modules document the same application.
    
    This patch adds an optional "module" attribute to the XML documentation spec
    that allows the documentation processor to match apps with identical names from
    different modules to their documentation. This patch also fixes a number of
    bugs with the documentation processor and should make it a little more
    efficient. Support for multiple languages has also been properly implemented.
    
    ASTERISK-18130
    Review: https://reviewboard.asterisk.org/r/1485/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10 14:16:27 +00:00
Olle Johansson c04ab6b35c Just formatting.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-29 09:32:34 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
Leif Madsen e42402ba2c Merged revisions 323154 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r323154 | lmadsen | 2011-06-13 15:00:41 -0400 (Mon, 13 Jun 2011) | 6 lines
  
  Tweak documentation for AGI Hangup command.
  
  (closes issue ASTERISK-17999)
  Reported by: Ben Klang
  Patches:
       hangup-doc.diff - uploaded by Ben Klang (License #5876)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-13 19:03:46 +00:00
Richard Mudgett 5da4161283 Merged revisions 321436 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r321436 | rmudgett | 2011-05-27 19:27:52 -0500 (Fri, 27 May 2011) | 4 lines
  
  Some hagi launch cleanup.
  
  Inspired by issue 19256.  This patch would also fix the crash.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@321445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-28 00:29:48 +00:00
Russell Bryant 37aa52fd78 Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 20:45:32 +00:00
Russell Bryant 4881d65481 Merged revisions 314780 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r314780 | russell | 2011-04-22 09:02:23 -0500 (Fri, 22 Apr 2011) | 18 lines
  
  Merged revisions 314778 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r314778 | russell | 2011-04-22 08:58:03 -0500 (Fri, 22 Apr 2011) | 11 lines
    
    Initialize buffers in getvar and getvarfull.
    
    Initialize the buffers used to hold the result from GET VARIABLE or
    GET VARIABLE FULL.  The bug report shows func_read returning garbage in
    the result.  It assumed that the buffer passed in was initialized, like many
    other functions do.  In the more common code path (through the dialplan), it
    is initialized, so just initialize it here too.
    
    (closes issue #19050)
    Reported by: johnz
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-22 14:08:02 +00:00
Richard Mudgett 0a5c2d8391 Merged revisions 314069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r314069 | rmudgett | 2011-04-18 11:10:10 -0500 (Mon, 18 Apr 2011) | 22 lines
  
  The AsyncAGI command loop is lax in the value it returns for the return status.
  
  * Return correct status: SUCCESS/FAILED/HANGUP.  Previously, abnormal
  exits from the command loop such as hangup would return SUCCESS.
  
  * The "asyncagi break" command now returns SUCCESS and is now the only way
  to break the command loop with that status.  Previously, it returned
  FAILED.
  
  * The AMI event AsyncAGI End is no longer sent if the AsyncAGI Start event
  is not sent.  Previously, this happened because of an error setting up the
  AGI pipes.
  
  * All executed AGI commands now get an AsyncAGI Exec result event.
  Previously, if the command returned failure (because of hangup), the
  command loop just exited with FAILURE and did not send the AsyncAGI Exec
  result event.
  
  * Makes sure that the channel frame queue is empty on hangup.
  
  Review: https://reviewboard.asterisk.org/r/1183/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-18 16:27:14 +00:00
Richard Mudgett b26a16dbcf Merged revisions 313700 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r313700 | rmudgett | 2011-04-13 17:52:47 -0500 (Wed, 13 Apr 2011) | 5 lines
  
  Revert flushing stale AsyncAGI commands from -r313615.
  
  It looks like it was intentional to leave any commands or in-flight
  commands in the queue in case Async AGI is run again on the call.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-13 22:54:08 +00:00
Richard Mudgett a1b3e6b167 Merged revisions 313658 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r313658 | rmudgett | 2011-04-13 12:47:43 -0500 (Wed, 13 Apr 2011) | 2 lines
  
  Miscellaneous AGI diagnostic message cleanup and code optimization.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-13 17:51:14 +00:00
Richard Mudgett 9b559e5984 Merged revisions 313615 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r313615 | rmudgett | 2011-04-13 12:18:49 -0500 (Wed, 13 Apr 2011) | 5 lines
  
  * Add missing channel lock to handle_cli_agi_add_cmd().
  
  * Flush any Async AGI commands left over from earlier Async AGI control of
  the call.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-13 17:21:50 +00:00
Richard Mudgett c16d39ea83 Merged revisions 313588 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r313588 | rmudgett | 2011-04-13 11:31:50 -0500 (Wed, 13 Apr 2011) | 55 lines
  
  Merged revisions 313579 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r313579 | rmudgett | 2011-04-13 11:29:49 -0500 (Wed, 13 Apr 2011) | 48 lines
    
    Merged revisions 313545 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r313545 | rmudgett | 2011-04-13 11:21:24 -0500 (Wed, 13 Apr 2011) | 41 lines
      
      Asterisk does not hangup a channel after endpoint hangs up.
      
      If the call that the dialplan started an AGI script for is hungup while
      the AGI script is in the middle of a command then the AGI script is not
      notified of the hangup.  There are many AGI Exec commands that this can
      happen with.  The reported applications have been: Background, Wait, Read,
      and Dial.  Also the AGI Get Data command.
      
      * Don't wait on the Asterisk channel after it has hung up.  The channel is
      likely to never need servicing again.
      
      * Restored the AGI script's ability to return the AGI_RESULT_HANGUP value
      in run_agi().  It previously only could return AGI_RESULT_SUCCESS or
      AGI_RESULT_FAILURE after the DeadAGI and AGI applications were merged.
      
      (closes issue #17954)
      Reported by: mn3250
      Patches:
            issue17954_v1.8.patch uploaded by rmudgett (license 664)
            issue17954_v1.6.2.patch uploaded by rmudgett (license 664)
            issue17954_v1.4.patch uploaded by rmudgett (license 664)
      Tested by: rmudgett
      JIRA SWP-2171
      
      (closes issue #18492)
      Reported by: devmod
      Tested by: rmudgett
      JIRA SWP-2761
      
      (closes issue #18935)
      Reported by: nvitaly
      Tested by: astmiv, rmudgett
      JIRA SWP-3216
      
      (closes issue #17393)
      Reported by: siby
      Tested by: rmudgett
      JIRA SWP-2727
      
      Review: https://reviewboard.asterisk.org/r/1165/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-13 16:37:06 +00:00
Paul Belanger 3556e4c2d4 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

Review: https://reviewboard.asterisk.org/r/1071/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 16:55:39 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

Review: https://reviewboard.asterisk.org/r/1083/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Matthew Nicholson e706b5706e According to section 19.1.2 of RFC 3261:
For each component, the set of valid BNF expansions defines exactly
  which characters may appear unescaped.  All other characters MUST be
  escaped.

This patch modifies ast_uri_encode() to encode strings in line with this recommendation.  This patch also adds an ast_escape_quoted() function which escapes '"' and '\' characters in quoted strings in accordance with section 25.1 of RFC 3261.  The ast_uri_encode() function has also been modified to take an ast_flags struct describing the set of rules it should use when escaping characters to allow for it to escape SIP URIs in addition to HTTP URIs and other types of URIs or variations of those two URI types in the future.

The ast_uri_decode() function has also been modified to accept an ast_flags struct describing the set of rules to use when decoding to enable decoding '+' as ' ' in legacy http URLs.

The unit tests for these functions have also been updated.

ABE-2705

Review: https://reviewboard.asterisk.org/r/1081/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-24 18:59:22 +00:00
Sean Bright bc9bb55fb2 Merged revisions 302549 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r302549 | seanbright | 2011-01-19 13:43:11 -0500 (Wed, 19 Jan 2011) | 17 lines
  
  Merged revisions 302548 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r302548 | seanbright | 2011-01-19 13:37:09 -0500 (Wed, 19 Jan 2011) | 10 lines
    
    Properly handle partial reads from fgets() when handling AGIs.
    
    When fgets() failed with EAGAIN, we were continually decrementing the available
    space left in our buffer, resulting in botched command handling.
    
    (closes issue #16032)
    Reported by: notahat
    Patches:
          agi_buffer_patch2.diff uploaded by fnordian (license 110)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@302550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-19 18:45:44 +00:00
Erin Spiceland 7bd56615b2 Revert to the previous behavior of AGI command WAIT FOR DIGIT, since the
behavior of the command with this patch is almost exactly like that of GET DATA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@295789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-22 18:43:31 +00:00
Erin Spiceland 79c18d7105 Add extra functionality to AGI command WAIT FOR DIGIT.
Add the ability to play a sound file, listen for more than just one digit,
specify
escape characters. Backwards compatible (to work with only timeout specified).

(closes issue #15531)
Reported by: diLLec
Patches:
      asterisk-res_agi-203638-patched.patch uploaded by diLLec (license 839)
Tested by: diLLec, espiceland



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@295554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-19 19:32:56 +00:00
Tilghman Lesher 6d0e383321 Merged revisions 289543,289581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r289543 | tilghman | 2010-09-30 12:50:52 -0500 (Thu, 30 Sep 2010) | 2 lines
  
  More Solaris compatibility fixes
........
  r289581 | tilghman | 2010-09-30 15:23:10 -0500 (Thu, 30 Sep 2010) | 2 lines
  
  Solaris fixes.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-30 20:40:08 +00:00
Russell Bryant fd58e5036f Merged revisions 288927 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r288927 | russell | 2010-09-27 08:03:43 -0500 (Mon, 27 Sep 2010) | 2 lines
  
  Fix some documentation typos and spelling errors.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-27 13:04:23 +00:00
Russell Bryant a095791d7d Merged revisions 288925 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r288925 | russell | 2010-09-27 07:42:10 -0500 (Mon, 27 Sep 2010) | 2 lines
  
  Fix a documentation spelling error.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-27 12:42:30 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Richard Mudgett ec37ffbdaf ast_callerid restructuring
The purpose of this patch is to eliminate struct ast_callerid since it has
turned into a miscellaneous collection of various party information.

Eliminate struct ast_callerid and replace it with the following struct
organization:

struct ast_party_name {
	char *str;
	int char_set;
	int presentation;
	unsigned char valid;
};
struct ast_party_number {
	char *str;
	int plan;
	int presentation;
	unsigned char valid;
};
struct ast_party_subaddress {
	char *str;
	int type;
	unsigned char odd_even_indicator;
	unsigned char valid;
};
struct ast_party_id {
	struct ast_party_name name;
	struct ast_party_number number;
	struct ast_party_subaddress subaddress;
	char *tag;
};
struct ast_party_dialed {
	struct {
		char *str;
		int plan;
	} number;
	struct ast_party_subaddress subaddress;
	int transit_network_select;
};
struct ast_party_caller {
	struct ast_party_id id;
	char *ani;
	int ani2;
};

The new organization adds some new information as well.

* The party name and number now have their own presentation value that can
be manipulated independently.  ISDN supplies the presentation value for
the name and number at different times with the possibility that they
could be different.

* The party name and number now have a valid flag.  Before this change the
name or number string could be empty if the presentation were restricted.
Most channel drivers assume that the name or number is then simply not
available instead of indicating that the name or number was restricted.

* The party name now has a character set value.  SIP and Q.SIG have the
ability to indicate what character set a name string is using so it could
be presented properly.

* The dialed party now has a numbering plan value that could be useful to
have available.

The various channel drivers will need to be updated to support the new
core features as needed.  They have simply been converted to supply
current functionality at this time.


The following items of note were either corrected or enhanced:

* The CONNECTEDLINE() and REDIRECTING() dialplan functions were
consolidated into func_callerid.c to share party id handling code.

* CALLERPRES() is now deprecated because the name and number have their
own presentation values.

* Fixed app_alarmreceiver.c write_metadata().  The workstring[] could
contain garbage.  It also can only contain the caller id number so using
ast_callerid_parse() on it is silly.  There was also a typo in the
CALLERNAME if test.

* Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id
number string.  ast_callerid_parse() alters the given buffer which in this
case is the channel's caller id number string.  Then using
ast_shrink_phone_number() could alter it even more.

* Fixed caller ID name and number memory leak in chan_usbradio.c.

* Fixed uninitialized char arrays cid_num[] and cid_name[] in
sig_analog.c.

* Protected access to a caller channel with lock in chan_sip.c.

* Clarified intent of code in app_meetme.c sla_ring_station() and
dial_trunk().  Also made save all caller ID data instead of just the name
and number strings.

* Simplified cdr.c set_one_cid().  It hand coded the ast_callerid_merge()
function.

* Corrected some weirdness with app_privacy.c's use of caller
presentation.

Review:	https://reviewboard.asterisk.org/r/702/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 15:48:36 +00:00
Tilghman Lesher da8450323f Kill some startup warnings and errors and make some messages more helpful in tracking down the source.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 17:00:22 +00:00
Tzafrir Cohen c613897d1c Fix various typos reported by Lintian
(Also fix the typos in the comments)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-02 15:57:02 +00:00
Paul Belanger 0bf94685fd MSG_OOB flag on HANGUP packet removed.
Per Tilghman's request on IRC (#asterisk-bugs).

(closes issue #17506)
Reported by: brycebaril
Tested by: pabelanger, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-16 18:43:22 +00:00
Jason Parker 7f5a3370ad Fix compile on systems without HAVE_NULLSAFE_PRINTF defined.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@259617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-27 22:47:36 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Leif Madsen 0eb71bccf1 handle_speechset has 4 arguments.
Update code to reflect that handle_speechset has 4 arguments.

(closes issue #17093)
Reported by: gpatri
Patches: 
      res_agi.patch uploaded by gpatri (license 1014)
Tested by: pabelanger, mmichelson

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 15:21:26 +00:00
Tilghman Lesher c8abb42e6a Solaris doesn't like outputting a NULL to a %s in format strings.
Detect all platforms that don't like that, either, and ensure that when documentation is
missing, we pass a non-NULL pointer when outputting the corresponding documentation.

(closes issue #16689)
 Reported by: bklang
 Patches: 
       20100209__issue16689__with_tests.diff.txt uploaded by tilghman (license 14)
 
Review: https://reviewboard.asterisk.org/r/497/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 16:01:28 +00:00
Tilghman Lesher 49bf540c71 Create iterative method for querying SRV results, and use that for finding AGI servers.
(closes issue #14775)
 Reported by: _brent_
 Patches: 
       20091215__issue14775.diff.txt uploaded by tilghman (license 14)
       hagi-5.patch uploaded by brent (license 388)
 Tested by: _brent_
 Reviewboard: https://reviewboard.asterisk.org/r/378/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-19 00:28:49 +00:00
Tilghman Lesher 963319d807 Initialize variables that we attempt to free later.
(closes issue #16302)
 Reported by: yahsyn
 Patches: 
       20091124__issue16302.diff.txt uploaded by tilghman (license 14)
 Tested by: yahsyn


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 22:17:03 +00:00