Commit Graph

1389 Commits

Author SHA1 Message Date
Tilghman Lesher 237fbf35fc If the leading underscore is not stripped before comparison,
pbx_builtin_getvar_helper() will never find the associated variable.
(Bug 7892)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-10 17:35:08 +00:00
Olle Johansson 5a622d032e Don't destruct sessions prematurely. Especially not when we want reliable retransmissions...
If this works properly, we might have to check 1.2 to implement a backport.

The theory is that if you get a final reply in a session, it is ok to destroy the session.
If you send a final reply, you need to keep the session open for potential retransmits
from the other side. If you send a HANGUP/CANCEL, wait to the other side confirms
or until you have a timeout. If you send HANGUP/CANCEL/ACK reliably, don't destroy
the session so that you cancel the needed retransmits.

I will have to change the timer to 64*T1, but that will be a separate patch. That will
mean that if we know the roundtrip time, we can destroy sessions quicker.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09 12:44:36 +00:00
Olle Johansson 01714e962b importing rev 42535 from 1.2 (which by mistake was actually imported from svn trunk)
- Maybe the first circular commit?


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09 12:25:18 +00:00
Olle Johansson d0cbbaf8d7 Don't destroy pvt prematurely. Wait for answer or timeout.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09 12:01:59 +00:00
Olle Johansson 562b491a85 Clear proper flag
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-09 12:00:19 +00:00
Joshua Colp 53cf63c33a Convert some warnings into debug messages since they can exist under perfectly normal circumstances that the user shouldn't care about (issue #7894 reported by stephen_dredge)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-07 16:51:11 +00:00
Olle Johansson bd4e57a873 Make sure we handle CANCEL/ACK properly (imported with mods from 1.2)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-04 15:57:26 +00:00
Joshua Colp e43b830a9d Merged revisions 41768 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r41768 | file | 2006-09-01 18:49:07 -0400 (Fri, 01 Sep 2006) | 2 lines

