Commit Graph

111 Commits

Author SHA1 Message Date
Sean Bright dce142baa4 app_externalivr.c: Fix mixed leading whitespace in source code.
No functional changes.

Change-Id: I46514152c0af67f395526374aaa847ccd6a85378
2021-09-21 11:46:36 -05:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Joshua Colp 5a7af00e80 asterisk: Audit locking of channel when manipulating flags.
When manipulating flags on a channel the channel has to be
locked to guarantee that nothing else is also manipulating
the flags. This change introduces locking where necessary to
guarantee this. It also adds helper functions that manipulate
channel flags and lock to reduce repeated code.

ASTERISK-26789

Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
2017-05-16 14:25:23 +00:00
Timo Teräs 070a51bf7c Implement internal abstraction for iostreams
fopencookie/funclose is a non-standard API and should not be used
in portable software. Additionally, the way FILE's fd is used in
non-blocking mode is undefined behaviour and cannot be relied on.

This introduces internal abstraction for io streams, that allows
implementing the desired virtualization of read/write operations
with necessary timeout handling.

ASTERISK-24515 #close
ASTERISK-24517 #close

Change-Id: Id916aef418b665ced6a7489aef74908b6e376e85
2016-11-15 22:25:14 +02:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Richard Mudgett c41dd32b94 Audit ast_sockaddr_resolve() usage for memory leaks.
Valgrind found some memory leaks associated with ast_sockaddr_resolve().
Most of the leaks had already been fixed by earlier memory leak hunt
patches.  This patch performs an audit of ast_sockaddr_resolve() and found
one more.

* Fix ast_sockaddr_resolve() memory leak in
apps/app_externalivr.c:app_exec().

* Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs
parameter for safety so the pointer will never be uninitialized on return.
The same goes for res/res_pjsip_acl.c:extract_contact_addr().

* Made functions that call ast_sockaddr_resolve() with RAII_VAR()
controlling the addrs variable use ast_free instead of ast_free_ptr to
provide better MALLOC_DEBUG information.

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

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

Merged revisions 433057 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-17 21:52:47 +00:00
Mark Michelson dcf1ad14da Add module support level to ast_module_info structure. Print it in CLI "module show" .
ASTERISK-23919 #close
Reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25 16:47:17 +00:00
Sean Bright 5837ef8124 Remove declaration of eivr_connect_socket because it no longer exists.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-20 11:47:12 +00:00
Sean Bright c8945a4070 Add interrupt ('I') command to ExternalIVR.
Sending the 'I' command from an external process will cause the current playlist
to be cleared, including stopping any audio file that is currently playing.  This
is useful when you want to interrupt audio playback only when specific DTMF is
entered by the caller.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-08 21:46:21 +00:00
Sean Bright 474612d7f7 Add IPv6 support to ExternalIVR.
Review: https://reviewboard.asterisk.org/r/1896/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-03 14:47:58 +00:00
Sean Bright ba93541ced Prevent a crash in ExternalIVR when the 'S' command is sent first.
If the first command sent from an ExternalIVR client is an 'S' command, we were
blindly removing the first element from the play list and deferencing it, even
if it was NULL.  This corrects that and also locks appropriately in one place.

(issue ASTERISK-17889)
Reported by: Chris Maciejewski
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19 16:10:04 +00:00
Jonathan Rose e96a59acfd Replace GNU old-style field designator extensions to fix clang warnings
(issue ASTERISK-19540)
Reported by: Makoto Dei
Patches:
	clang-gnu-designator.patch uploaded by Makoto Dei (license 5027)
........
Also add from the patch the portion in res_fax_spandsp that didn't apply to 1.8

