Commit Graph

315 Commits

Author SHA1 Message Date
Jonathan Rose a0fff439ab res_rtp_asterisk: Fix one way audio problems with hold/unhold when using ICE
ICE sessions will now be restarted if sessions are changed to use new sets of
remote candidates.

(closes issue ASTERISK-22911)
Reported by: Vytis Valentinavičius
Review: https://reviewboard.asterisk.org/r/3275/
........

Merged revisions 409565 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409570 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 17:22:32 +00:00
Jonathan Rose a40ea867cd Multiple revisions 409129-409130
........
  r409129 | jrose | 2014-02-27 13:19:02 -0600 (Thu, 27 Feb 2014) | 15 lines
  
  res_rtp_asterisk: Fix checklist creating problems in ICE sessions
  
  Prior to this patch, local candidate lists including SRFLX would fail to start
  properly when building ICE candidate check lists. This patch fixes that problem
  by making sure that each SRFLX candidate is associated with the proper
  base address so that the check list can create matches properly.
  This patch was written by jcolp. The issue will be left open to await testing
  by the issue participants.
  
  (issue ASTERISK-23213)
  Reported by: Andrea Suisani
  Review: https://reviewboard.asterisk.org/r/3256/
........
  r409130 | jrose | 2014-02-27 13:38:10 -0600 (Thu, 27 Feb 2014) | 8 lines
  
  res_rtp_asterisk: correct build error from r409129
  
  Accidentally placed a declaration below functional code
  
  (issue ASTERISK-23213)
  Reported by: Andrea Suisani
  Review: https://reviewboard.asterisk.org/r/3256/
........

Merged revisions 409129-409130 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409131 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 19:54:19 +00:00
Corey Farrell c35d07950f res_rtp_asterisk & udptl: fix port selection to work with SELinux restrictions
ast_bind to a port reserved for another program by SELinux causes
errno == EACCES.  This caused random failures when binding rtp or
udptl sockets.  Treat EACCES as a non-fatal error, try next port.

(closes issue ASTERISK-23134)
Reported by: Corey Farrell
........

Merged revisions 406933 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 406934 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 406935 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-30 20:36:21 +00:00
Kevin Harwell bce38c0cc5 res_rtp_asterisk: Fails to resume WebRTC call from hold
In ast_rtp_ice_start if the ice session create check list failed, start check
was never initiated and ice_started was never set to true.  Upon re-entering
the function (for instance, [un]hold) it would try to create the check list
again with duplicate remote candidates.

Fixed so that if the create check list fails the necessary data structures
are properly re-initialized for any subsequent retries.

Note, it was decided to not stop ice support (by calling ast_rtp_ice_stop) on a
check list failure because it possible things might still work.  However, a
debug message was added to help with any future troubleshooting.

(closes issue ASTERISK-22911)
Reported by: Vytis Valentinavičius
Patches:
     works_on_my_machine.patch uploaded by xytis (license 6558)
........

Merged revisions 405234 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 405235 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-09 16:52:57 +00:00
Kinsey Moore 98dea21bc1 chan_sip: Fix RTCP port for SRFLX ICE candidates
This corrects one-way audio between Asterisk and Chrome/jssip as a
result of Asterisk inserting the incorrect RTCP port into RTCP SRFLX
ICE candidates. This also exposes an ICE component enumeration to
extract further details from candidates.

(closes issue ASTERISK-21383)
Reported by: Shaun Clark
Review: https://reviewboard.asterisk.org/r/2967/
........

Merged revisions 402345 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402348 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-01 12:40:40 +00:00
Jonathan Rose d7bac6cf4b res_rtp_asterisk: Address jittery DTMF events in RTP streams
(closes issue ASTERISK-21170)
Reported by: NITESH BANSAL
Patches:
    dtmf-timestamp.patch uploaded by NITESH BANSAL (license 6418)
Review: https://reviewboard.asterisk.org/r/2938/
........

Merged revisions 401619 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 401620 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401621 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23 17:56:44 +00:00
Matthew Jordan f04a4328d8 res_rtp_asterisk: Fix crash when RTCP is not available during SSRC change
In r400089, a patch was put in to correct erroneous RTCP statistic resets.
Unfortunately, ast_rtp_read can be called on an RTP instance that does not
have RTCP information. This patch prevents that crash by only resetting
the statistics if we do actually have an RTCP instance.

(issue AST-1174)

(closes issue ASTERISK-22667)
Reported by: John Bigelow
........

Merged revisions 401445 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 401446 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401447 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-22 23:10:22 +00:00
Kinsey Moore 4873c11f64 Fix STUN crash when using IPv6 any address
Ensure that when chan_sip binds to the IPv6 any address ([::]), IPv4
candidates are also added.

(closes issue ASTERISK-21917)
Reported by: Torrey Searle
Patches:
    0023_ipv6_stun_crash.patch uploaded by Torrey Searle (License 5334)
........

Merged revisions 400681 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400682 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 15:46:16 +00:00
Matthew Jordan c4b5c549fd res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports
RTCP's calculation of the number of lost packets in an RTP stream is based on
that stream's sequence number count, the number of received packets, and how
many packets we expect to receive. When the SSRC for an RTP stream changes,
there can - and almost always will be - a large jump in the next packet's
timestamp and sequence number. If we don't reset the number of received
packets, sequence number count, and other metrics used by RTCP, the next RR/SR
report will use the previous SSRC's values to calculate the lost packet count
for the new SSRC - resulting in a very large number of lost packets.

This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it
will reset the various values used by the RTCP calculations. From the
perspective of RTCP, this appears as a new media stream - which is what it is.

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

(closes issue AST-1174)
Reported by: Thomas Arimont
........

Merged revisions 400089 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 400093 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400108 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 22:32:18 +00:00
Richard Mudgett ec5a724714 res_rtp_asterisk: Fix ref leaks in ast_rtcp_read().
Moved rtcp_report RAII_VAR declaration into the loop so it is unref'ed
after every loop.  Moved message_blob to loop and switched it to a regular
variable.  The regular variable was used since message_blob is used in a
very contained way.

