Commit Graph

71 Commits

Author SHA1 Message Date
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
Michiel van Baak 08e674bce0 Pass the hangup cause all the way to the calling app/channel.
(closes issue #11328)
Reported by: rain
Patches:
      20071207__pass_cause_in_hangup_control_frame.diff.txt uploaded by Corydon76 (license 14)
brought up-to-date to trunk by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 22:16:48 +00:00
Tilghman Lesher 123ac5fd64 Standardized routines for forking processes (keeps all the specialized code in one place).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16 22:57:54 +00:00
Jeff Peeler 3c4c3c0dd2 documenting changes as a result of adding TCP functionality to ExternalIVR
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-13 23:12:59 +00:00
Jeff Peeler 5aba7c1cbe set variable to NULL to prevent uninitialized warning
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-13 20:38:56 +00:00
Jeff Peeler b2cad9d925 (closes issue #11827)
Reported by: ctooley
Patches:
      eivr_tcp_generic.patch uploaded by jpeeler (license 325)
This change adds the ability to communicate over a TCP socket instead of forking a child process.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-13 18:59:04 +00:00
Jeff Peeler 5404ab35e2 a few syntax changes and safer code
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 19:47:39 +00:00
Olle Johansson 9cf6138725 Formatting fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 10:19:09 +00:00
Jeff Peeler 8e4c97bf0a (closes issue #11825)
Reported by: ctooley
Patches:
      additional_eivr_commands.patch uploaded by ctooley (license 136)
Tested by: ctooley


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-13 21:04:31 +00:00
Michiel van Baak 4dccb58fb7 whitespace fixes only.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-09 11:27:10 +00:00
Mark Michelson 64b5fceb32 Merged revisions 99975 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99975 | mmichelson | 2008-01-23 14:25:00 -0600 (Wed, 23 Jan 2008) | 3 lines

Fixing a typo.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 20:26:19 +00:00
Luigi Rizzo 7e8835e0d7 remove another set of redundant #include "asterisk/options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:24:55 +00:00
Luigi Rizzo ffd86fc964 more errno.h removal
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 21:12:08 +00:00
Luigi Rizzo 0595b5e2aa include "logger.h" and errno.h from asterisk.h - usage shows that they
were included almost everywhere.
Remove some of the instances.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 18:52:04 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Joshua Colp 15c5e25e36 (closes issue #10381)
Reported by: yehavi
Use the filename we parsed using the standard parsing when launching the application specified to ExternalIVR.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 14:37:52 +00:00
Tilghman Lesher 55b1ee298e Merge the dialplan_aesthetics branch. Most of this patch simply converts applications
using old methods of parsing arguments to using the standard macros.  However, the big
change is that the really old way of specifying application and arguments separated by
a comma will no longer work (e.g. NoOp,foo|bar).  Instead, the way that has been
recommended since long before 1.0 will become the only method available (e.g. NoOp(foo,bar).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 19:51:41 +00:00
Joshua Colp b8cd949cce Applications no longer need to call ast_module_user_add and ast_module_user_remove. This is now taken care of in the pbx_exec function outside of the application.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 14:39:29 +00:00
Joshua Colp 96a646734f It is no longer required for each module that deals with a channel to call ast_module_user_hangup_all in it's unload function. The loader will automatically perform this action for it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 13:35:20 +00:00
Tilghman Lesher 9d05ff8ed5 Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 21:20:11 +00:00
Joshua Colp 1fda861ff8 Make 'H' command do as advertised and add 'E' and 'V' commands to ExternalIVR. (issue #8165 reported by mnicholson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 04:45:43 +00:00
Matt O'Gorman a395bd7c1d Merged revisions 48396 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.4

................
r48396 | mogorman | 2006-12-11 16:11:35 -0600 (Mon, 11 Dec 2006) | 12 lines

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

........
r48394 | mogorman | 2006-12-11 15:55:43 -0600 (Mon, 11 Dec 2006) | 4 lines

app_externalivr needs a real silence file, and additional
changes to add silence files into core instead of extra
patch provided by bug 8177 with minor additions.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 22:31:20 +00:00
Tilghman Lesher d670858735 Merged revisions 48375 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48375 | tilghman | 2006-12-10 18:47:21 -0600 (Sun, 10 Dec 2006) | 13 lines

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

........
r48374 | tilghman | 2006-12-10 18:33:59 -0600 (Sun, 10 Dec 2006) | 5 lines

When doing a fork() and exec(), two problems existed (Issue 8086):
1) Ignored signals stayed ignored after the exec().
2) Signals could possibly fire between the fork() and exec(), causing Asterisk
signal handlers within the child to execute, which caused nasty race conditions.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 00:52:19 +00:00
Russell Bryant 4337a82563 Merged revisions 46363 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46363 | russell | 2006-10-27 12:39:31 -0500 (Fri, 27 Oct 2006) | 5 lines

We should always be using _exit() after a fork() or vfork() instead of exit().
This is because exit() does some extra cleanup which in some implementations
of vfork(), for example, can actually modify the state of the parent process,
causing very weird bugs or crashes.  (issue #7971, Nick Gavrikov)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 17:42:57 +00:00
Joshua Colp 43b2735606 Merged revisions 45692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r45692 | file | 2006-10-19 13:19:47 -0400 (Thu, 19 Oct 2006) | 10 lines

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

........
r45691 | file | 2006-10-19 13:16:37 -0400 (Thu, 19 Oct 2006) | 2 lines

Respect language selection when seeing if the file exists (issue #8178 reported by mnicholson)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19 17:22:13 +00:00
Matt O'Gorman ae8cc3e18b bug #8076 check option_debug before printing to debug channel.
patch provided in bugnote, with minor changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 15:53:07 +00:00
Kevin P. Fleming 0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00
Kevin P. Fleming 472c1ca282 simplify autoconfig include mechanism (make tholo happy he can use lint again :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-07 18:54:56 +00:00
Russell Bryant f9c578a8a0 - The recent change to linklists.h broke the build on linux for some reason.
So, I have removed all of the uses of AST_LIST_HEAD_INIT and replaced them
   with the equivalent static initializations.
 - On passing, fix a memory leak in the unload_module() function of chan_agent.
   The agents list mutex was never destroyed, and the elements in the agents
   list were not freed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-11 20:07:44 +00:00
Russell Bryant 04ecb29d03 remove almost all of the checks of the result from ast_strdupa() or alloca().
As it turns out, all of these checks were useless, because alloca will never
return NULL.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-10 13:22:15 +00:00
Tilghman Lesher aeed5ca05d Merged revisions 24019 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r24019 | tilghman | 2006-05-01 15:44:24 -0500 (Mon, 01 May 2006) | 2 lines

Bug 6864 - drop realtime priority on ALL external processes

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@24053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-01 21:48:30 +00:00
Luigi Rizzo e43bc6634d This rather large commit changes the way modules are loaded.
As partly documented in loader.c and include/asterisk/module.h,
modules are now expected to return all of their methods and flags
into a structure 'mod_data', and are normally loaded with RTLD_NOW
| RTLD_LOCAL, so symbols are resolved immediately and conflicts
should be less likely.  Only in a small number of cases (res_*,
typically) modules are loaded RTLD_GLOBAL, so they can export
symbols.
 
The core of the change is only the two files loader.c and
include/asterisk/module.h, all the rest is simply adaptation of the
existing modules to the new API, a rather mechanical (but believe
me, time and finger-consuming!) process whose detail you can figure
out by svn diff'ing any single module.

Expect some minor compilation issue after this change, please
report it on mantis http://bugs.digium.com/view.php?id=6968
so we collect all the feedback in one place.

I am just sorry that this change missed SVN version number 20000!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-14 14:08:19 +00:00
Kevin P. Fleming f10f427d49 since the module API is changing, it's a good time to const-ify the description() and key() return values
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-08 22:01:19 +00:00
Olle Johansson d61a6c9a1c README files have changed names, better change references too :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@12572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-12 17:27:57 +00:00
Tilghman Lesher 697d3208dd Bug 6516 - u->chan not defined
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-16 22:59:38 +00:00
Russell Bryant a0d438fb6c remove the uses of the deprecated STANDARD_LOCAL_USER
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-15 20:11:56 +00:00
Russell Bryant 8578862401 don't re-define the localuser struct for custom use inside the module (issue #6216)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-27 00:31:05 +00:00
Russell Bryant 4414f45393 on this pass, only remove duplicate log messages
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21 20:57:06 +00:00
Russell Bryant 9fa6eb5e07 revert my pass through the tree to remove checks of the result of ast_strdupa
(revisions 8378 through 8381)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21 17:50:04 +00:00
Russell Bryant 7ad681adc8 remove lots of useless checks of the result of ast_strdupa
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21 08:13:12 +00:00
Russell Bryant 2eb7eecdd0 conversions to memory allocation wrappers (issue #6210)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-11 22:41:34 +00:00