Merged revisions 361142 from http://svn.asterisk.org/svn/asterisk/branches/1.8
(closes issue ASTERISK-19540)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 18:08:28 +00:00
Russell Bryant 6c9f009b6d Fix invalid reads/writes due to incorrect sizeof().
These few places in the code used sizeof() on h_addr in struct hostent.
This is sizeof(char *).  The correct way to get the size of this address is to
use h_length.  This error would result in reads/writes of 8 bytes instead of 4
on 64-bit machines.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 10:05:07 +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
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
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
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
David Ruggles 3cda82a379 Merged revisions 309403 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r309403 | diruggles | 2011-03-03 20:50:44 -0500 (Thu, 03 Mar 2011) | 23 lines
  
  Merged revisions 309356 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r309356 | diruggles | 2011-03-03 19:42:28 -0500 (Thu, 03 Mar 2011) | 16 lines
    
    Merged revisions 309355 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r309355 | diruggles | 2011-03-03 19:34:13 -0500 (Thu, 03 Mar 2011) | 9 lines
      
      fix small memory leak
      
      fix small memory leak caused by a string allocation that wasn't freed
      
      (closes issue #18907)
      Reported by: andy11
      Patches: 
            asterisk_trunk-app_externalivr-leak.patch uploaded by andy11 (license 1224)
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 01:52:21 +00:00
Andrew Latham 93bade5639 Replacing doc/* and asterisk.pdf with wiki links
Adding links to http(s)://wiki.asterisk.org



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-02 19:30:49 +00:00
Andrew Latham f9c3b26241 Add Function and Application Relationships to documentation
Add and extend the see-also sections to the documentation for applications
and functions in an effort to expand the online documentation of the wiki.
Also check for and update any links to moved documentation in the doc folder.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@304913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-30 00:22:59 +00:00
David Ruggles 19d14fe577 initialize playing_silence in struct initialization
playing_silence was not initialized with the struct
was initialized, it was being set after the fact
which caused problems if something that relied on
playing_silence being set was called too quickly

(closes issue #18430)
Reported by: stevebrandli
Patches: 
      externalivr.patch uploaded by thedavidfactor (license 903)
Tested by: thedavidfactor, stevebrandli


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-03 14:09:29 +00:00
Mark Michelson cd4ebd336f Add IPv6 to Asterisk.
This adds a generic API for accommodating IPv6 and IPv4 addresses
within Asterisk. While many files have been updated to make use of the
API, chan_sip and the RTP code are the files which actually support
IPv6 addresses at the time of this commit. The way has been paved for
easier upgrading for other files in the near future, though.

Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne
for their hard work on this.

(closes issue #17565)
Reported by: russell
Patches: 
      asteriskv6-test-report.pdf uploaded by russell (license 2)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 22:08:07 +00:00
David Ruggles 4c49e70ec5 Add send DTMF feature to ExternalIVR app
Implemented a new command 'D' that allows client
IVRs to send DTMF digits to the channel.

(closes issue #16615)
Reported by: thedavidfactor

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-22 16:20:43 +00:00
David Ruggles 174cd3c65c Add notification of interrupted file
Add file information to data element of T event so
the file information is sent to the client when it is
interrupted. Previously only notification of pending
files that were dropped was sent

(closes issue #16147)
Reported by: thedavidfactor
Tested by: thedavidfactor

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 17:41:44 +00:00
David Ruggles 43ebe5a2ba Fix TCP Client interface
Fix a couple of very minor bugs that prevent the socket client from working. The wrong set of properties were used in one place and the size of the address variable isn't set if the host name is an ip address. Also includes a fix for a bug that was introduced previously.

(closes issue #16121)
Reported by: thedavidfactor
Tested by: thedavidfactor

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-07 19:48:14 +00:00
David Ruggles 93afa4cc4f Prevent double closing of FDs by EIVR
This caused a problem when asterisk was under heavy load and running both AGI and EIVR applications.
EIVR would close an FD at which point it would be considered freed and be used by a new AGI instance
the second close would then close the FD now in use by AGI.

(closes issue #16305)
Reported by: diLLec
Tested by: thedavidfactor, diLLec

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 22:17:22 +00:00
David Ruggles 6e27759d33 Fix/Implement error events for non-existing files
also include a better cmd define for S command

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-20 17:28:01 +00:00
David Ruggles 8d9a12a60a Basic cleanup of ExternalIVR: cleaned up argument parsing; implemented good coding practices where applicable; replaced most notice level logging with verbose logging; replaced warning messages that terminated with error messages; fixed memory leak identified by russellb
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-19 14:53:58 +00:00
Tilghman Lesher 8ee06c6c3b Don't crash if no arguments are passed.
(closes issue #16119)
 Reported by: thedavidfactor


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-05 17:08:02 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
David Vossel 776a14386a SIP TCP/TLS: move client connection setup/write into tcp helper thread, various related locking/memory fixes.
What this patch fixes
1.Moves sip TCP/TLS connection setup into the TCP helper thread:
  Connection setup takes awhile and before this it was being
  done while holding the monitor lock.
2.Moves TCP/TLS writing to the TCP helper thread:  Through the
  use of a packet queue and an alert pipe, the TCP helper thread
  can now be woken up to write data as well as read data.
3.Locking error: sip_xmit returned an XMIT_ERROR without giving
  up the tcptls_session lock.  This lock has been completely removed
  from sip_xmit and placed in the new sip_tcptls_write() function.
4.Memory leak:  When creating a tcptls_client the tls_cfg was alloced
  but never freed unless the tcptls_session failed to start.  Now the
  session_args for a sip client are an ao2 object which frees the
  tls_cfg on destruction.
5.Pointer to stack variable: During sip_prepare_socket the creation
  of a client's ast_tcptls_session_args was done on the stack and
  stored as a pointer in the newly created tcptls_session.  Depending
  on the events that followed, there was a slight possibility that
  pointer could have been accessed after the stack returned.  Given
  the new changes, it is always accessed after the stack returns
  which is why I found it.

Notable code changes
1.I broke tcptls.c's ast_tcptls_client_start() function into two
  functions.  One for creating and allocating the new tcptls_session,
  and a separate one for starting and handling the new connection.
  This allowed me to create the tcptls_session, launch the helper
  thread, and then establish the connection within the helper thread.
2.Writes to a tcptls_session are now done within the helper thread.
  This is done by using an alert pipe to wake up the thread if new
  data needs to be sent.  The thread's sip_threadinfo object contains
  the alert pipe as well as the packet queue.
3.Since the threadinfo object contains the alert pipe, it must now be
  accessed outside of the helper thread for every write (queuing of a
  packet).  For easy lookup, I moved the threadinfo objects from a
  linked list to an ao2_container.

(closes issue #13136)
Reported by: pabelanger
Tested by: dvossel, whys

(closes issue #15894)
Reported by: dvossel
Tested by: dvossel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 19:55:51 +00:00
Kevin P. Fleming aaeec3b40f Last batch of 'static' qualifiers for module-level global variables.
Fix up modules in the 'apps' directory, and also correct the bad example of
enum definitions in include/asterisk/app.h, which many developers followed
(thanks for reading the documentation!). In addition, add some basic usage
examples of the 'pahole' and 'pglobal' tools to the coding guidelines.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 19:10:10 +00:00
Eliel C. Sardanons e18eae86c9 Move application ExternalIVR static documentation to XML.
Move application ExternalIVR static documentation to the new AstXML form.

(issue #15245)
Reported by: eliel
Patches:
      app_externalivr.diff uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-07 17:29:44 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Mark Michelson 1413e48fca Fix externalivr's setvariable command so that it properly sets multiple variables.
The command had a for loop that was guaranteed to only execute once since
the continuation operation of the loop would set the input buffer NULL. I rewrote
the loop so that its operation was more obvious, and it would set multiple variables
correctly.

I also reduced stack space required for the function, constified the input string,
and modified the function so that it would not modify the input string while I was
at it.

(closes issue #15114)
Reported by: chris-mac
Patches:
      15114.patch uploaded by mmichelson (license 60)
Tested by: chris-mac



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 18:58:26 +00:00
Kevin P. Fleming 1c988d8996 add 'const' qualifiers in various places where they should have been
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 13:59:35 +00:00
David Vossel 829b14fc3e Fixes issue with hangups not being sent and external process never terminating.
The ignore_hangup, run_dead, and noanswer flags were never initilized to zero causing hangups to never be issued.  If the external script expects to be notified of a hangup and never receives one, it runs indefinitely. 

(closes issue #14251)
Reported by: chris-mac
Tested by: dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-09 17:26:02 +00:00
Tilghman Lesher c8223fc957 Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 08:36:35 +00:00
Kevin P. Fleming 1ddc834b39 cleaup of the TCP/TLS socket API:
1) rename 'struct server_args' to 'struct ast_tcptls_session_args', to follow coding guidelines

2) make ast_make_file_from_fd() static and rename it to something that indicates what it really is for (again coding guidelines)

3) rename address variables inside 'struct ast_tcptls_session_args' to be more descriptive (dare i say it... coding guidelines)

4) change ast_tcptls_client_start() to use the new 'remote_address' field of the session args for the destination of the connection, and use the 'local_address' field to bind() the socket to the proper source address, if one is supplied

5) in chan_sip, ensure that we pass in the PP address we are bound to when creating outbound (client) connections, so that our connections will appear from the correct address



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19 19:11:28 +00:00
Tilghman Lesher d2247c2573 Missing comma
(closes issue #12891)
 Reported by: chris-mac


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 15:52:17 +00:00
Brett Bryant 2aae0ba13d Updates all usages of ast_tcptls_session_instance to be managed by reference counts so that they only get destroyed when all threads are done using
them, and memory does not get free'd causing strange issues with SIP. 

This code was originally written by russellb in the team/group/issue_11972/ branch.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 21:46:57 +00:00
Chris Tooley 39606a9c64 Changes response to the ExternalIVR() P command from pipe delimited to comma delimited. closes issue #12804
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 20:02:06 +00:00
Michiel van Baak f1e9371da8 - revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- make data member of the ast_frame struct a named union instead of a void

Recently the ast_queue_hangup function got a new parameter, the hangupcause
Feedback came in that this is no good and that instead a new function should be created.
This I did.

The hangupcause was stored in the seqno member of the ast_frame struct. This is not very
elegant, and since there's already a data member that one should be used.
Problem is, this member was a void *.
Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone
wants to store another type in there in the future.

This commit is so massive, because all ast_frame.data uses have to be
altered to ast_frame.data.data

Thanks russellb and kpfleming for the feedback.

(closes issue #12674)
Reported by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 16:29:54 +00:00
Tilghman Lesher ce8453f57c Enhance ExternalIVR with new options and commands.
(closes issue #12705)
 Reported by: ctooley
 Patches: 
       new_externalivr_argument_format-v2.diff uploaded by ctooley (license 136)
       new_externalivr_documentation.diff uploaded by ctooley (license 136)
       and a few additional fixes by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 05:10:01 +00:00
Tilghman Lesher ffc9f89189 On socket-based connections, there is no error FD, so don't try waiting on one.
(closes issue #12697)
 Reported by: ctooley
 Patches: 
       fix_externalivr_waitfor_nandfds-v3.diff uploaded by ctooley (license 136)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 13:39:41 +00:00
Tilghman Lesher c15ed0f3f6 Merged revisions 116296 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r116296 | tilghman | 2008-05-14 11:46:48 -0500 (Wed, 14 May 2008) | 2 lines

Detect another way for a connection to have gone away.
(closes issue #12618)
 Reported by: ctooley
 Patches: 
       1.4-externalivr-test_fd.diff uploaded by ctooley (license 136)
       trunk-externalivr-test_fd.diff uploaded by ctooley (license 136)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 16:53:23 +00:00
Tilghman Lesher 527c601d0c Lock around variables retrieved, and copy the values, if they stay persistent,
since another thread could remove them.
(closes issue #12541)
 Reported by: snuffy
 Patches: 
       bug_12156_apps.diff uploaded by snuffy (license 35)
       Several additional changes by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 19:21:04 +00:00
Tilghman Lesher 463a5dbd0a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 20:20:10 +00:00