Commit Graph

821 Commits

Author SHA1 Message Date
Russell Bryant 2842b71a32 Merged revisions 131421 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r131421 | russell | 2008-07-16 15:47:53 -0500 (Wed, 16 Jul 2008) | 7 lines

Always ensure that the channel's tech_pvt reference is NULL after calling the
destroy callback.
(closes issue #13060)
Reported by: jpgrayson
Patches:
      chan_iax2_tech_pvt_crash.patch uploaded by jpgrayson (license 492)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 20:48:27 +00:00
Tilghman Lesher e921e6f0de Merged revisions 130889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130889 | tilghman | 2008-07-14 18:59:13 -0500 (Mon, 14 Jul 2008) | 8 lines

Override the callerid in all cases when the callerid is set in the user, not
just when a remote callerid is set.  Also, if not set in the user, allow the
remote CallerID to pass through.
(closes issue #12875)
 Reported by: dimas
 Patches: 
       20080714__bug12875.diff.txt uploaded by Corydon76 (license 14)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 23:59:54 +00:00
Tilghman Lesher fe67adf6bc Merged revisions 130514 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130514 | tilghman | 2008-07-13 12:56:10 -0500 (Sun, 13 Jul 2008) | 4 lines

Reverting 2 changesets, as it breaks incoming IAX2 calls
(Related to issue #12963)
Reported by: mvanbaak

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-13 17:58:47 +00:00
Tilghman Lesher b66aa676fa Merged revisions 130169 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130169 | tilghman | 2008-07-11 13:51:56 -0500 (Fri, 11 Jul 2008) | 7 lines

Ensure that a destination callno of 0 will not match for frames that do not
start a dialog (new, lagrq, and ping).
(closes issue #12963)
 Reported by: russellb
 Patches: 
       chan_iax2_dup_new_fix4.patch uploaded by jpgrayson (license 492)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 18:52:42 +00:00
Tilghman Lesher 7e3be6c12f Merged revisions 129803 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129803 | tilghman | 2008-07-10 16:57:05 -0500 (Thu, 10 Jul 2008) | 8 lines

Correctly deal with duplicate NEW frames (due to retransmission).  Also, fixup
the destination call number matching to be more strict and reliable.
(closes issue #12963)
 Reported by: jpgrayson
 Patches: 
       chan_iax2_dup_new_fix3.patch uploaded by jpgrayson (license 492)
 Tested by: jpgrayson, Corydon76

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-10 22:06:07 +00:00
Tilghman Lesher aa81a86265 Merged revisions 129047 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129047 | tilghman | 2008-07-08 11:45:23 -0500 (Tue, 08 Jul 2008) | 7 lines

Timestamp decoding for video mini-frames is bogus, because the timestamp only
includes 15 bits, unlike voice frames, which contain a 16-bit timestamp.
(closes issue #13013)
 Reported by: jpgrayson
 Patches: 
       chan_iax2_unwrap_ts.patch uploaded by jpgrayson (license 492)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 16:49:01 +00:00
Brett Bryant d185405755 Janitor project to convert sizeof to ARRAY_LEN macro.
(closes issue #13002)
Reported by: caio1982
Patches:
      janitor_arraylen5.diff uploaded by caio1982 (license 22)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 16:40:28 +00:00
Russell Bryant 10cc442eb7 Merged revisions 128795 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r128795 | russell | 2008-07-07 17:41:48 -0500 (Mon, 07 Jul 2008) | 8 lines

Fix handling of when a pvt disappears.  Properly return the pvt locked
and don't hold the pvt lock while destroying the ast_channel.

(closes issue #13014)
Reported by: jpgrayson
Patches:
      chan_iax2_ast_iax2_new2.patch uploaded by jpgrayson (license 492)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 22:42:30 +00:00
Sean Bright 880a02f283 Merged revisions 128737 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r128737 | seanbright | 2008-07-07 16:47:56 -0400 (Mon, 07 Jul 2008) | 9 lines

Remove spurious trailing whitespace from log messages and fix a spelling error
in a log message.

(closes issue #13017)
Reported by: jpgrayson
Patches:
      chan_iax2_space_after_newline.patch uploaded by jpgrayson (license 492)
      chan_iax2_spelling.patch uploaded by jpgrayson (license 492)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 20:50:29 +00:00
Mark Michelson 834b8e8a71 Merged revisions 128639 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r128639 | mmichelson | 2008-07-07 12:02:28 -0500 (Mon, 07 Jul 2008) | 10 lines

By using the iaxdynamicthreadcount to identify a thread, it was possible
for thread identifiers to be duplicated. By using a globally-unique monotonically-
increasing integer, this is now avoided.

(closes issue #13009)
Reported by: jpgrayson
Patches:
      chan_iax2_dyn_threadnum.patch uploaded by jpgrayson (license 492)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@128640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 17:09:11 +00:00
Brett Bryant 022a157bd8 Remove commit that somehow got mergeed into trunk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 22:44:39 +00:00
Brett Bryant 10fdf344ed Update these files with transfer code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 22:36:02 +00:00
Tilghman Lesher 885d17506b Keep ast_app_inboxcount API compatible with 1.6.0.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02 21:27:53 +00:00
Tilghman Lesher e347f8bc70 Merged revisions 127133 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r127133 | tilghman | 2008-07-01 15:25:37 -0500 (Tue, 01 Jul 2008) | 2 lines

Disable the old, slow search for matching callno in chan_iax2 (but allow it to be reenabled for debugging)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 20:28:54 +00:00
Tilghman Lesher 3217aed39c Merged revisions 127068 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r127068 | tilghman | 2008-07-01 13:52:53 -0500 (Tue, 01 Jul 2008) | 8 lines

Change around how we schedule pings and lagrqs, and fix a reason why the
jobs were not getting properly cancelled.
(closes issue #12903)
 Reported by: stevedavies
 Patches: 
       20080620__bug12903__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: stevedavies

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 19:20:25 +00:00
Tilghman Lesher 6fa1dab33d Merged revisions 126999 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r126999 | tilghman | 2008-07-01 11:50:46 -0500 (Tue, 01 Jul 2008) | 2 lines

Suppress annoying warning by finding the remaining cases where the callno is not in the hash.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 16:52:29 +00:00
Tilghman Lesher 94c4089f4e More expansion of the deadlock avoidance macro, including a macro to do locking
of the channel lock


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-25 02:34:11 +00:00
Michiel van Baak 8e8359465b Older versions of GNU gcc do not allow 'NULL' as sentinel.
They want (char *)NULL as sentinel.
An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4

This commit introduces a contstant SENTINEL which is declared as:
#define SENTINEL ((char *)NULL)

All places I could test compile on my openbsd system are converted.
Update CODING-GUIDELINES to tell about this constant.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 20:48:33 +00:00
Tilghman Lesher bb0dbfa520 Merged revisions 123391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r123391 | tilghman | 2008-06-17 13:56:53 -0500 (Tue, 17 Jun 2008) | 3 lines

Fix 3 more places where failure to lock the structure could cause the wrong lock to be
unlocked.  (Closes issue #12795)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 18:57:45 +00:00
Tilghman Lesher 596f8b5186 Merged revisions 123113 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r123113 | tilghman | 2008-06-16 14:50:12 -0500 (Mon, 16 Jun 2008) | 2 lines

Port "hasvoicemail" change from SIP to other channel drivers

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 19:57:05 +00:00
Tilghman Lesher b2ef18dab4 Add some more IAX2-specific information about the channel to the CHANNEL()
function and begin the transition from SIPCHANINFO() to just using CHANNEL().
(closes issue #12856)
 Reported by: mostyn
 Patches: 
       iax_and_sip_channel_info.patch uploaded by mostyn (license 398)
       (with some additional cleanup by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-15 15:21:16 +00:00
Russell Bryant b6457ecf4c Merge changes from timing branch
- Convert chan_iax2 to use the timing API
 - Convert usage of timing in the core to use the timing API instead of
   using DAHDI directly
 - Make a change to the timing API to add the set_rate() function
 - change the timing core to use a rwlock
 - merge a timing implementation, res_timing_dahdi

Basic testing was successful using res_timing_dahdi


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 12:45:50 +00:00
Russell Bryant 968cf2b578 Merged revisions 122259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122259 | russell | 2008-06-12 13:22:44 -0500 (Thu, 12 Jun 2008) | 3 lines

Fix some race conditions that cause ast_assert() to report that chan_iax2 tried
to remove an entry that wasn't in the scheduler

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 18:23:54 +00:00
Jeff Peeler ef3b214728 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Russell Bryant 74932445b7 Bump up the debug level of a couple of messages
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 00:52:46 +00:00
Tilghman Lesher 53459f86b2 Expand RQ_INTEGER type out to multiple types, one for each precision
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-09 22:51:59 +00:00
Tilghman Lesher 9471b87d27 Merge the adaptive realtime branch, which will make adding new required fields
to realtime less painful in the future.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 19:07:27 +00:00
Russell Bryant 5866b0dfe8 Merged revisions 120168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120168 | russell | 2008-06-03 16:34:55 -0500 (Tue, 03 Jun 2008) | 4 lines

Fix another place where peer->callno could change at a very bad time, and also
fix a place where a peer was used after the reference was released.
(inspired by rev 120001)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 21:35:11 +00:00
Tilghman Lesher f3a62ab27e Merged revisions 120001 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120001 | tilghman | 2008-06-03 11:10:53 -0500 (Tue, 03 Jun 2008) | 9 lines

Save the callno when we're poking, because our peer structure could change
during destruction (and thus we unlock the wrong callno, causing a
cascade failure).
(closes issue #12717)
 Reported by: gewfie
 Patches: 
       20080525__bug12717.diff.txt uploaded by Corydon76 (license 14)
 Tested by: gewfie

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 16:19:35 +00:00
Russell Bryant d6240ac21e Merged revisions 119838 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119838 | russell | 2008-06-02 15:08:04 -0500 (Mon, 02 Jun 2008) | 7 lines

Revert a change made for issue #12479.  This change caused a regression such that
a dial string such as (IAX2/foo) did not automatically fall back to dialing the 's'
extension anymore.

(closes issue #12770)
Reported by: dagmoller

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 20:08:24 +00:00
Russell Bryant 2feb90d511 Merged revisions 119687 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119687 | russell | 2008-06-02 07:30:17 -0500 (Mon, 02 Jun 2008) | 3 lines

Even of the first PING or LAGRQ doesn't get sent because it comes up too soon,
make sure to reschedule so it gets sent later.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 12:30:42 +00:00
Russell Bryant ea3c47e7df Merged revisions 119533 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r119533 | russell | 2008-06-01 20:06:09 -0500 (Sun, 01 Jun 2008) | 2 lines

Change a debug message to an actual debug message

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 01:08:16 +00:00
Russell Bryant 87c9b6fc25 Merged revisions 119238 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r119238 | russell | 2008-05-30 07:55:36 -0500 (Fri, 30 May 2008) | 15 lines

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

........
r119237 | russell | 2008-05-30 07:49:39 -0500 (Fri, 30 May 2008) | 7 lines

- Instead of only enforcing destination call number checking on an ACK, check
  all full frames except for PING and LAGRQ, which may be sent by older versions
  too quickly to contain the destination call number.
  (As suggested by Tim Panton on the asterisk-dev list)
- Merge changes from team/russell/iax2-frame-race, which prevents PING and LAGRQ
  from being sent before the destination call number is known.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 12:59:11 +00:00
Russell Bryant 9397f04294 Merged revisions 119009 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r119009 | russell | 2008-05-29 13:49:12 -0500 (Thu, 29 May 2008) | 16 lines

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

........
r119008 | russell | 2008-05-29 13:45:21 -0500 (Thu, 29 May 2008) | 7 lines

Merge changes from team/russell/iax2-another-fix-to-the-fix

As described in the following post to the asterisk-dev mailing list, only
enforce destination call numbers when processing an ACK.

http://lists.digium.com/pipermail/asterisk-dev/2008-May/033217.html

(closes issue #12631)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 18:54:11 +00:00
Tilghman Lesher 6e5d843a71 Merged revisions 118953 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r118953 | tilghman | 2008-05-29 12:20:16 -0500 (Thu, 29 May 2008) | 3 lines

Add some debugging code that ensures that when we do deadlock avoidance, we
don't lose the information about how a lock was originally acquired.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 17:35:19 +00:00
Brett Bryant 7d6496c247 Fixes a bug in chan_iax that uses send_command to poke a peer while a channel is unlocked in some cases, and because it can cause seemingly
random failures could be related to some bugs in the tracker...


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-28 16:01:05 +00:00
Brett Bryant a06df81624 Remove loop from the detection of a sequence number that acknowledges
the receiving of a packet that we've kept in memory just incase the 
packet needs to be retransmitted.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 19:45:41 +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
Russell Bryant affbbe3bd2 Merged revisions 116978 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r116978 | russell | 2008-05-18 22:44:04 -0500 (Sun, 18 May 2008) | 4 lines

Avoid access of uninitialized memory.  This caused a bunch of crashes for me
while doing load testing of development branch where I'm working on some
performance improvements.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-19 03:44:28 +00:00
Joshua Colp 4943cbcf2c Improve native transfers when a chain of IAX2 connections are in use.
(closes issue #7567)
Reported by: tjd
Patches:
      bug_7567_update_v2.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-17 19:39:35 +00:00
Brett Bryant 9575b82389 A small change to fix iax2 native bridging.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-12 15:17:32 +00:00
Mark Michelson 7daebcd610 Adding support for "urgent" voicemail messages. Messages which are
marked "urgent" are considered to be higher priority than other messages
and so they will be played before any other messages in a user's mailbox.

There are two ways to leave an urgent message. 
1. send the 'U' option to VoiceMail().
2. Set review=yes in voicemail.conf. This will give instructions for 
   a caller to mark a message as urgent after the message has been recorded.

I have tested that this works correctly with file and ODBC storage, and James
Rothenberger (who wrote initial support for this feature) has tested its use
with IMAP storage.

(closes issue #11817)
Reported by: jaroth
	Based on branch http://svn.digium.com/svn/asterisk/team/jrothenberger/asterisk-urgent
Tested by: putnopvut, jaroth



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-09 21:22:42 +00:00
Russell Bryant b280054c38 Merged revisions 115568 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115568 | russell | 2008-05-08 14:19:50 -0500 (Thu, 08 May 2008) | 2 lines

Remove debug output.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 19:20:35 +00:00
Russell Bryant c961d9637f Merged revisions 115565 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r115565 | russell | 2008-05-08 14:15:25 -0500 (Thu, 08 May 2008) | 33 lines

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

........
r115564 | russell | 2008-05-08 14:14:04 -0500 (Thu, 08 May 2008) | 25 lines

Fix a race condition that bbryant just found while doing some IAX2 testing.
He was running Asterisk trunk running IAX2 calls through a few Asterisk boxes,
however, the audio was extremely choppy.  We looked at a packet trace and saw
a storm of INVAL and VNAK frames being sent from one box to another.

It turned out that what had happened was that one box tried to send a CONTROL
frame before the 3 way handshake had completed.  So, that frame did not include
the destination call number, because it didn't have it yet.  Part of our recent
work for security issues included an additional check to ensure that frames that
are supposed to include the destination call number have the correct one.  This
caused the frame to be rejected with an INVAL.  The frame would get retransmitted
for forever, rejected every time ...

This race condition exists in all versions that got the security changes,
in theory.  However, it is really only likely that this would cause a problem in
Asterisk trunk.  There was a control frame being sent (SRCUPDATE) at the _very_
beginning of the call, which does not exist in 1.2 or 1.4.  However, I am fixing
all versions that could potentially be affected by the introduced race condition.

These changes are what bbryant and I came up with to fix the issue.  Instead of
simply dropping control frames that get sent before the handshake is complete,
the code attempts to wait a little while, since in most cases, the handshake
will complete very quickly.  If it doesn't complete after yielding for a little
while, then the frame gets dropped.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 19:17:04 +00:00
Russell Bryant 9c549e6cf5 Merged revisions 115512 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r115512 | russell | 2008-05-07 11:24:09 -0500 (Wed, 07 May 2008) | 11 lines

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

........
r115511 | russell | 2008-05-07 11:22:49 -0500 (Wed, 07 May 2008) | 3 lines

Remove remnants of dlinkedlists.  I didn't actually use them in the final version
of my IAX2 improvements.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07 17:28:19 +00:00
Russell Bryant 27521f9e63 Remove my rant, since I have now replaced the rant with code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 20:28:17 +00:00
Russell Bryant 59f170973e Merged revisions 114891 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114891 | russell | 2008-04-30 11:30:01 -0500 (Wed, 30 Apr 2008) | 28 lines

Merge changes from team/russell/iax2_find_callno and iax2_find_callno_1.4

These changes address a critical performance issue introduced in the latest
release.  The fix for the latest security issue included a change that made
Asterisk randomly choose call numbers to make them more difficult to guess by
attackers.  However, due to some inefficient (this is by far, an understatement)
code, when Asterisk chose high call numbers, chan_iax2 became unusable after
just a small number of calls.  On a small embedded platform, it would not be
able to handle a single call.  On my Intel Core 2 Duo @ 2.33 GHz, I couldn't
run more than about 16 IAX2 channels.  Ouch.

These changes address some performance issues of the find_callno() function
that have bothered me for a very long time.  On every incoming media frame,
it iterated through every possible call number trying to find a matching
active call.  This involved a mutex lock and unlock for each call number
checked.  So, if the random call number chosen was 20000, then every media
frame would cause 20000 locks and unlocks.  Previously, this problem was
not as obvious since Asterisk always chose the lowest call number it could.

A second container for IAX2 pvt structs has been added.  It is an astobj2
hash table.  When we know the remote side's call number, the pvt goes into
the hash table with a hash value of the remote side's call number.  Then,
lookups for incoming media frames are a very fast hash lookup instead of an
absolutely insane array traversal.

In a quick test, I was able to get more than 3600% more IAX2 channels
on my machine with these changes.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 16:34:24 +00:00
Kevin P. Fleming 63f5e27842 Merged revisions 114880 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114880 | kpfleming | 2008-04-30 09:46:57 -0500 (Wed, 30 Apr 2008) | 2 lines

use the ARRAY_LEN macro for indexing through the iaxs/iaxsl arrays so that the size of the arrays can be adjusted in one place, and change the size of the arrays from 32768 calls to 2048 calls when LOW_MEMORY is defined

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 14:49:51 +00:00
Russell Bryant 7be171455d Merged revisions 114673 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114673 | russell | 2008-04-25 16:54:40 -0500 (Fri, 25 Apr 2008) | 3 lines

Use consistent logic for checking to see if a call number has been chosen yet.
Also, remove some redundant logic I recently added in a fix.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 22:00:35 +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