Commit Graph

35 Commits

Author SHA1 Message Date
Terry Wilson abc94089cd Merged revisions 293803 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r293803 | twilson | 2010-11-03 11:05:14 -0700 (Wed, 03 Nov 2010) | 25 lines
  
  Avoid valgrind warnings for ast_rtp_instance_get_xxx_address
  
  The documentation for ast_rtp_instance_get_(local/remote)_address stated that
  they returned 0 for success and -1 on failure. Instead, they returned 0 if the
  address structure passed in was already equivalent to the address instance
  local/remote address or 1 otherwise. 90% of the calls to these functions
  completely ignored the return address and passed in an uninitialized struct,
  which would make valgrind complain even though the operation was technically
  safe.
  
  This patch fixes the documentation and converts the get_xxx_address functions
  to void since all they really do is copy the address and cannot fail.
  Additionally two new functions
  (ast_rtp_instance_get_and_cmp_(local/remote)_address) are created for the 3
  times where the return value was actually checked. The
  get_and_cmp_local_address function is currently unused, but exists for the sake
  of symmetry.
  
  The only functional change as a result of this change is that we will not do an
  ast_sockaddr_cmp() on (mostly uninitialized) addresses before doing the
  ast_sockaddr_copy() in the get_*_address functions. So, even though it is an
  API change, it shouldn't have a noticeable change in behavior.
  
  Review: https://reviewboard.asterisk.org/r/995/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-03 18:43:18 +00:00
