dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

933 Commits

Author SHA1 Message Date
dvossel 8cc1586cd2 fixes iax2 show cache locking error, thanks alecdavis!
(closes issue #16094)
Reported by: alecdavis
Patches:
      bug16094.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis, dvossel


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230726 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-20 22:35:54 +00:00
kpfleming 7804b5b88d Merged revisions 230246 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230246 | kpfleming | 2009-11-15 11:19:06 -0600 (Sun, 15 Nov 2009) | 6 lines
  
  Correct mistaken option name in error message.
  
  The configuration option for allowing hosts to make non-token-based calls
  is 'calltokenoptional', not 'calltokenignore'. (reported on asterisk-users)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230247 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-15 17:23:02 +00:00
tilghman 317ea2e45d Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230111 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 20:42:03 +00:00
dvossel c231d5a898 Merged revisions 229167 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r229167 | dvossel | 2009-11-10 11:15:57 -0600 (Tue, 10 Nov 2009) | 9 lines
  
  don't crash on log message in solaris
  
  AST-2009-006
  
  (closes issue #16206)
  Reported by: bklang
  Tested by: bklang
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229168 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-10 17:16:49 +00:00
tilghman 22a9bedb8b Two other trunk build fixes (reported by seanbright on #asterisk-dev)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227615 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 16:17:18 +00:00
tilghman 3bacd4082e Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 14:05:12 +00:00
dvossel 43e42a8b82 Merged revisions 225243 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225243 | dvossel | 2009-10-21 15:58:08 -0500 (Wed, 21 Oct 2009) | 13 lines
  
  IAX2: VNAK loop caused by signaling frames with no destination call number
  
  It is possible for the PBX thread to queue up signaling frames before
  a destination call number is received.  This can result in signaling
  frames being sent out with no destination call number. Since recent
  versions of Asterisk require accurate destination callnumbers for all
  Full Frames, this can cause a VNAK loop to occur.  To resolve this
  no signaling frames are sent until a destination callnumber is received,
  and destination call numbers are now only required for iax_pvt matching
  when the frame is an ACK.
  
  Review: https://reviewboard.asterisk.org/r/413/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225307 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 21:58:46 +00:00
dvossel 7f743355f9 Merged revisions 225032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225032 | dvossel | 2009-10-21 09:37:04 -0500 (Wed, 21 Oct 2009) | 20 lines
  
  IAX/SIP shrinkcallerid option
  
  The shrinking of caller id removes '(', ' ', ')', non-trailing '.',
  and '-' from the string.  This means values such as 555.5555 and
  test-test result in 555555 and testtest.  There are instances,
  such as Skype integration, where a specific value is passed via
  caller id that must be preserved unmodified.  This patch makes
  the shrinking of caller id optional in chan_sip and chan_iax in
  order to support such cases.  By default this option is on to
  preserve previous expected behavior.
  
  (closes issue #15940)
  Reported by: dimas
  Patches:
        v2-15940.patch uploaded by dimas (license 88)
        15940_shrinkcallerid_trunk.c uploaded by dvossel (license 671)
  Tested by: dvossel
  
  Review: https://reviewboard.asterisk.org/r/408/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225033 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 14:39:10 +00:00
kpfleming e299cf0653 Recorded merge of revisions 222152 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
  
  Fix ao2_iterator API to hold references to containers being iterated.
  
  See Mantis issue for details of what prompted this change.
  
  Additional notes:
  
  This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
  has become an enum instead of a macro, with a name that fits our
  naming policy; also, it is now necessary to call
  ao2_iterator_destroy() on any iterator that has been
  created. Currently this only releases the reference to the container
  being iterated, but in the future this could also release other
  resources used by the iterator, if the iterator implementation changes
  to use additional resources.
  
  (closes issue #15987)
  Reported by: kpfleming
  
  Review: https://reviewboard.asterisk.org/r/383/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222176 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 01:24:24 +00:00
dvossel 1c483971dd Merged revisions 222026 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222026 | dvossel | 2009-10-02 12:32:13 -0500 (Fri, 02 Oct 2009) | 3 lines
  
  Removes unnecessary unlock, clarifies a memcpy.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222030 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-02 17:34:07 +00:00
dvossel 494f4abbd8 Merged revisions 219720 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219720 | dvossel | 2009-09-21 11:55:53 -0500 (Mon, 21 Sep 2009) | 3 lines
  
  Reverting merge 219520. This change was not necessary.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219721 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-21 16:59:05 +00:00
russell 62e02563d4 Merged revisions 219586 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219586 | russell | 2009-09-18 21:51:13 -0500 (Fri, 18 Sep 2009) | 6 lines
  
  Make sure the iax_pvt exists before dereferencing it.
  
  This fixes the latest crash posted on issue 15609.
  
  (issue #15609)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219587 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-19 02:59:52 +00:00
dvossel c6b45bd6c9 Merged revisions 219519 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219519 | dvossel | 2009-09-18 18:19:50 -0500 (Fri, 18 Sep 2009) | 9 lines
  
  iax2 frame double free
  
  The iax frame's retrans sched id was written over right
  before iax2_frame_free was called.  In iax2_frame_free that
  retrans id is used to delete the sched item.  By writing over
  the retrans field before the sched item could be deleted, it was
  possible for a retransmit to occur on a freed frame.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219520 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-18 23:20:58 +00:00
tilghman 0e328e2e61 Make calltoken support work with realtime users and peers.
In the course of this, I also found that the results of ast_gethostbyname
were being used incorrectly in both chan_iax2 and chan_sip, so both have
been fixed.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217916 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 23:12:16 +00:00
dvossel 3d1f0d7123 Merged revisions 217806 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r217806 | dvossel | 2009-09-10 16:06:07 -0500 (Thu, 10 Sep 2009) | 22 lines
  
  IAX2 encryption regression
  
  The IAX2 Call Token security patch inadvertently broke the use of
  encryption due to the reorganization of code in the socket_process()
  function.  When encryption is used, an incoming full frame must first
  be decrypted before the information elements can be parsed.  The
  security release mistakenly moved IE parsing before decryption in
  order to process the new Call Token IE.  To resolve this, decryption
  of full frames is once again done before looking into the frame.  This
  involves searching for an existing callno, checking the pvt to see if
  encryption is turned on, and decrypting the packet before the internal
  fields of the full frame are accessed.
  
  (closes issue #15834)
  Reported by: karesmakro
  Patches:
        iax2_encryption_fix_1.4.diff uploaded by dvossel (license 671)
  Tested by: dvossel, karesmakro
  
  Review: https://reviewboard.asterisk.org/r/355/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217807 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 21:07:47 +00:00
dvossel 39acf19959 Merge code associated with AST-2009-006
(closes issue #12912)
Reported by: rathaus
Tested by: tilghman, russell, dvossel, dbrooks


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215955 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 16:31:54 +00:00
tilghman d1ec1aa57d AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10 19:20:57 +00:00
jpeeler 68253f0e47 Merged revisions 208923 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208923 | jpeeler | 2009-07-26 20:18:31 -0500 (Sun, 26 Jul 2009) | 2 lines
  
  Fix logic errors from 208746
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208924 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 01:20:37 +00:00
jpeeler 8b161d8e38 Merged revisions 208746 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208746 | jpeeler | 2009-07-25 01:19:50 -0500 (Sat, 25 Jul 2009) | 7 lines
  
  Fix compiling under dev-mode with gcc 4.4.0.
  
  Mostly trivial changes, but I did not know of any other way to fix the
  "dereferencing type-punned pointer will break strict-aliasing rules" error
  without creating a tmp variable in chan_skinny.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208749 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-25 06:23:18 +00:00
dvossel 7ee3a37c58 fixes an error in r203638 CEL commit
(closes issue #15525)
Reported by: elguero
Patches:
      iax2-double-unlock.patch uploaded by elguero (license 37)
      15525.diff uploaded by dvossel (license 671)
Tested by: dvossel



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@207225 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-17 22:07:36 +00:00
russell 05976c1854 Merged revisions 206385 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
  r206385 | russell | 2009-07-14 09:48:00 -0500 (Tue, 14 Jul 2009) | 13 lines
  
  Merged revisions 206384 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.2
  
  ........
    r206384 | russell | 2009-07-14 09:45:47 -0500 (Tue, 14 Jul 2009) | 6 lines
    
    Ensure apathetic replies are sent out on the proper socket.
    
    chan_iax2 supports multiple address bindings.  The send_apathetic_reply()
    function did not attempt to send its response on the same socket that the
    incoming message came in on.
  ........
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@206386 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-14 14:51:44 +00:00
dvossel 4fc4098a76 Merged revisions 205471 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205471 | dvossel | 2009-07-08 18:15:54 -0500 (Wed, 08 Jul 2009) | 10 lines
  
  Fixes 8khz assumptions
  
  Many calculations assume 8khz is the codec rate. This
  is not always the case.  This patch only addresses chan_iax.c
  and res_rtp_asterisk.c, but I am sure there are other areas
  that make this assumption as well.
  
  Review: https://reviewboard.asterisk.org/r/306/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205479 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 23:19:09 +00:00
dvossel 02583c93f8 moving debug message from level 0 to 1.
(closes issue #15404)
Reported by: leobrown
Patches:
      iax_codec_debug.patch uploaded by leobrown (license 541)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203710 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 19:47:11 +00:00
russell ac3b35dcc7 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 15:28:53 +00:00
dvossel 2214b054b2 Merged revisions 201993 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r201993 | dvossel | 2009-06-19 15:22:02 -0500 (Fri, 19 Jun 2009) | 8 lines
  
  timestamp was being converted to host order as a short rather than a long
  
  (closes issue #15361)
  Reported by: ffloimair
  Patches:
        ts_issue.diff uploaded by dvossel (license 671)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201994 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-19 20:24:37 +00:00
dvossel 23880c210e Add rtsavesysname to chan_iax
chan_sip has an option to save the sysname on rtupdate.  This patch copies that same logic to chan_iax.

(closes issue #14837)
Reported by: barthpbx
Patches:
      iax2-rtsavesysname.patch uploaded by barthpbx (license 744)
      rt_iax.diff uploaded by dvossel (license 671)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201534 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-17 21:56:42 +00:00
dvossel 3cf38b393b update chan_iax to use 64bit feature flags.
(closes issue #15335)
Reported by: lmadsen

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201331 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-17 14:42:06 +00:00
kpfleming abe57aceec Convert a number of global module variables to 'static'.
These modules all contained variables that are module-global but not system-global,
but were not marked 'static'.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200587 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15 17:06:34 +00:00
dvossel daf31860a5 Merged revisions 199138 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r199138 | dvossel | 2009-06-04 14:00:15 -0500 (Thu, 04 Jun 2009) | 3 lines
  
  Additional updates to AST-2009-001
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199139 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-04 19:10:16 +00:00
dvossel 8160bfb09a fixes issue with channels not going down after transfer
Iax2 currently does not support native bridging if the timeoutms value is set.  We check for that in iax2_bridge, but then set timeoutms to 0 by default.  If the timeoutms is not provided it is set to -1. By setting timeoutms to 0 it is processed causing a bridging retry loop.

(closes issue #15216)
Reported by: oxymoron
Tested by: dvossel


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198824 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-02 17:55:35 +00:00
file c0d99c36f8 Fix a bug where the trunkmtu setting was not set to the default value of 1240 on load but was on reload.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197697 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28 18:45:11 +00:00
eliel cbbfdc573c Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196308 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 17:52:35 +00:00
kpfleming 230a66da7d 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: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 21:13:09 +00:00
dvossel d57c20e50d Merged revisions 195991 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195991 | dvossel | 2009-05-21 14:04:56 -0500 (Thu, 21 May 2009) | 14 lines
  
  Sign problem calculating timestamp for iax frame leads to no audio on the receiving peer.
  
  There are rare cases in which a frame's delivery timestamp is slightly less than the iax2_pvt's offset.  This causes the pvt's timestamp to be a small negative number, but since the timestamp value is unsigned it looks like a huge positive number.  This patch checks for this negative case and sets the ms to zero.  A similar check is already done right below this one in the 'else' statement.
  
  (closes issue #15032)
  Reported by: guillecabeza
  Patches:
        chan_iax2.c.patch_timestamp uploaded by guillecabeza (license 380)
  Tested by: guillecabeza
  
  (closes issue #14216)
  Reported by: Andrey Sofronov
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195995 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 19:11:49 +00:00
dvossel 29923af7f5 Merged revisions 194873 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r194873 | dvossel | 2009-05-15 17:43:13 -0500 (Fri, 15 May 2009) | 17 lines
  
  IAX2 REGAUTH loop
  
  IAX was not sending REGREJ to terminate invalid registrations.  Instead it sent another REGAUTH if the authentication challenge failed.  This caused a loop of REGREQ and REGAUTH frames.
  
  (Related to Security fix AST-2009-001)
  
  (closes issue #14867)
  Reported by: aragon
  Tested by: dvossel
  
  (closes issue #14717)
  Reported by: mobeck
  Patches:
        regauth_loop_update_patch.diff uploaded by dvossel (license 671)
  Tested by: dvossel
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@194874 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-15 22:44:44 +00:00
dvossel 9925f010f9 Merged revisions 194557,194685 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r194557 | dvossel | 2009-05-14 17:59:43 -0500 (Thu, 14 May 2009) | 10 lines
  
  IAX2 "Ghost" Channels
  
  There is a bug tracker issue where people are reporting "Ghost" channels in their 'iax2 show channels' output.  The confusion is caused by channels being listed as "(NONE)" with format "unknown".  These are not channels of coarse.  They are usually just pending registration or poke requests, but it is confusing output.  To help make sense of this I have added two columns to 'iax2 show channels'.  One shows the first message which started the transaction, and the second shows the last message sent by either side of the call.  This helps diagnose why the entry exists and why it may not go away.
  
  (closes issue #14207)
  Reported by: clive18
  
  Review: https://reviewboard.asterisk.org/r/246/
........
  r194685 | dvossel | 2009-05-15 10:40:37 -0500 (Fri, 15 May 2009) | 6 lines
  
  Update to previous IAX2 "Ghost" Channels patch.
  
  Fixed some comments made on reviewboard for the previous patch.
  
  (issue #14207)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@194833 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-15 20:52:12 +00:00
file 40b81e6709 Fix a bug where a timer would be created but not acknowledged.
This scenario crept up if chan_iax2 was loaded with no configuration file present.
It would create a timer and tell it to go at an interval but the thread that normally
acknowledges it would not be created because no configuration file was present. The timer
will now be closed if no configuration file is present.

(closes issue #15014)
Reported by: madkins


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192808 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-06 17:38:51 +00:00
dvossel 516812be83 Merged revisions 192213 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r192213 | dvossel | 2009-05-04 17:37:31 -0500 (Mon, 04 May 2009) | 11 lines
  
  global mohinterpret setting is ignored
  
  mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.
  
  (closes issue #14728)
  Reported by: dimas
  Patches:
        v1-14728.patch uploaded by dimas (license 88)
  Tested by: dimas, dvossel
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192214 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-04 22:44:51 +00:00
tilghman 8f6bc691ef Set debug message back to DEBUG level.
(closes issue #15007)
 Reported by: hulber


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191494 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-01 18:18:00 +00:00
russell 89175b7e04 Convert the ast_channel data structure over to the astobj2 framework.
There is a lot that could be said about this, but the patch is a big 
improvement for performance, stability, code maintainability, 
and ease of future code development.

The channel list is no longer an unsorted linked list.  The main container 
for channels is an astobj2 hash table.  All of the code related to searching 
for channels or iterating active channels has been rewritten.  Let n be 
the number of active channels.  Iterating the channel list has gone from 
O(n^2) to O(n).  Searching for a channel by name went from O(n) to O(1).  
Searching for a channel by extension is still O(n), but uses a new method 
for doing so, which is more efficient.

The ast_channel object is now a reference counted object.  The benefits 
here are plentiful.  Some benefits directly related to issues in the 
previous code include:

1) When threads other than the channel thread owning a channel wanted 
   access to a channel, it had to hold the lock on it to ensure that it didn't 
   go away.  This is no longer a requirement.  Holding a reference is 
   sufficient.

2) There are places that now require less dealing with channel locks.

3) There are places where channel locks are held for much shorter periods 
   of time.

4) There are places where dealing with more than one channel at a time becomes 
   _MUCH_ easier.  ChanSpy is a great example of this.  Writing code in the 
   future that deals with multiple channels will be much easier.

Some additional information regarding channel locking and reference count 
handling can be found in channel.h, where a new section has been added that 
discusses some of the rules associated with it.

Mark Michelson also assisted with the development of this patch.  He did the 
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it 
much easier to deal with holding on to a channel pointer for an extended period 
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.

Thanks to David Vossel for his assistance with this branch, as well.  David 
did the conversion of the DAHDIScan application by making it become a wrapper 
for ChanSpy internally.

The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.

Review: http://reviewboard.digium.com/r/203/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190423 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 14:04:26 +00:00
dbailey a20fffa38d Merged revisions 189391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r189391 | dbailey | 2009-04-20 14:10:56 -0500 (Mon, 20 Apr 2009) | 4 lines
  
  Clean up problem with manager implementation of mmap where it was not testing against MAP_FAILED response.
  Got rid of shadowed variable used in processign the mmap results. 
  Change test of mmap results to compare against MAP_FAILED
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@189419 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-20 19:28:16 +00:00
file 909e050f48 Do not try to send the format read/format write/make compatible options over IAX2.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187361 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 16:27:53 +00:00
mmichelson f00656db9e This commit introduces COLP/CONP and Redirecting party information into Asterisk.
The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.

A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.

This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.

(closes issue #8824)
Reported by: gareth

Review: http://reviewboard.digium.com/r/201



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186525 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 22:41:46 +00:00
file 27b4657d60 Add better support for relaying success or failure of the ast_transfer() API call.
This API call now waits for a special frame from the underlying channel driver to
indicate success or failure. This allows the return value to truly convey whether
the transfer worked or not. In the case of the Transfer() dialplan application this
means the value of the TRANSFERSTATUS dialplan variable is actually true.

(closes issue #12713)
Reported by: davidw
Tested by: file


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186382 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 16:47:27 +00:00
russell 300bccd8d5 Improve performance of the code handling the frame queue in chan_iax2.
In my tests that exercised full frame handling in chan_iax2, the version with
these changes took 30% to 40% of the CPU time compared to the same test of
Asterisk trunk before these modifications.

While doing some profiling for <http://reviewboard.digium.com/r/205/>,
one function that caught my eye was network_thread() in chan_iax2.c.
After the things that I was working on there, it was the next target
for analysis and optimization.  I used oprofile's source annotation
functionality and found that the loop traversing the frame queue in
network_thread() was to blame for the excessive CPU cycle consumption.

The frame_queue in chan_iax2 previously held all frames that either were
pending transmission or had been transmitted and are still pending
acknowledgment.

In network_thread(), the previous code would go back through the main
for loop after reading a single incoming frame or after being signaled
because a frame had been queued up for initial transmission.  In each
iteration of the loop, it traverses the entire frame queue looking for
frames that need to be transmitted.  On a busy server, this could easily
be quite a few entries.

This patch is actually quite simple.  The frame_queue has become only a list
of frames pending acknowledgment.  Frames that need to be transmitted are
queued up to a dedicated transmit thread via the taskprocessor API.

As a result, the code in network_thread() becomes much simpler, as its only
job is to read incoming frames.

In addition to the previously described changes, this patch includes some
additional changes to the frame_queue.  Instead of one big frame_queue, now
there is a list per call number to further reduce wasted list traversals.
The biggest impact of this change is in socket_process().

For additional details on testing and test results, see the review request.

Review: http://reviewboard.digium.com/r/212/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@185432 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-31 19:07:58 +00:00
kpfleming 4a40e0ec6f Improve timing interface to remember which provider provided a timer
The ability to load/unload timing interfaces is nice, but it means that when a timer is allocated, it may come from provider A, but later provider B becomes the 'preferred' provider. If this happens, all timer API calls on the timer that was provided by provider A will actually be handed to provider B, which will say WTF and return an error.

This patch changes the timer API to include a pointer to the provider of the timer handle so that future operations on the timer will be forwarded to the proper provider.

(closes issue #14697)
Reported by: moy

Review: http://reviewboard.digium.com/r/211/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184762 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 19:10:32 +00:00
russell f89c5f7e6c Improve performance of the ast_event cache functionality.
This code comes from svn/asterisk/team/russell/event_performance/.

Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.

1) Asterisk 1.6.1 introduces some additional logic to be able to handle
   distributed device state.  This functionality comes at a cost.
   One relatively minor change in this patch is that the extra processing
   required for distributed device state is now completely bypassed if
   it's not needed.

2) One of the things that I noticed when profiling this code was that a
   _lot_ of time was spent doing string comparisons.  I changed the way
   strings are represented in an event to include a hash value at the front.
   So, before doing a string comparison, we do an integer comparison on the
   hash.

3) Finally, the code that handles the event cache has been re-written.
   I tried to do this in a such a way that it had minimal impact on the API.
   I did have to change one API call, though - ast_event_queue_and_cache().
   However, the way it works now is nicer, IMO.  Each type of event that
   can be cached (MWI, device state) has its own hash table and rules for
   hashing and comparing objects.  This by far made the biggest impact on
   performance.

For additional details regarding this code and how it was tested, please see the
review request.

(closes issue #14738)
Reported by: russell

Review: http://reviewboard.digium.com/r/205/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184339 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-25 21:57:19 +00:00
russell 68ed17a636 Exclude slin16, siren7, and siren14 from bandwidth=low and =medium
The default codec configuration for chan_iax2 is bandwidth=low.  I noticed
slin16 being negotiated as the codec in some test calls, but that no longer
happens after this change.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184037 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-24 21:40:44 +00:00
russell 0fd6771c80 Merged revisions 183559 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r183559 | russell | 2009-03-20 11:53:25 -0500 (Fri, 20 Mar 2009) | 2 lines

Fix a crash in IAX2 registration handling found during load testing with dvossel.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183560 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-20 17:00:58 +00:00
dvossel 7e93a38456 Merged revisions 182281 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182281 | dvossel | 2009-03-16 12:47:42 -0500 (Mon, 16 Mar 2009) | 7 lines
  
  Randomize IAX2 encryption padding
  
  The 16-32 byte random padding at the beginning of an encrypted IAX2 frame turns out to not be all that random at all.  This patch calls ast_random to fill the padding buffer with random data.  The padding is randomized at the beginning of every encrypted call and for every encrypted retransmit frame.
  
  Review: http://reviewboard.digium.com/r/193/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182282 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-16 17:49:58 +00:00