(closes issue ASTERISK-22565)
Reported by: Corey Farrell
Patches:
      rtcp_report-leak.patch (license #5909) patch uploaded by Corey Farrell
Tested by: Corey Farrell
........

Merged revisions 399607 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-21 04:49:26 +00:00
David M. Lee 2a57f6ccf7 res_pjsip: Forward PJSIP logging to Asterisk logging
This patch uses PJSIP's pj_log_set_log_func() to forward PJSIP's log
messages to Asterisk's logger. This is done in a new module:
res_pjsip_log_forwarder.so.

This patch sets defaultenabled on the existing res_pjsip_logger.so to
no, since logging every SIP packet seems a bit odd to do by default, and
is (hopefully) less necessary with regular PJSIP logging.

It also removes res_rtp_asterisk's disabling of PJSIP logging.

(closes issue ASTERISK-22360)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/2830/
........

Merged revisions 399049 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 14:22:07 +00:00
Matthew Jordan 4d348e853c Add pass through support for Opus and VP8; Opus format attribute negotiation
This patch adds pass through support for Opus and VP8. That includes:

* Format attribute negotiation for Opus. Note that unlike some other codecs,
  the draft RFC specifies having spaces delimiting the attributes in addition
  to ';', so you have "attra=X; attrb=Y". This broke the attribute parsing in
  chan_sip, so a small tweak was also included in this patch for that.

* A format attribute negotiation module for Opus, res_format_attr_opus

* Fast picture update for VP8. Since VP8 uses a different RTCP packet number
  than FIR, this really is specific to VP8 at this time.

Note that the format attribute negotiation in res_pjsip_sdp_rtp was written
by mjordan. The rest of this patch was written completely by Lorenzo Miniero.

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

(closes issue ASTERISK-21981)
Reported by: Tzafrir Cohen
patches:
  asterisk_opus+vp8_passthrough_20130718.patch uploaded by lminiero (License 6518)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 15:42:27 +00:00
Richard Mudgett e47d3db365 Doxygen comment tweaks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-16 17:33:21 +00:00
Matthew Jordan d0a55fa52d Refactor RTCP events over to Stasis; associate with channels
This patch does the following:

* It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel
  information in the RTCP events. Because Stasis provides a cache, Jaco's
  patch was modified to pass the channel uniqueid to the RTP layer as
  opposed to a pointer to the channel. This has the following benefits:
  (1) It keeps the RTP engine 'clean' of references back to channels
  (2) It prevents circular dependencies and other potential ref counting issues
* The RTP engine now allows any RTP implementation to raise RTCP messages.
  Potentially, other implementations (such as res_rtp_multicast) could also
  raise RTCP information. The engine provides structs to represent RTCP headers
  and RTCP SR/RR reports.
* Some general refactoring in res_rtp_asterisk was done to try and tame the
  RTCP code. It isn't perfect - that's *way* beyond the scope of this work -
  but it does feel marginally better.
* A few random bugs were fixed in the RTCP statistics. (Example: performing an
  assignment of a = a is probably not correct)
* We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't
  raise an event when we sent a RR report.

Note that this work will be of use to others who want to monitor call quality
or build modules that report call quality statistics. Since the events are now
moving across the Stasis message bus, this is far easier to accomplish. It is
also a first step (though by no means the last step) towards getting Olle's
pinefrog work incorporated.

Again: note that the patch by Jaco Kroon was modified slightly for this work;
however, he did all of the hard work in finding the right places to set the
channel in the RTP engine across the channel drivers. Much thanks goes to Jaco
for his hard work here.

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

(closes issue ASTERISK-20574)
Reported by: Jaco Kroon
patches:
  asterisk-rtcp-channel.patch uploaded by jkroon (License 5671)

(closes issue ASTERISK-21471)
Reported by: Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-05 17:33:33 +00:00
Michael L. Young f758885546 Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit
When we send out a CN packet (for instance, in the case of using rtpkeepalives),
we are not setting the payload code properly.  Also, we are setting the marker
bit when we shouldn't be according to RFC 3389, section 4.

AST_RTP_CN is not defined by AST_FORMAT codes.  Therefore, we should be using
ast_rtp_codecs_payload_code() rather than ast_rtp_codecs_payload_lookup().

11 and trunk already use the appropriate function.

* In 1.8, use ast_rtp_codecs_payload_code()

* Remove the setting of the marker bit

* Fix the debug message by incrementing the seqno after the debug message is set
  in order to display the correct seqno that was sent out

(closes issue ASTERISK-21246)
Reported by: Peter Katzmann
Tested by: Peter Katzmann, Michael L. Young
Patches:
    asterisk-21246-rtp-cng-payload-error_1.8_v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

Merged revisions 388111 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388112 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-09 04:11:59 +00:00
Matthew Jordan f054420df2 Clear the DTMF sending digit tracking on off nominal paths
In certain situations, when the RTP engine goes to send a DTMF end digit
it may be in a situation where the remote address is no longer available,
or the digit that was supposed to be sent is invalid. In such cases, we
need to clear the RTP counters appropriately. Otherwise, when the RTP
source is set again, we'll continue to think that we're in the middle of
sending a DTMF digit, which can confuse the remote party (signficantly).

(closes issue ASTERISK-21522)
Reported by: Corey Farrell
patches:
  rtp_dtmf_process_end.patch uploaded by Corey Farrell (License 5909)
........

Merged revisions 387213 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 387216 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 21:18:24 +00:00
Kinsey Moore 15bbfb941f Fix white noise on SRTP decryption
When res_rtp_asterisk.c was altered to avoid attempting to apply
unprotect algorithms to non-audio RTP packets, the test used was
incorrect. This caused the audio packets to not be decrypted and
resulted in loud white noise on the other endpoint (or both endpoints
depending on the call legs involved). The test now properly checks the
version field in the RTP header to ensure that RTP and RTCP are
decrypted while other types of packets are not.

(closes issue ASTERISK-21323)
Reported by: andrea
Tested by: Kinsey Moore, andrea, John Bigelow
Patches:
    whitenoise_fix.diff uploaded by Kinsey Moore
........

Merged revisions 384048 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 384049 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 17:07:44 +00:00
Matthew Jordan 95849b1a83 Always set the RTP instance data in the RTP engine
Not informing the RTP engine of the instance data creates shrapnel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-13 14:39:54 +00:00
Jason Parker 1cb917096b Switch to using external pjproject libraries.
ICE/STUN/TURN support in res_rtp_asterisk is also now optional.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-12 19:08:59 +00:00
Matthew Jordan 80b8c2349c Add a 'secret' probation strictrtp mode to handle delayed changes in RTP source
Often, Asterisk may realize that a change in the source of an RTP stream is
about to occur and ask that the RTP engine reset it's lock on the current RTP
source. In certain scenarios, it may take awhile for the new remote system to
send RTP packets, while the old remote system may continue providing RTP during
that time period. This causes Asterisk to re-lock onto the old source, thereby
rejecting the new source when the old source stops sending RTP and the new
source begins.

This patch prevents that by having a constant secondary, 'secret' probation
mode enabled when an RTP source has been chosen. RTP packets from other sources
are always considered, but never chosen unless the current RTP source stops
sending RTP.

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

(closes issue AST-1124)
Reported by: John Bigelow
Tested by: John Bigelow

(closes issue AST-1125)
Reported by: John Bigelow
Tested by: John Bigelow
........

Merged revisions 382573 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-07 15:48:06 +00:00
Joshua Colp 3a8caa351e While the ICE negotiation is occurring leave strictrtp in an open state, media can and will come from different places.
........

Merged revisions 382298 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28 21:59:56 +00:00
Joshua Colp 50a74cbd2a Fix a bug with ICE and strictrtp where media could get dropped.
If the end result of the ICE negotiation resulted in the path for media
changing it was possible for the strictrtp code to discard the RTP packets.
This change causes strictrtp to enter learning mode once again when the
ICE negotiation has completed successfully.
........

Merged revisions 382296 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28 21:37:57 +00:00
Jason Parker 6acc9ceb76 Don't undefine bzero()/bcopy().
This was causing build failures against external libraries that happened to use
them, unless silly hacks were added to the modules that used those headers.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-28 21:21:50 +00:00
Matthew Jordan 9b475cd3ef Reset RTP timestamp; sequence number on SSRC change
In r370252 for ASTERISK-18404, Asterisk's handling of RTP was modified to
better account for out of order RTP packets. This was accomplished by using the
RTP timestamp and sequence number to check for out of order packets. However,
when a SSRC change occurs, the timestamp and sequence number will no longer
have any relation to the previously received packets. The variables tracking
the timestamp and sequence number therefore have to be reset.

(closes issue ASTERISK-20906)
Reported by: Eelco Brolman
patches:
  dtmf_on_hold.patch uploaded by Eelco Brolman (license #6442)
........

Merged revisions 378967 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378984 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-13 22:07:00 +00:00
Joshua Colp 4838d6ff68 Don't pass STUN packets through the SRTP unprotect function.
(closes issue AST-1036)
Reported by: jbigelow
........

Merged revisions 378553 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378555 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-04 21:18:07 +00:00
Olle Johansson e3faeb67e8 Formatting fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 16:45:49 +00:00
Olle Johansson 1b47dbe991 Formatting changes
Found a large amount of missing {} in the code before patching in another branch


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 09:35:55 +00:00
Joshua Colp 866d968149 Remove a fixed size limitation for producing SDP and change how ICE support is disabled by default.
With ICE support enabled in chan_sip and a large number of interfaces on the system it was
possible for the produced SDP to be truncated due to some fixed size buffers. These buffers
have now been changed so they will dynamically grow as needed.

ICE support is now also enabled by default in res_rtp_asterisk to provide a smoother experience
for chan_motif users where it is required. To maintain the previous behavior in chan_sip it is
no longer enabled by default there.

(closes issue ASTERISK-20643)
Reported by: coopvr
........

Merged revisions 376130 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-11 17:15:47 +00:00
Walter Doekes 6d57ecd48c Change a few warnings to debug and the inverse.
Remove the "RTP Read too short" warning for RTP keepalives. Remove the
the warning about the application delimiter switch from pipe to comma.
(You should've done this by now.) Make cdr_odbc report more when an
insert fails. Make chan_sip warn less when the peer wants SRTP (and we
don't) or sends a zero port to disable a media type.

Review: https://reviewboard.asterisk.org/r/2167
(closes issue ASTERISK-20538)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17 14:24:52 +00:00
Matthew Jordan 3620fcff36 Disable ICE support by default
Since there are a number of legacy devices out there that fail to handle ICE
candidates properly (which is a nice way of saying something much uglier),
disable it by default.

Support for ICE candidates can be enabled in rtp.conf using the icesupport
setting.
........

Merged revisions 374676 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-08 20:39:26 +00:00
Brent Eagles f787f4219a res_rtp_asterisk: Make TURN and STUN server configurations consistent.
This patch removes the turnport configuration property and changes the
turnaddr property to be a combined host[:port] configuration string. The
patch also modifies the documentation in the example configuration to
reflect the property changes and adds some additional text indicating how
the STUN port is configured.

(closes issue ASTERISK-20344)
Reported by: beagles
Tested by: beagles
Review: https://reviewboard.asterisk.org/r/2111/
........

Merged revisions 373403 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 12:42:19 +00:00
Joshua Colp e8380afc8a Add support for DTLS-SRTP to res_rtp_asterisk and chan_sip.
As mentioned on the review for this, WebRTC has moved towards choosing
DTLS-SRTP as the mechanism for key exchange for SRTP. This commit adds
support for this but makes it available for normal SIP clients as well.

Testing has been done to ensure that this introduces no regressions with
existing behavior and also that it functions as expected.

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

Merged revisions 373229 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 18:27:28 +00:00
David M. Lee 1f0f8694d8 res_rtp_asterisk: Eliminate "type-punned pointer" build warning.
Removes "res_rtp_asterisk.c:706: warning: dereferencing type-punned pointer
will break strict-aliasing rules" warning from the build on 32-bit platforms.

The problem is that 'size' was referenced aliased to both (pj_size_t *) and
(pj_ssize_t *). Now just make a copy of size that is the right type so there
isn't any pointer aliasing happening.

It also adds comments and asserts regarding what looks like an inappropriate
use of pj_sock_sendto, but is actually totally fine.

(closes issue ASTERISK-20368)
Reported by: Shaun Ruffell
Tested by: Michael L. Young
Patches:
  0001-res_rtp_asterisk-Eliminate-type-punned-pointer-build.patch uploaded by Shaun Ruffell (license 5417)
    slightly modified by David M. Lee.
........

Merged revisions 372777 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 19:22:54 +00:00
Richard Mudgett 6b2183244a Multiple revisions 372327-372328
........
  r372327 | rmudgett | 2012-09-05 12:33:11 -0500 (Wed, 05 Sep 2012) | 15 lines
  
  Fix RTP/RTCP read error message confusion.
  
  The RTP/RTCP read error message can report "fail: success" when the
  read failure is because of an ICE failure.
  
  * Changed __rtp_recvfrom() to generate a PJ ICE message when ICE fails.
  
  * Changed RTP/RTCP read error message to indicate an unspecified error
  when errno is zero.
  
  (closes issue ASTERISK-20288)
  Reported by: Joern Krebs
  Patches:
        jira_asterisk_20288_err_msg.patch (license #5621) patch uploaded by rmudgett (modified)
........
  r372328 | rmudgett | 2012-09-05 12:35:20 -0500 (Wed, 05 Sep 2012) | 1 line
  
  Fix coding guidelines issue with a recent commit.
........

Merged revisions 372327-372328 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 17:38:22 +00:00
Mark Michelson be500bbafb Re-fix sending unnegotiated payloads during a P2P RTP bridge.
The previous fix still would look in the static_RTP_PT table, which
is inappropriate since we specifically want to find a codec that has
been negotiated.

(closes issue ASTERISK-20296)
reported by NITESH BANSAL
Patches:
	codec_negotiation.patch Uploaded by NITESH BANSAL (License #6418)
........

Merged revisions 372311 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 16:24:19 +00:00
Michael L. Young 35ac3b645e Fix breakage caused by last merge. Missing a variable for 11 and trunk.
........

Merged revisions 372266 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 12:18:47 +00:00
Michael L. Young aab42a92cb Fix Incrementing Sequence Number For Retransmitted DTMF End Packets
In Asterisk 1.4+, a fix was put in place to increment the sequence number for
retransmitted DTMF end packets.  With the introduction of the RTP engine API in
1.8, the sequence number was no longer being incremented.  This patch fixes this
regression as well as cleans up a few lines that were not doing anything.

(closes issue ASTERISK-20295)
Reported by: Nitesh Bansal
Tested by: Michael L. Young
Patches: 
01_rtp_event_seq_num.patch uploaded by Nitesh Bansal (license 6418)
asterisk-20295-dtmf-fix-cleanup.diff uploaded by Michael L. Young (license 5026)

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

Merged revisions 372185 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 372198 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372199 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 04:55:07 +00:00
Mark Michelson e7ef469826 Prevent local RTP bridges from sending inappropriate formats to participants.
A change for Asterisk 11 caused a check for failure to incorrectly check the return
value. This resulted in the possibility of transmitting media that a party had not
negotiated. If this media happened to be G.729, then this could potentially result
in one-way audio if no G.729 translators are installed.

(closes issue ASTERISK-20296)
reported by NITESH BANSAL
........

Merged revisions 372118 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-31 21:15:07 +00:00
Mark Michelson db69da3667 Use thread-local storage to store pj_thread_descs.
pj_thread_register() takes a parameter of type pj_thread_desc.
It was assumed that pj_thread_register either used this item
temporarily or made a copy of it. Unfortunately, all it does is
keep a pointer to the structure in thread-local storage. This
means that if our pj_thread_desc goes out of scope, then pjlib
will be referencing bogus data quite often, most commonly on
operations involving a pj_mutex_t.

In our case, our pj_thread_desc was on the stack and went out
of scope very shortly after registering our thread with pjlib.
With this change, the pj_thread_desc is stored in thread-local
storage so the pointer that pjlib keeps in thread-local storage
will reference legitimate memory.

(closes issue ASTERISK-20237)
reported by Jeremy Pepper
Patches:
	ASTERISK-20237.patch uploaded by Mark Michelson (license #5049)
Tested by Jeremy Pepper
........

Merged revisions 371571 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-20 20:19:52 +00:00
Russell Bryant b8b425971c rtp: Ensure defaults are set without rtp.conf.
While building up a new install to test chan_motif, I ran into a failure
due to icesupport being disabled.  This was due to me not having an
rtp.conf.  It was intended in the code for it to be enabled by default,
but it was only applied if rtp.conf existed.

This patch updates res_rtp_asterisk to be consistent in how it handles
defaults.  A few options didn't have their default values set globally,
including icesupport.  They are now set and icesupport is enabled by
default, even if you do not have an rtp.conf.
........

Merged revisions 371425 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-17 12:42:33 +00:00
Joshua Colp 15e41c7542 Reduce memory consumption significantly for users of the RTP engine API by storing only the payloads present and in use instead of every possible one.
Review: https://reviewboard.asterisk.org/r/2052/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07 13:07:58 +00:00
Joshua Colp 190d130cbe Build is underway so logging can go away.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-24 16:15:30 +00:00
Joshua Colp 0ef30a9071 Temporarily enable pj logging to console for debugging pjnath issue exposed by build slave.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-24 16:09:39 +00:00
Joshua Colp 4d6b524b61 Prevent multiple local candidates from being added with the same information and add support for disabling ICE on a per-peer basis.
(closes issue ASTERISK-20088)
Reported by: wimpy

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-22 17:03:24 +00:00
Matthew Jordan 245f6538e7 Handle extremely out of order RFC 2833 DTMF
The current implementation of RFC 2833 DTMF handling in res_rtp_asterisk will,
if a packet arrives out of order, drop the packet.  This is to prevent
duplicate ton generation in the Asterisk core.  Since the RTP layer does not
buffer data itself, this is the only option the RTP layer currently has for
handling packets that arrive out of order.

For the most part, this doesn't matter.  For a particular digit, so long as a
BEGIN packet arrives before the first END packet, the digit will be produced.
If subsequent BEGIN packets arrive interleaved with the ENDs, they will be
dropped; likewise, if the BEGIN or END packets themselves are out of order,
those packets are dropped but sufficient information is conveyed to the
Asterisk core to produce the appropriate digit.

For certain sequences of DTMF packets - most notably when, for a particular
digit, an END packet arrives before any BEGIN packet for that digit - this
is a real problem.  When an END arrives before any BEGINs, the END packet is
dropped - but at the same time, it causes subsequent BEGIN packets for that
digit to be ignored.  When the next in order END packet arrives, it too is
dropped - Asterisk believes that there was no initial BEGIN.

The solution this patch provides is to trust the END packet to convey the
information needed for the Asterisk core to produce the DTMF digit.  If we
receive an END packet, and it:
  * Has a timestamp greater then the last timestamp received from an END
    packet
  * Does not have the same sequence number as the last received sequence
    number (and is thus not an END packet retransmission)
Then we send the END frame up to the Asterisk core.  It contains enough
DTMF information for Asterisk to produce the digit.

On the other hand, if we receive a BEGIN or continuation packet that occurs
with a timestamp equal to or less then the last END timestamp, then we've
received something out of order - but we already have received enough
information to produce the digit.  These packets are dropped.

Much thanks goes to Olle Johansson (oej) for providing the idea for this
solution.

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

(closes issue ASTERISK-18404)
Reported by: Stephane Chazelas
Tested by: Matt Jordan
........

Merged revisions 370252 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370271 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-19 21:45:20 +00:00
Joshua Colp 8401e81383 Fix a crash in pjnath when starting an ICE connectivity check and immediately destroying the ICE session.
The initial ICE connectivity check is scheduled as a timer item that is to be executed immediately. It is possible for this timer item to start executing while the ICE session it is working on is destroyed. To reduce the chance of this any timer items that need to be immediately executed will be executed within the thread that has started the initial ICE connectivity check.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-18 15:15:41 +00:00
Joshua Colp 7296b670d4 Add required items for Google video support.
This adds legacy STUN support for RTCP sockets, adds RTCP candidates to the Google transport information, and adds required codec parameters.

(closes issue ASTERISK-20106)
Reported by: Malcolm Davenport


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10 11:49:18 +00:00
Joshua Colp 31beb35f47 Fix an issue where media would not flow for situations where the legacy STUN code is in use.
The STUN packets should *not* be blocked by strict RTP.

(closes issue ASTERISK-20102)
Reported by: Malcolm Davenport


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-09 16:44:24 +00:00
Joshua Colp c48d346d55 Ensure the timer heap is protected by a lock.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-02 00:35:40 +00:00
Joshua Colp 3f9cfe2d41 Don't try to send connectivity checks on RTCP if RTCP is no longer present and don't do multiple ICE connectivity checks at once.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-01 19:36:49 +00:00
Joshua Colp 37256ea45d Add support for ICE/STUN/TURN in res_rtp_asterisk and chan_sip.
Review: https://reviewboard.asterisk.org/r/1891/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-01 17:28:57 +00:00
Matthew Jordan 7b51320642 Fix a variety of memory leaks
This patch addresses a number of memory leaks in a variety of modules that were
found by a static analysis tool.  A brief summary of the changes:

* app_minivm:       free ast_str objects on off nominal paths
* app_page:         free the ast_dial object if the requested channel technology
                    cannot be appended to the dialing structure
* app_queue:        if a penalty rule failed to match any existing rule list
                    names, the created rule would not be inserted and its memory
                    would be leaked
* app_read:         dispose of the created silence detector in the presence of
                    off nominal circumstances
* app_voicemail:    dispose of an allocated unique ID field for MWI event
                    un-subscribe requests in off nominal paths; dispose of
                    configuration objects when using the secret.conf option
* chan_dahdi:       dispose of the allocated frame produced by ast_dsp_process
* chan_iax2:        properly unref peer in CLI command "iax2 unregister"
* chan_sip:         dispose of the allocated frame produced by sip_rtp_read's
                    call of ast_dsp_process; free memory in parse unit tests
* func_dialgroup:   properly deref ao2 object grhead in nominal path of
                    dialgroup_read
* func_odbc:        free resultset in off nominal paths of odbc_read
* cli:              free match_list in off nominal paths of CLI match completion
* config:           free comment_buffer/list_buffer when configuration file load
                    is unchanged; free the same buffers any time they were
                    created and config files were processed
* data:             free XML nodes in various places
* enum:             free context buffer in off nominal paths
* features:         free ast_call_feature in off nominal paths of applicationmap
                    config processing
* netsock2:         users of ast_sockaddr_resolve pass in an ast_sockaddr struct
                    that is allocated by the method.  Failures in
                    ast_sockaddr_resolve could result in the users of the method
                    not knowing whether or not the buffer was allocated.  The
                    method will now not allocate the ast_sockaddr struct if it
                    will return failure.
* pbx:              cleanup hash table traversals in off nominal paths; free
                    ignore pattern buffer if it already exists for the specified
                    context
* xmldoc:           cleanup various nodes when we no longer need them
* main/editline:    various cleanup of pointers not being freed before being
                    assigned to other memory, cleanup along off nominal paths
* menuselect/mxml:  cleanup of value buffer for an attribute when that attribute
                    did not specify a value
* res_calendar*:    responses are allocated via the various *_request method
                    returns and should not be allocated in the various
                    write_event methods; ensure attendee buffer is freed if no
                    data exists in the parsed node; ensure that calendar objects
                    are de-ref'd appropriately
* res_jabber:       free buffer in off nominal path
* res_musiconhold:  close the DIR* object in off nominal paths
* res_rtp_asterisk: if we run out of ports, close the rtp socket object and free
                    the rtp object
* res_srtp:         if we fail to create the session in libsrtp, destroy the
                    temporary ast_srtp object

(issue ASTERISK-19665)
Reported by: Matt Jordan

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

Merged revisions 366880 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 366881 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 14:43:44 +00:00
Mark Michelson 404b890f49 Fix core FINDING 2, FINDING 3, and FINDING 4 from Coverity's CONSTANT_EXPRESSION_RESULT report.
These three all are in RTP code that attempts to print the number of sequence number cycles
in an RTCP RR report. The code was masking out the upper 16 bits and then shifting the number
right by 16 bits. This led to an all zero result in all cases. The fix is to do the shift without
the bit masking.

(issue ASTERISK-19649)
........

Merged revisions 365298 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 365299 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-04 15:52:30 +00:00
Matthew Jordan 016dfa01f1 Fix places in resources where a negative return value could impact execution
This patch addresses a number of modules in resources that did not handle the
negative return value from function calls adequately.  This includes:

* res_agi.c: if the result of the read function is a negative number,
indicating some failure, the result would instead be treated as the number
of bytes read.  This patch now treats negative results in the same manner
as an end of file condition, with the exception that it also logs the
error code indicated by the return.

* res_musiconhold.c: if spawn_mp3 fails to assign a file descriptor to srcfd,
and instead assigns a negative value, that file descriptor could later be
passed to functions that require a valid file descriptor.  If spawn_mp3 fails,
we now immediately retry instead of continuing in the logic.

* res_rtp_asterisk.c: if no codec can be matched between two RTP instances
in a peer to peer bridge, we immediately return instead of attempting to
use the codec payload type as an index to determine the appropriate negotiated
codec.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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

Merged revisions 362362 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362364 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 21:14:49 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Kinsey Moore add6efc20c Correct output of RTCP jitter statistics in SR and RR reports
Change the RTCP RR and SR generation code to convert Asterisk's internal jitter
statistics to be represented in RTP timestamp units based on the rate of the
codec in use instead of in seconds.

(closes issue ASTERISK-14530)
........

Merged revisions 351611 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 351612 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19 22:44:38 +00:00
Mark Michelson f5dd17e558 Eliminate odd initialization of probation variable.
........

Merged revisions 351306 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 351308 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 17:23:25 +00:00
Jonathan Rose ee4cf38a27 Adds pjmedia probation concepts to res_rtp_asterisk's learning mode.
In order to better handle RTP sources with strictrtp enabled (which is now default in 10)
using the learning mode to figure out new sources when they change is handled by checking
for a number of consecutive (by sequence number) packets received to an rtp struct
based on a new configurable value called 'probation'. Also, during learning mode instead
of liberally accepting all packets received, we now reject packets until a clear source
has been determined.

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

Merged revisions 351287 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 351289 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 17:15:05 +00:00
Stefan Schmidt edaf970c38 Fix regression that 'rtp/rtcp set debup ip' only works when also a port was specified.
(closes issue ASTERISK-18693)
Reported by: Davide Dal Fra

Review: https://reviewboard.asterisk.org/r/1600/
Reviewed by: Walter Doekes
........

Merged revisions 346292 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 346293 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-28 14:34:14 +00:00
Matthew Nicholson 3d44965e70 only attempt to do stun handling on ipv4 or ipv4 mapped to ipv6 addresses
Patch by: jkonieczny (modified)
ASTERISK-18490
........

Merged revisions 344330 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 344334 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-10 16:29:13 +00:00
Kinsey Moore 4b9546abdf Merged revisions 340971 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r340971 | kmoore | 2011-10-14 15:50:37 -0500 (Fri, 14 Oct 2011) | 15 lines
  
  Merged revisions 340970 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r340970 | kmoore | 2011-10-14 15:49:39 -0500 (Fri, 14 Oct 2011) | 8 lines
    
    Quiet RTCP Receiver Reports during fax transmission
    
    RTCP is now disabled for "inactive" RTP audio streams during SIP T.38 sessions.
    The ability to disable RTCP streams in res_rtp_asterisk was missing, so this
    code was added to support the bug fix.
    
    (closes issue ASTERISK-18400)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-14 20:51:19 +00:00
Olle Johansson 2ae7ae00c8 Merged revisions 337178 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r337178 | oej | 2011-09-21 10:51:41 +0200 (Ons, 21 Sep 2011) | 14 lines
  
  Change strictrtp option to default to yes in the RTP module
  
  Suggested by Kapejod on Facebook
  
  Review: https://reviewboard.asterisk.org/r/1448/
  (closes issue ASTERISK-18587)
  
  Thanks for quick feedback to kpfleming and Tilghman
  --Denna och nedanstående rader kommer inte med i loggmeddelandet--
  
  M    CHANGES
  M    configs/rtp.conf.sample
  M    res/res_rtp_asterisk.c
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-21 09:06:22 +00:00
Russell Bryant 14d3f891e0 Merged revisions 336878 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336878 | russell | 2011-09-19 20:03:55 -0500 (Mon, 19 Sep 2011) | 43 lines
  
  Merged revisions 336877 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336877 | russell | 2011-09-19 19:56:20 -0500 (Mon, 19 Sep 2011) | 36 lines
    
    Fix crashes in ast_rtcp_write().
    
    This patch addresses crashes related to RTCP handling.  The backtraces just
    show a crash in ast_rtcp_write() where it appears that the RTP instance is no
    longer valid.  There is a race condition with scheduled RTCP transmissions and
    the destruction of the RTP instance.  This patch utilizes the fact that
    ast_rtp_instance is a reference counted object and ensures that it will not get
    destroyed while a reference is still around due to scheduled RTCP
    transmissions.
    
    RTCP transmissions are scheduled and executed from the chan_sip scheduler
    context.  This scheduler context is processed in the SIP monitor thread.  The
    destruction of an RTP instance occurs when the associated sip_pvt gets
    destroyed (which happens when the sip_pvt reference count reaches 0).  However,
    the SIP monitor thread is not the only thread that can cause a sip_pvt to get
    destroyed.  The sip_hangup function, executed from a channel thread, also
    decrements the reference count on a sip_pvt and could cause it to get
    destroyed.
    
    While this is being changed anyway, the patch also removes calling
    ast_sched_del() from within the RTCP scheduler callback.  It's not helpful.
    Simply returning 0 prevents the callback from being rescheduled.
    
    (closes issue ASTERISK-18570)
    
    Related issues that look like they are the same problem:
    
    (issue ASTERISK-17560)
    (issue ASTERISK-15406)
    (issue ASTERISK-15257)
    (issue ASTERISK-13334)
    (issue ASTERISK-9977)
    (issue ASTERISK-9716)
    
    Review: https://reviewboard.asterisk.org/r/1444/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 01:11:18 +00:00
Kinsey Moore 1dc97eb69b Merged revisions 328824 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328824 | kmoore | 2011-07-19 13:05:21 -0500 (Tue, 19 Jul 2011) | 18 lines
  
  Merged revisions 328823 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328823 | kmoore | 2011-07-19 12:57:18 -0500 (Tue, 19 Jul 2011) | 11 lines
    
    RTP bridge away with inband DTMF and feature detection
    
    When deciding whether Asterisk was allowed to bridge the call away from the
    core, chan_sip did not take into account the usage of features on dialed
    channels that require monitoring of DTMF on channels utilizing inband DTMF.
    This would cause Asterisk to allow the call to be locally or remotely bridged, 
    preventing access to the data required to detect activations of such features.
    
    (closes 17237)
    Review: https://reviewboard.asterisk.org/r/1302/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-19 18:07:22 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
David Vossel 513c680b8c Adds pass-through support for codec CELT.
This patch adds pass-through support for CELT.  CELT
formats are defined in codecs.conf and can be configured
to any sample rate a CELT endpoint supports.  This patch also
addresses a crash in channel.c resulting from a frame list being
freed incorrectly.  This crash was discovered while testing a CELT
translator which had to split encoded audio into multiple frames.
The codec translator is not a part of this patch, but may be
contributed in the future.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-07 19:39:17 +00:00
Terry Wilson abd7ef817e Merged revisions 323370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r323370 | twilson | 2011-06-14 09:33:55 -0700 (Tue, 14 Jun 2011) | 10 lines
  
  Add rtpkeepalives back to 1.8
  
  The RTP-engine conversion left out support for handling rtpkeepalives.
  This patch adds them back.
  
  (closes issue ASTERISK-17304)
  Reported by: lmadsen
  
  Review: https://reviewboard.asterisk.org/r/1226/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-14 17:03:37 +00:00
David Vossel d2f16ce587 Merged revisions 317918 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317918 | dvossel | 2011-05-06 16:06:55 -0500 (Fri, 06 May 2011) | 7 lines
  
  Fixes missing colon from To/From headers in RTCP manager events.
  
  (closes issue #18221)
  Reported by: clegall_proformatique
  Patches:
        18221_1.patch uploaded by ebroad (license 878)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-06 21:10:30 +00:00
Terry Wilson e9ba0cba72 Sets video mark bit on format field correctly
This fixes a regression in the media architecture change
where video frames did not have their video mark set
correctly.  dvossel wrote this. twilson kindly committed
this, mmichelson found the bug.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-14 21:53:01 +00:00
David Vossel d760e81f37 Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff
-Functional changes
1. Dynamic global format list build by codecs defined in codecs.conf
2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf
3. Negotiation of SILK attributes in chan_sip.
4. SPEEX 32khz with translation
5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation
   using codec_resample.c
6. Various changes to RTP code required to properly handle the dynamic format list
   and formats with attributes.
7. ConfBridge now dynamically jumps to the best possible sample rate.  This allows
   for conferences to take advantage of HD audio (Which sounds awesome)
8. Audiohooks are no longer limited to 8khz audio, and most effects have been
   updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT.
9. codec_resample now uses its own code rather than depending on libresample.

-Organizational changes
Global format list is moved from frame.c to format.c
Various format specific functions moved from frame.c to format.c

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22 23:04:49 +00:00
Paul Belanger 3556e4c2d4 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 16:55:39 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Russell Bryant cc0b7e7df5 Some scheduler API cleanup and improvements.
Previously, I had added the ast_sched_thread stuff that was a generic scheduler
thread implementation.  However, if you used it, it required using different
functions for modifying scheduler contents.  This patch reworks how this is
done and just allows you to optionally start a thread on the original scheduler
context structure that has always been there.  This makes it trivial to switch
to the generic scheduler thread implementation without having to touch any of
the other code that adds or removes scheduler entries.

In passing, I made some naming tweaks to add ast_ prefixes where they were not
there before.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20 17:15:54 +00:00
Terry Wilson feea367f89 Merged revisions 290542 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r290542 | twilson | 2010-10-05 21:35:51 -0700 (Tue, 05 Oct 2010) | 6 lines
  
  Don't try to send RTP when remote_address is null
  
  It is possible for ast_rtp_stop() to be called which will clear the remote
  address and cause the sendto to fail and spam warnings. Don't send in this
  case.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-06 04:47:57 +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
Russell Bryant 4a356afb7d Merged revisions 287895 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r287895 | russell | 2010-09-21 10:43:33 -0500 (Tue, 21 Sep 2010) | 10 lines
  
  Don't use ast_strdupa() from within the arguments to a function.
  
  (closes issue #17902)
  Reported by: afried
  Patches:
        issue_17902.rev1.txt uploaded by russell (license 2)
  Tested by: russell
  
  Review: https://reviewboard.asterisk.org/r/927/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21 15:45:46 +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
Leif Madsen ea7ddb38fc Merged revisions 283457 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r283457 | lmadsen | 2010-08-24 13:56:29 -0500 (Tue, 24 Aug 2010) | 9 lines
  
  Fix issue where TOS is no longer set on RTP packets.
  Fix issue where the tos is no longer being set on RTP packets through res_rtp_asterisk.
  
  (closes issue #17890)
  Reported by: elguero
  Patches:
        qos_18.diff uploaded by elguero (license 37)
  
  Review: https://reviewboard.asterisk.org/r/868
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-24 18:58:46 +00:00
Terry Wilson 0d4a91f062 Merged revisions 280225 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r280225 | twilson | 2010-07-28 12:34:42 -0700 (Wed, 28 Jul 2010) | 3 lines
  
  Do rtp/rtcp debugging when it is turned on w/o filtering
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-28 19:37:45 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Mark Michelson 1e8c66e749 Fix errors where incorrect address information was printed.
ast_sockaddr_stringiy_fmt (which is call by all ast_sockaddr_stringify* functions)
uses thread-local storage for storing the string that it creates. In cases where
ast_sockaddr_stringify_fmt was being called twice within the same statement, the
result of one call would be overwritten by the result of the other call. This
usually was happening in printf-like statements and was resulting in the same
stringified addressed being printed twice instead of two separate addresses.

I have fixed this by using ast_strdupa on the result of stringify functions if
they are used twice within the same statement. As far as I could tell, there were
no instances where a pointer to the result of such a call were saved anywhere, so
this is the only situation I could see where this error could occur.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 22:32:29 +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
Mark Michelson 41cdf6a720 Merged revisions 274157 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r274157 | mmichelson | 2010-07-06 09:29:23 -0500 (Tue, 06 Jul 2010) | 16 lines
  
  Fix problem with RFC 2833 DTMF not being accepted.
  
  A recent check was added to ensure that we did not erroneously
  detect duplicate DTMF when we received packets out of order.
  The problem was that the check did not account for the fact that
  the seqno of an RTP stream will roll over back to 0 after hitting
  65535. Now, we have a secondary check that will ensure that the
  seqno rolling over will not cause us to stop accepting DTMF.
  
  (closes issue #17571)
  Reported by: mdeneen
  Patches: 
        rtp_seqno_rollover.patch uploaded by mmichelson (license 60)
  Tested by: richardf, maxochoa, JJCinAZ
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-06 14:31:13 +00:00
Paul Belanger 6012128a48 Fix rt(c)p set debug ip taking wrong argument
Also clean up some coding errors.

(closes issue #17469)
Reported by: wdoekes
Patches:
      astsvn-rtp-set-debug-ip.patch uploaded by wdoekes (license 717)
Tested by: wdoekes, pabelanger



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-30 17:28:04 +00:00
David Vossel 1a7e1aee5e fixes logic error introduced by slin16 sip support
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-21 20:33:41 +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
David Vossel 51e7ee235b fixes crash during dtmf
During the processing of Cisco dtmf the dtmf samples were
not being calculated correctly.  In an attempt to determine
what sample rate was being used, a NULL frame was processed
which caused a crash.  This patch resolves this.

(closes issue #17248)
Reported by: falves11
Patches:
      issue_17248.diff uploaded by dvossel (license 671)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19 14:38:02 +00:00
Mark Michelson bd716c50fd Recorded merge of revisions 254452 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254452 | mmichelson | 2010-03-25 10:59:56 -0500 (Thu, 25 Mar 2010) | 44 lines
  
  Several fixes regarding RFC2833 DTMF detection.
  
  Here is a copy and paste of the details from my request on
  reviewboard that dealt with these changes:
  
  Fix 1. The first change in place is to fix Mantis issue 15811, which deals with a situation where Asterisk will incorrectly interpret out of order RFC2833 frames as duplicate DTMF digits. For instance, we would receive a sequence like:
  
  seqno 1: DTMF 1
  seqno 2: DTMF 1
  seqno 3: DTMF 1
  seqno 4: DTMF 1
  seqno 6: DTMF 1 (end)
  seqno 5: DTMF 1
  seqno 7: DTMF 1 (end)
  seqno 8: DTMF 1 (end)
  
  Prior to this patch when we received the frame with seqno 5, we would interpret this as a new DTMF 1. With this patch, we will check the seqno of the incoming digit and not process the frame if the seqno is lower than the last recorded seqno. Note that we do not record the seqno of the dropped DTMF frame for future processing. While the above situation is what was designed to be fixed, the patch is written in such a way that the following would also be fixed too:
  
  seqno  9: DTMF 1
  seqno 10: DTMF 1 (end)
  seqno 11: DTMF 1 (end)
  seqno 13: DTMF 2
  seqno 12: DTMF 1 (end)
  seqno 14: DTMF 2
  seqno 15: DTMF 2 (end)
  seqno 16: DTMF 2 (end)
  seqno 17: DTMF 2 (end)
  
  In this second situation, the beginning of the DTMF 2 arrives before the final end frame of the DTMF 1. With the patch, seqno 12 is no processed and thus we properly interpret the DTMF.
  
  Fix 2. The second change in place is to fix an issue like the following:
  
  seqno 1: DTMF 1
  seqno 2: DTMF 1
  seqno 3: DTMF 1 (end) *packet lost*
  seqno 4: DTMF 1 (end) *packet lost*
  seqno 5: DTMF 1 (end) *packet lost*
  seqno 6: DTMF 2
  
  When we receive seqno 6, we had code in place that was supposed to properly end the previously unended DTMF 1. The problem was that the code was essentially a no-op. The code would set up an end frame for the DTMF 1 but would immediately overwrite the frame with the begin for DTMF 2. I changed process_dtmf_rfc2833() so that instead of returning a single frame, it is given as an output parameter a list of frames. Each frame that needs to be returned is appended to this list.
  
  Fix 3. The final change is a minor one where an AST_CONTROL_SRCCHANGE frame could get lost. If we process a cisco DTMF or an RFC 3389 frame and no frame was returned, then we would return &ast_null_frame. The problem is that earlier in the function, we may have generated an AST_CONTROL_SRCCHANGE frame and put it in the list of frames we wish to return. This frame would be lost in such a case. The patch fixes this problem
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 16:04:48 +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
Olle Johansson e8df30b584 Improve support for RTCP reports without report blocks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-20 22:37:22 +00:00
David Vossel e469483d82 rtp timestamp to timeval calculation fix
The rtp timestamp to timeval calculation was only
accurate for 8kHz audio. This patch corrects this.

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

SWP-648



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-20 21:14:47 +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
David Vossel cf87d81e9d Merged revisions 231441 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231441 | dvossel | 2009-11-30 11:14:08 -0600 (Mon, 30 Nov 2009) | 11 lines
  
  fixes crash caused by RTP comfort noise payload greater than 24 bytes
  
  AST-2009-010
  
  (closes issue #16242)
  Reported by: amorsen
  Patches:
        issue16242.diff uploaded by oej (license 306)
  Tested by: amorsen, oej, dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 17:28:28 +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
Russell Bryant 844a01b27e Add an "Asterisk Architecture Overview" section to the doxygen documentation.
This is a side project I've been poking at this week.  The intent is to discuss
Asterisk architecture in a top down fashion to help new developers understand how
Asterisk is put together.  There is a ton of stuff to write about, so this will
just continue to evolve over time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-30 04:08:39 +00:00
Kevin P. Fleming 092a118d89 Merged revisions 224670 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224670 | kpfleming | 2009-10-19 18:44:07 -0500 (Mon, 19 Oct 2009) | 7 lines
  
  Correct timestamp calculations when RTP sample rates over 8kHz are used.
  
  While testing some endpoints that support 16kHz and 32kHz sample rates, some
  log messages were generated due to calc_rxstamp() computing timestamps in a way
  that produced odd results, so this patch sanitizes the result of the
  computations.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-19 23:47:39 +00:00
Terry Wilson 717d2ec3c9 Remove spurious debug
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 18:47:53 +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
Michiel van Baak 3c04a79abf use the actual given ip address for 'rtp set debug ip <foo>' instead of the word 'ip'
(closes issue #15711)
Reported by: davidw
Patches:
      2009082800-rtpdebug.diff.txt uploaded by mvanbaak (license 7)
Tested by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-12 13:08:16 +00:00
Mark Michelson ed8ccbdb73 Gracefully handle malformed RTP text packets.
AST-2009-004



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 20:54:54 +00:00
David Vossel ba2a8457b8 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: https://origsvn.digium.com/svn/asterisk/trunk@205479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 23:19:09 +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
Kevin P. Fleming e6b2e9a750 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: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Joshua Colp 1179ecf165 Merged revisions 194208 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r194208 | file | 2009-05-13 10:38:01 -0300 (Wed, 13 May 2009) | 11 lines
  
  Fix RFC2833 issues with DTMF getting duplicated and with duration wrapping over.
  
  (closes issue #14815)
  Reported by: geoff2010
  Patches:
        v1-14815.patch uploaded by dimas (license 88)
  Tested by: geoff2010, file, dimas, ZX81, moliveras
  (closes issue #14460)
  Reported by: moliveras
  Tested by: moliveras
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13 13:39:10 +00:00
Joshua Colp 973b36a3c7 Fix an incorrect clock rate when sending T140 text.
(closes issue #14029)
Reported by: epicac


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 17:40:50 +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 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 c02b56f7bc Fix a log message getting output when it should not have been.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-06 23:11:13 +00:00
Mark Michelson 6f53ed4c67 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: https://origsvn.digium.com/svn/asterisk/trunk@186525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 22:41:46 +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