Jeff Peeler c44527e185 Merged revisions 289840 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r289840 | jpeeler | 2010-10-01 21:43:45 -0500 (Fri, 01 Oct 2010) | 29 lines
  
  Merged revisions 289798 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r289798 | jpeeler | 2010-10-01 18:01:31 -0500 (Fri, 01 Oct 2010) | 22 lines
    
    Merged revisions 289797 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r289797 | jpeeler | 2010-10-01 17:58:38 -0500 (Fri, 01 Oct 2010) | 15 lines
      
      Change RFC2833 DTMF event duration on end to report actual elapsed time.
      
      The scenario here is with a non P2P early media session. The reported time
      length of DTMF presses are coming up short when sending to the remote side.
      Currently the event duration is a running total that is incremented when sending
      continuation packets. These continuation packets are only triggered upon
      incoming media from the remote side, which means that the running total probably
      is not going to end up matching the actual length of time Asterisk received
      DTMF. This patch changes the end event duration to be lengthened if it is
      detected that the end event is going to come up short.
      
      Review: https://reviewboard.asterisk.org/r/957/
      
      ABE-2476
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-02 02:46:43 +00:00
Terry Wilson 920f5ea8b7 Merged revisions 284477 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r284477 | twilson | 2010-09-01 13:44:36 -0500 (Wed, 01 Sep 2010) | 17 lines
  
  Fix SRTP for changing SSRC and multiple a=crypto SDP lines
  
  Adding code to Asterisk that changed the SSRC during bridges and masquerades
  broke SRTP functionality. Also broken was handling the situation where an
  incoming INVITE had more than one crypto offer. This patch caches the SRTP
  policies the we use so that we can change the ssrc and inform libsrtp of the
  new streams. It also uses the first acceptable a=crypto line from the incoming
  INVITE.
  
  (closes issue #17563)
  Reported by: Alexcr
  Patches: 
        srtp.diff uploaded by twilson (license 396)
  Tested by: twilson
  
  Review: https://reviewboard.asterisk.org/r/878/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-01 18:52:27 +00:00
Russell Bryant 7855a973b4 Merged revisions 280391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r280391 | russell | 2010-07-29 11:25:43 -0500 (Thu, 29 Jul 2010) | 2 lines
  
  Don't blow up if get_codec() was not provided in the RTP glue.
........


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

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

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

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 22:08:07 +00:00
David Vossel ba3d1ad680 adds support for slin16 in sip
(closes issue #16153)
Reported by: kfister
Patches:
      16153-1.6.2.0-rc5.patch uploaded by kfister (license 912)
      slin16.sip.patch.1 uploaded by malcolmd (license 924)
Tested by: kfister, malcolmd


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-17 18:36:06 +00:00
David Vossel b00f58da25 adds speex 16khz audio support
(closes issue #17501)
Reported by: fabled
Patches:
      asterisk-trunk-speex-wideband-v2.patch uploaded by fabled (license 448)
Tested by: malcolmd, fabled, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-17 17:23:43 +00:00
David Vossel fcb055fb4e addition of G.719 pass-through support
(closes issue #16293)
Reported by: malcolmd
Patches:
      g719.passthrough.patch.7 uploaded by malcolmd (license 924)
      format_g719.c uploaded by malcolmd (license 924)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-16 19:03:24 +00:00
Terry Wilson 857814f435 Add SRTP support for Asterisk
After 5 years in mantis and over a year on reviewboard, SRTP support is finally
being comitted. This includes generic CHANNEL dialplan functions that work for
getting the status of whether a call has secure media or signaling as defined
by the underlying channel technology and for setting whether or not a new
channel being bridged to a calling channel should have secure signaling or
media. See doc/tex/secure-calls.tex for examples.

Original patch by mikma, updated for trunk and revised by me.

(closes issue #5413)
Reported by: mikma
Tested by: twilson, notthematrix, hemanshurpatel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 05:29:08 +00:00
Tilghman Lesher 17bd11b8aa Seems strange (and the code backs up) that if the max and min of a statistic is expressed as a double, the last value would not also need to be a double.
(closes issue #15807)
 Reported by: klaus3000


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-07 19:52:39 +00:00
Mark Michelson b5d5cc565f Enhancements to connected line and redirecting work.
From reviewboard:

Digium has a commercial customer who has made extensive use of the connected party and
redirecting information present in later versions of Asterisk Business Edition and which
is to be in the upcoming 1.8 release. Through their use of the feature, new problems and solutions
have come about. This patch adds several enhancements to maximize usage of the connected party
and redirecting information functionality.

First, Asterisk trunk already had connected line interception macros. These macros allow you to
manipulate connected line information before it was sent out to its target. This patch adds the
same feature except for redirecting information instead.

Second, the ast_callerid and ast_party_id structures have been enhanced to provide a "tag." This
tag can be set with func_callerid, func_connectedline, func_redirecting, and in the case of DAHDI,
mISDN, and SIP channels, can be set in a configuration file. The idea behind the callerid tag is
that it can be set to whatever value the administrator likes. Later, when running connected line
and redirecting macros, the admin can read the tag off the appropriate structure to determine what
action to take. You can think of this sort of like a channel variable, except that instead of having
the variable associated with a channel, the variable is associated with a specific identity within
Asterisk.

Third, app_dial has two new options, s and u. The s option lets a dialplan writer force a specific
caller ID tag to be placed on the outgoing channel. The u option allows the dialplan writer to force
a specific calling presentation value on the outgoing channel.

Fourth, there is a new control frame subclass called AST_CONTROL_READ_ACTION added. This was added
to correct a very specific situation. In the case of SIP semi-attended (blond) transfers, the party
being transferred would not have the opportunity to run a connected line interception macro to
possibly alter the transfer target's connected line information. The issue here was that during a
blond transfer, the SIP transfer code has no bridged channel on which to queue the connected line
update. The way this was corrected was to add this new control frame subclass. Now, we queue an
AST_CONTROL_READ_ACTION frame on the channel on which the connected line interception macro should
be run. When ast_read is called to read the frame, ast_read responds by calling a callback function
associated with the specific read action the control frame describes. In this case, the action taken
is to run the connected line interception macro on the transferee's channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 15:36:31 +00:00
Terry Wilson 68d1ded8dd Only change the RTP ssrc when we see that it has changed
This change basically reverts the change reviewed in
https://reviewboard.asterisk.org/r/374/ and instead limits the
updating of the RTP synchronization source to only those times when we
detect that the other side of the conversation has changed the ssrc.

The problem is that SRCUPDATE control frames are sent many times where
we don't want a new ssrc, including whenever Asterisk has to send DTMF
in a normal bridge. This is also not the first time that this mistake
has been made. The initial implementation of the ast_rtp_new_source
function also changed the ssrc--and then it was removed because of
this same issue. Then, we put it back in again to fix a different
issue. This patch attempts to only change the ssrc when we see that
the other side of the conversation has changed the ssrc.

It also renames some functions to make their purpose more clear.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-12 22:04:51 +00:00
Jason Parker bbd290308f Fix an RTP instance allocation failure on Solaris.
(closes issue #16543)
Reported by: crjw
Patches:
      rtp_sin_family.patch uploaded by crjw (license 963)
Tested by: crjw, qwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 22:03:49 +00:00
Tilghman Lesher f59fe83c56 More 32->64 bit codec conversions.
In the process of swapping ULAW to a place in the extended codec space, we
found several unhandled cases, where a 32-bit integer was still being used to
handle a codec field.  Most of these have been fixed with this commit, although
there is at least one case (codec_dahdi) which depends upon outside headers to
be altered before a conversion can be made.
(Fixes AST-278, SWP-459)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 20:27:37 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Tilghman Lesher 8c7b3cf738 Merged revisions 221776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221776 | tilghman | 2009-10-01 18:53:12 -0500 (Thu, 01 Oct 2009) | 2 lines
  
  Fix a bunch of off-by-one errors
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 23:59:15 +00:00
Terry Wilson 10ce6cd757 Use rtp properties instead of adding a callback
Thanks, Josh.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 18:21:03 +00:00
Terry Wilson 865daf4858 Merged revisions 221086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221086 | twilson | 2009-09-30 09:49:11 -0500 (Wed, 30 Sep 2009) | 25 lines
  
  Change the SSRC by default when our media stream changes
  
  Be default, change SSRC when doing an audio stream changes Asterisk doesn't
  honor marker bit when reinvited to already-bridged RTP streams,resulting in
  far-end stack discarding packets with "old" timestamps that areactually part of
  a new stream.  This patch sends AST_CONTROL_SRCUPDATE whenever there is a
  reinvite, unless the 'constantssrc' is set to true in sip.conf.
  
  The original issue reported to Digium support detailed the following situation:
  ITSP <-> Asterisk 1.4.26.2 <-> SIP-based Application Server Call comes in
  fromITSP, Asterisk dials the app server which sends a re-invite back
  toAsterisk--not to negotiate to send media directly to the ITSP, but to
  indicatethat it's changing the stream it's sending to Asterisk.  The app
  servergenerates a new SSRC, sequence numbers, timestamps, and sets the marker
  bit on the new stream.  Asterisk passes through the teimstamp of the new stream,
  butdoes not reset the SSRC, sequence numbers, or set the marker bit.
  
  When the timestamp on the new stream is older than the timestamp on the
  originalstream, the ITSP (which doesn't know there has been any change) discards
  the newframes because it thinks they are too old.  This patch addresses this by
  changing the SSRC on a stream update unless constantssrc=true is set in
  sip.conf.
  
  Review: https://reviewboard.asterisk.org/r/374/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 17:52:30 +00:00
Mark Michelson cee8c6cd47 Get rid of annoying and cryptic debug messages.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-29 20:20:48 +00:00
Joshua Colp 606112e234 Add two more API calls for getting the current glue and channel in bridging code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-16 19:27:39 +00:00
Joshua Colp 1effb11ef5 Add an API call for retrieving the engine in use by an RTP instance.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-13 16:44:54 +00:00
Kevin P. Fleming 0a6e06c7ff Rework of T.38 negotiation and UDPTL API to address interoperability problems
Over the past couple of months, a number of issues with Asterisk
negotiating (and successfully completing) T.38 sessions with various
endpoints have been found. This patch attempts to address many of
them, primarily focused around ensuring that the endpoints'
MaxDatagram size is honored, and in addition by ensuring that T.38
session parameter negotiation is performed correctly according to the
ITU T.38 Recommendation.

The major changes here are:

1) T.38 applications in Asterisk (app_fax) only generate/receive IFP
packets, they do not ever work with UDPTL packets. As a result of
this, they cannot be allowed to generate packets that would overflow
the other endpoints' MaxDatagram size after the UDPTL stack adds any
error correction information. With this patch, the application is told
the maximum *IFP* size it can generate, based on a calculation using
the far end MaxDatagram size and the active error correction mode on
the T.38 session. The same is true for sending *our* MaxDatagram size
to the remote endpoint; it is computed from the value that the
application says it can accept (for a single IFP packet) combined with
the active error correction mode.

2) All treatment of T.38 session parameters as 'capabilities' in
chan_sip has been removed; these parameters are not at all like
audio/video stream capabilities. There are strict rules to follow for
computing an answer to a T.38 offer, and chan_sip now follows those
rules, using the desired parameters from the application (or channel)
that wants to accept the T.38 negotiation.

3) chan_sip now stores and forwards ast_control_t38_parameters
structures for tracking 'our' and 'their' T.38 session parameters;
this greatly simplifies negotiation, especially for pass-through
calls.

4) Since T.38 negotiation without specifying parameters or receiving
the final negotiated parameters is not very worthwhile, the
AST_CONTROL_T38 control frame has been removed. A note has been added
to UPGRADE.txt about this removal, since any out-of-tree applications
that use it will no longer function properly until they are upgraded
to use AST_CONTROL_T38_PARAMETERS.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 21:57:24 +00:00
Joshua Colp 59c1998d67 Improve T.38 negotiation by exchanging session parameters between application and channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 19:27:24 +00:00
Joshua Colp e85296e244 Add support for allowing an RTP engine to decide on whether it is possible for specific formats to be transcoded for an RTP instance.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19 15:41:24 +00:00
Mark Michelson dce6a54a4a Trunk implementation of setting an alternate RTP source.
This contains the interface by which we can let an rtp instance know
that it might start receiving audio from a new source. This is similar
in nature to revision 197588 of Asterisk 1.4.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18 15:20:17 +00:00
Joshua Colp 4900d37d71 Fix a bug where we were passing in address information that should remain unmodified to a function that may modify it.
(closes issue #15243)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-02 13:12:59 +00:00
Russell Bryant f6bdacebe4 Don't do a pointer comparison before setting the remote address.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27 22:42:15 +00:00
Joshua Colp c1073e0ac3 Merged revisions 195095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195095 | file | 2009-05-18 10:53:39 -0300 (Mon, 18 May 2009) | 5 lines
  
  Fix a bug where the codecs of the called party leg were not properly sent back to the caller call leg when reinvited.
  
  (closes issue #13569)
  Reported by: bkw918
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 13:56:16 +00:00
Russell Bryant 2c1ffef923 Resolve Solaris build issues and add some API documentation.
(issue #14981)
Reported by: snuffy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 08:51:21 +00:00
Joshua Colp aaf1566222 Change how we set the local and remote address.
The code will now only change the address and port. It will not overwrite any other values.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 18:14:47 +00:00
Joshua Colp 8e4b5df187 Fix some uninitialized memory notices that appeared under valgrind.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 18:02:44 +00:00
Joshua Colp b0637fe624 Fix a bug where we would native bridge when we did not want to.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 18:12:28 +00:00
Joshua Colp 0ab599bf94 Turn a warning message into a debug message and do not treat two situations as errors when they are not.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 16:27:36 +00:00
Joshua Colp 9597e33a63 Pass the correct value to sizeof when copying address information.
(issue #14827)
Reported by: pj
Patches:
      14827.diff uploaded by file (license 11)
Tested by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-06 13:23:12 +00:00
Joshua Colp 63de834395 Merge in the RTP engine API.
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:20:52 +00:00