Only wipe the redirected audio & video IP/port if it's specified, and trigger a reinvite.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-01 22:51:46 +00:00
Joshua Colp 0be2884d80 If we are doing video and we can't reinvite, then resort to generic bridging instead of Packet2Packet since video isn't supported there yet. (reported by PCadach in #asterisk-bugs)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-01 17:54:22 +00:00
Joshua Colp 8ee7419d26 If no number is specified in the SIP_HEADER dialplan function, then just use the first one. (issue #7854 reported by sxpert and issue #7863 reported by hristo)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-01 16:19:03 +00:00
Matt O'Gorman 05a695af72 everything that loads a config that needs a config file to run
now reports AST_MODULE_LOAD_DECLINE when loading if config file
is not there, also fixed an error in res_config_pgsql where it 
had a non static function when it should.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31 21:00:20 +00:00
Joshua Colp c6977b9983 Merge in VLDTMF support with Zaptel/Core done by the ever great Darumkilla Russell Bryant and the RTP portion done by myself, Muffinlicious Joshua Colp. This has gone through so many discussions/revisions it's not funny but we finally have it!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31 01:59:02 +00:00
Olle Johansson 6ca927457d Why check bridgepeer twice?
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30 20:24:32 +00:00
Olle Johansson 18164dec14 Don't add headers to an uninitialized eq (from issue 7694 garyhai, but not
a resolution to that bug report)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30 19:51:31 +00:00
Olle Johansson 13eb698ce7 Note to myself: Remember Russell's note: Always compile first...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30 19:20:29 +00:00
Olle Johansson 2c98238fbe Mark ALERT_INFO as deprecated. This can now be done with the sipaddheader() application and
does not need special code in chan_sip any more.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30 19:16:53 +00:00
Olle Johansson 0ace854142 Issue #7572 (Boesl) - hangup channel that get buggy 487 response (imported from 1.2)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30 19:07:21 +00:00
Olle Johansson 7aa333c9ef Issue #7822 - don't issue SRV lookups if it's disabled. (barthek)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30 14:36:46 +00:00
Joshua Colp 12b6ec4e11 Use an API call (ast_rtp_get_bridged) to return the RTP stream we are bridged to, and also use it in chan_sip so we know to ignore the no RTP activity checking
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-30 03:16:03 +00:00
Joshua Colp c70ed7614a Merge in RTP-level packet bridging. Packet comes in, packet goes out - that's what RTP-level packet bridging is all about!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-28 17:37:56 +00:00
Joshua Colp 1c182a606a Allow an offset for SIP_HEADER so you can get more then 1 header of the same name if they exist. Why someone would want to grab something like Via headers from dialplan I don't exactly know, but okay. (issue #7563 reported by Corydon76)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 19:33:42 +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
Russell Bryant a8272afb1f fix the use of an uninitialized variable (issue #7746, pointed out by garyhai)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-17 19:14:20 +00:00
Joshua Colp 59766196ea Move things around a bit more for onhold support, and add a check to only decrement the onhold variable if it's greater then 0. (issue #7740 reported by AuPix)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-16 15:34:50 +00:00
Russell Bryant 9f9a5f1984 move the calls to ast_jb_configure() to before the PBX thread is started on the
channel to remove the theoretical race condition that the channel could get
bridged before the channel's jitterbuffer gets configured.  This was pointed
out by PCadach on IRC.  Thanks!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-16 03:43:47 +00:00
Russell Bryant fff5a55af6 print a more user friendly error message with the text representation of codecs
(issue #7233, Mithraen)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-15 22:28:38 +00:00
Russell Bryant 65373a1987 reduce duplicated code by using print_codec_to_cli in sip_show_user as it is
already used in sip_show_peer (issue #7739, DEA)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-15 22:17:38 +00:00
Joshua Colp 4ebd436c85 Add support to see if a peer has someone on hold, and fix a small bug with getting the state name. This one goes out to you mog!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-10 02:41:20 +00:00
Russell Bryant 92bd7f19f7 Merge team/russell/ast_verbose_threadstorage
- instead of defining a free() wrapper in a bunch of files, define it as
  ast_free() in utils.h and remove the copies from all the files.

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

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

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

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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-08 06:32:04 +00:00
Olle Johansson a42c164879 Fix accidental removal of if() in commit 38905
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-07 16:20:23 +00:00
Olle Johansson b57c238260 Issue #7651 - always send subscription-state (AuPix)
Small change to the fix in the report.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-07 09:22:43 +00:00
Russell Bryant 9892054414 Merged revisions 38950 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

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

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

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-05 07:22:27 +00:00
Russell Bryant 663adb2b0e Merged revisions 38903-38904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

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

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

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

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

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

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-05 05:26:29 +00:00
Joshua Colp e306f812df Don't assume that a referred by URI will always exist (issue #7641 reported and fixed by AuPix)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-04 18:40:47 +00:00
Kevin P. Fleming 1b784cd1f7 Merged revisions 38731 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38731 | kpfleming | 2006-08-02 14:29:56 -0500 (Wed, 02 Aug 2006) | 3 lines

fix brain-damage I introduced when trying to fix the CANCEL/BYE sending mechanism for pending INVITES
accept unknown 1xx responses as 183 responses (as RFC3261 mandates we should do)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-02 19:32:38 +00:00
Kevin P. Fleming ec2e7aee56 Merged revisions 38611 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38611 | kpfleming | 2006-07-31 16:14:11 -0500 (Mon, 31 Jul 2006) | 4 lines

don't reissue hangup requests for SIP channels that have expired their RTP timeouts (one time is enough)
don't rescan the SIP private structure list too fast, it can cause channels to not be able to hang up (issue #7495, and probably others)
use ast_softhangup_nolock() since we already hold the channel's lock

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-31 21:31:44 +00:00
Russell Bryant 450db95711 add macros for the pure and const attributes to compiler.h, in case they ever
need to be handled differently for a specific compiler


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 22:50:54 +00:00
Russell Bryant d6246e579f Add the function attribute "pure" or "const" to various functions that perform
int to string or string to int operations.

"pure" essentially says that this function has no side effects aside from its
result, and the result depends on nothing else other than its arguments and
global variables.  "const" is a more strict form of "pure", where the function
also doesn't access any global variables.

From the gcc manual: "Such a function can be subject to common subexpression 
elimination and loop optimization just as an arithmetic operator would be."
This also tells the compiler that it is safe to call the function fewer times
than the code says to, given the same arguments, since the result will always
be the same.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 22:14:49 +00:00
Joshua Colp 48c09ef517 Merged revisions 38420 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38420 | file | 2006-07-28 14:49:00 -0400 (Fri, 28 Jul 2006) | 2 lines

Make a copy of the request URI in check_user_full instead of modifying the one on the structure, and also strip params properly from the user portion of the SIP URI so as to preserve the domain (issue #7552 reported by dan42)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 18:53:43 +00:00
Russell Bryant 1df50be628 Merged revisions 38288 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38288 | russell | 2006-07-26 21:58:41 -0400 (Wed, 26 Jul 2006) | 3 lines

fix a crash when MALLOC_DEBUG is enabled and the regexten is enabled. The crash
would occur when the extension got removed. (fixes issue #7484)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 02:00:20 +00:00
Joshua Colp 6d52c0b559 Merged revisions 38234 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38234 | file | 2006-07-26 11:26:06 -0400 (Wed, 26 Jul 2006) | 2 lines

Put default callerid into contact when the one specified is either NULL or has a zero string length. (issue #7590 reported by key2)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-26 15:27:45 +00:00
Joshua Colp cbf79ca489 Start out with cleared RTP payload structures instead of defaults. This should prevent issues where if a stream (audio/stream) is not present and it's RTP payload structure is combined with the overall capability then the capability would be every codec that Asterisk supports.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 15:47:59 +00:00
Luigi Rizzo 2c3bc8b1b3 move middle-of-the-block declaration at the top.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 11:46:27 +00:00
Joshua Colp 6810884f60 Only deal with getting the supported payloads on audio if an audio RTP stream exists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 03:42:27 +00:00
Russell Bryant d897bd41c2 use ast_atomic_fetchadd_int in chan_zap, sip, and iax2 for usecount handling
and fix a couple little things in passing
 - usecnt was not initialized in chan_iax2
 - ast_update_use_count() was not called after incrementing the count in chan_sip


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-22 00:33:56 +00:00
BJ Weschke f2611e36c3 This corrects the crash condition present in #7575, but I'm not really sure if it's the "right" fix. Please review and make any adjustments you see necessary.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-21 19:10:58 +00:00
Russell Bryant ca9ba719b6 Merge a new implementation of ast_inet_ntoa, our thread safe replacement for
inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-21 17:31:28 +00:00
Joshua Colp 1861dcdff5 Only bitmaskify the RTP payload structure for video if an RTP structure exists for it... otherwise the default values will cause codec combination madness
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-20 18:42:22 +00:00
North Antara 1edb21b423 Fix a few doxygen warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-19 22:40:36 +00:00
Kevin P. Fleming 6d0742fc16 merge Russell's 'hold_handling' branch, finally implementing music-on-hold handling the way it was decided at AstriDevCon Europe 2006 (and the way people really want it to be)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-19 20:44:39 +00:00