Commit Graph

8033 Commits

Author SHA1 Message Date
Richard Mudgett 28c11fff78 chan_motif: Cleanup jingle_tech.capabilities only once.
........

Merged revisions 425627 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-15 19:39:15 +00:00
Walter Doekes 9e72c74db5 chan_sip: Fix so asterisk won't send reINVITE after a BYE.
After a reINVITE glare situation, Asterisk would re-send the reINVITE
even though the call had been hung up in the mean time.  This patch
unschedules the reinvite when handling the BYE.

ASTERISK-22791 #close
Reported by: Paolo Compagnini
Tested by: Paolo Compagnini

Review: https://reviewboard.asterisk.org/r/4056/
(testcase is in review r4055)
........

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

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

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

Merged revisions 425299 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-12 08:17:08 +00:00
Walter Doekes d3f525fd8f chan_sip: Fix dialog leak resulting from missing ACK to re-INVITE.
If a device re-INVITEs at the same time as the dialog is hung up, and
if then the ACK to the re-INVITE never reaches Asterisk, chan_sip would
fail to destroy the dialog after a while.  This resulted in (most
prominently) file handle leaks.

(Patch reindented by me.)

ASTERISK-20784 #close
ASTERISK-15879 #close
Reported by: Torrey Searle, Nitesh Bansal
Patches:
  reinvite_ack_timeout.patch uploaded by Torrey Searle (License #5334)
  patch_asterisk_20784.txt uploaded by Nitesh Bansal (License #6418)

Reviewboard: https://reviewboard.asterisk.org/r/4052/
(testcase can be found at r4051)
........

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

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

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

Merged revisions 425071 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-10 07:34:50 +00:00
Matthew Jordan c013916869 pjsip/dialplan_functions: Handle PJSIP_MEDIA_OFFER called on non-PJSIP channels
Calling PJSIP_MEDIA_OFFER on a non-PJSIP channel is hazardous to your health.
It will treat the channels as a PJSIP channel, eventually hitting an ao2 error,
FRACKing on assertion error, and quite likely crashing.

This patch adds checks to the read/write callbacks that ensure that the channel
technology is of type 'PJSIP' before attempting to operate on the channel.

#SIPit31

ASTERISK-24382 #close
Reported by: Matt Jordan
........

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

Merged revisions 424622 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-06 00:53:37 +00:00
Corey Farrell 1b0902caa4 chan_motif: Correct last commit to use ao2_cleanup to free format cap
This fix applies to 13 and trunk.

ASTERISK-24384 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4043/
........

Merged revisions 424554 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-05 00:15:43 +00:00
Corey Farrell 0cea12b9e8 chan_motif: Release format capabilities and config on module load error
ASTERISK-24384 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4043/
........

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

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

Merged revisions 424552 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-05 00:02:39 +00:00
Richard Mudgett 0165c5f95a chan_pjsip: Fix deadlock when masquerading PJSIP channels.
Performing a directed call pickup resulted in a deadlock when PJSIP
channels were involved.

A masquerade needs to hold onto the channel locks while it swaps channel
information between the two channels involved in the masquerade.  With
PJSIP channels, the fixup routine needed to push a fixup task onto the
PJSIP channel's serializer.  Unfortunately, if the serializer was also
processing a task that needed to lock the channel, you get deadlock.

* Added a new control frame that is used to notify the channels that a
masquerade is about to start and when it has completed.

* Added the ability to query taskprocessors if the current thread is the
taskprocessor thread.

* Added the ability to suspend/unsuspend the PJSIP serializer thread so a
masquerade could fixup the PJSIP channel without using the serializer.

ASTERISK-24356 #close
Reported by: rmudgett

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

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

Merged revisions 424472 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 17:47:42 +00:00
Jonathan Rose 2f570094b7 chan_pjsip: Fix an assertion for channels that lack formats on creation
ASTERISK-24222 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4017/
........

Merged revisions 424333 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-02 15:33:50 +00:00
Walter Doekes c3a7524457 chan_sip: Simplify some unref code by removing unlink_peer_from_tables.
ASTERISK-22945 #related
Reported by: ibercom
Patches:
  asterisk11-chan_sip-simplifies.patch uploaded by ibercom (License #6599)
........

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

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

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

Merged revisions 424184 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-01 10:10:41 +00:00
Walter Doekes 841d978a30 chan_sip: Remove excess ref of realtime peer before sip_poke_peer.
The peer is referenced at the end of sip_poke_peer, it should not get
an extra ref before the call to sip_poke_peer. This fixes a memory
leak.

ASTERISK-22945 #close
Reported by: ibercom
Tested by: Yuriy Gorlichenko
Patches:
  asterisk11.patch uploaded by ibercom (License #6599)

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

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

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

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

Merged revisions 424179 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-01 09:55:10 +00:00
Joshua Colp 76744543b4 res_pjsip_session: Add additional checks for delaying session refreshes.
There are certain situations which no checks existed for which need to prevent
session refreshes. This includes sending a session refresh with SDP before SDP
negotiation has completed and sending a session refresh before the dialog itself
has been established. Checks for these have been added.

Additionally COLP related UPDATEs were including SDP when it is not needed.

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

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

Merged revisions 424057 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-27 12:44:38 +00:00
Walter Doekes 37179a2b1f core: Don't allow free to mean ast_free (and malloc, etc..).
This gets rid of most old libc free/malloc/realloc and replaces them
with ast_free and friends. When compiling with MALLOC_DEBUG you'll
notice it when you're mistakenly using one of the libc variants. For
the legacy cases you can define WRAP_LIBC_MALLOC before including
asterisk.h.

Even better would be if the errors were also enabled when compiling
without MALLOC_DEBUG, but that's a slightly more invasive header
file change.

Those compiling addons/format_mp3 will need to rerun
./contrib/scripts/get_mp3_source.sh.

ASTERISK-24348 #related
Review: https://reviewboard.asterisk.org/r/4015/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-26 14:41:38 +00:00
Walter Doekes 39fada4dc9 chan_sip: Unref outbound proxy structure on dialog/pvt destruction.
Make sure outbound proxy refs are always unreffed on dialog destruction.

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

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

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

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

Merged revisions 423803 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-24 08:55:02 +00:00
Walter Doekes 593455621b chan_sip: On INVITE retransmission, don't add an extra 503 response.
INVITE arrives to asterisk, asterisk responds Busy(). If the INVITE is
retransmitted, asterisk would generate a 503 in addition to the 486.

Thanks Torrey Searle for providing a working regression test.

ASTERISK-24335 #close

Review: https://reviewboard.asterisk.org/r/4003/
Patches:
  retrans_486_invite.patch uploaded by Torrey Searle (License #5334)
........

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

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

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

Merged revisions 423723 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-22 19:49:30 +00:00
Richard Mudgett ec0313c411 res_pjsip_sdp_rtp.c: Fix native formats containing formats that were not negotiated.
Outgoing PJSIP calls can result in non-negotiated formats listed in the
channel's native formats if video formats are listed in the endpoint's
configuration.  The resulting call could then use a non-negotiated format
resulting in one way audio.

* Simplified the update of session->req_caps in set_caps().  Why do
something in five steps when only one is needed?

AFS-162 #close

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

Merged revisions 423561 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-19 17:16:32 +00:00
Jonathan Rose 7e602175ff chan_iax2: Fix a crash when using chan_iax2 jitterbuffer settings
Caused by format changes in Asterisk 13

ASTERISK-24265 #close
Reported by: Dafi Ni
Review: https://reviewboard.asterisk.org/r/3999/
........

Merged revisions 423524 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-19 15:11:06 +00:00
Joshua Colp 02295456ef chan_rtp: Add unicast RTP support.
This module supports sending both unicast and multicast RTP
to a specified target. Multicast functionality is the same as
chan_multicast_rtp was. In the case of unicast a specific
IP address and port can be specified, along with optional RTP
engine and format in the form of:

UnicastRTP/<ip address>:<port>/<engine>/<format>

This can be useful for sending a copy of a media stream to
another application for processing.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-12 17:42:15 +00:00
Richard Mudgett 5a1de68b9a devicestate.c: Minor tweaks
* In ast_state_chan2dev() use ARRAY_LEN() instead of a sentinel value in
chan2dev[].

* Fix some comments in chan_iax2.c.
........

Merged revisions 422661 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-05 17:45:03 +00:00
Mark Michelson 1b64f353f1 Resolve race condition where channels enter dialplan application before media has been negotiated.
Testsuite tests will occasionally fail because on reception of a 200 OK SIP response,
an AST_CONTROL_ANSWER frame is queued prior to when media has finished being
negotiated. This is because session supplements are called into before PJSIP's
inv_session code has told us that media has been updated. Sometimes the queued answer
frame is handled by the PBX thread before the ensuing media negotiations occur, causing
a test failure.

As it turns out, there is another place that session supplements could be called into, which is
after media has finished getting negotiated. What this commit introduces is a means for session
supplements to indicate when they wish to be called into when handling an incoming SIP response.
By default, all session supplements will be run at the same point that they were prior to this
commit. However, session supplements may indicate that they wish to be handled earlier than
normal on redirects, or they may indicate they wish to be handled after media has been negotiated.

In this changeset, two session supplements have been updated to indicate a preference for when
they should be run: res_pjsip_diversion executes before handling redirection in order to get
information from the Diversion header, and chan_pjsip now handles responses to INVITEs after
media negotiation to fix the race condition mentioned previously.

ASTERISK-24212 #close
Reported by Matt Jordan

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

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

Merged revisions 422542 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-02 20:29:58 +00:00
Scott Griepentrog 2df2d785b7 The assertion that peer was not found on final event
message was being triggered on configuration reload.
This patch changes that case to just return instead.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-29 18:46:19 +00:00
Michael L. Young c5916fb39f chan_iax2: Fix Dynamic IAX2 Registrations After Temporary DNS Failure
The reporter on the issue found some issues when upgrading from version 10 to 11
on 55 hosts.

Two situations that can occur with dynamic registrations.

1.  With dnsmgr disabled, if the host is not resolvable we are not trying to
    resolve the host again when it is time to attempt to register again.  This
    results in never registering to the host.
2.  With dnsmgr enabled, when the host is temporarily not resolvable the
    address is set to 0.0.0.0:0 and then when the host is resolvable the port
    is not being restored and stays set to 0.

This patch resolves these two issues by:

* Storing the hostname so that it can be used for resolving with DNS.
* Resolve the hostname on the next scheduled attempt to register.
* Storing the port used to reach the host so that when the hostname is
  resolvable again, we can set the port again if the port is still unset after
  looking up the host.

ASTERISK-23767 #close
Reported by: David Herselman
Tested by: David Herselman, Michael L. Young
Patches:
    asterisk-23767-dns_reg_retry_and_set_port_11_v3.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

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

Merged revisions 422276 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-28 20:31:48 +00:00
Paul Belanger ef28cc0d43 chan_sip.c: Add 'rtpbindaddr' setting
Users now have the ability to bind the rtpengine instance to a specific IP
address.  For example, you want chan_sip (call control) on eth0 but rtp (media)
on eth1.

ASTERISK-24280 #close
Reported by: Paul Belanger
Tested by: Paul Belanger
Review: https://reviewboard.asterisk.org/r/3952/
Patches:
    rtpengine.diff uploaded by Paul Belanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-28 16:06:55 +00:00
Kinsey Moore bf85018107 CallerID: Fix parsing of malformed callerid
This allows the callerid parsing function to handle malformed input
strings and strings containing escaped and unescaped double quotes.
This also adds a unittest to cover many of the cases where the parsing
algorithm previously failed.

Review: https://reviewboard.asterisk.org/r/3923/
Review: https://reviewboard.asterisk.org/r/3933/
........

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

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

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

Merged revisions 422154 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-27 15:39:35 +00:00
Joshua Colp cee660dadf chan_sip: Use the server reflexive ICE candidate RTCP port as provided.
This code originally worked around an issue within res_rtp_asterisk itself.
The wrong socket was being used for the STUN check for RTCP, causing the
port to be the same as RTP. This was subsequently fixed and the RTCP port
provided for the ICE candidate is correct and does not need to be incremented.

ASTERISK-23997 #close
Reported by: Badalian Vyacheslav
Patches:
 plus1.diff submitted by Badalian Vyacheslav (license 5249)
........

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

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

Merged revisions 421911 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-24 17:22:48 +00:00
Matthew Jordan 77ddc5b713 chan_sip: Don't use port derived from fromdomain if it isn't set
If a user does not provide a port in the fromdomain setting, chan_sip will set
the fromdomainport to STANDARD_SIP_PORT (5060). The fromdomainport value will
then get used unilaterally in certain places. This causes issues with TLS,
where the default port is expected to be 5061.

This patch modifies chan_sip such that fromdomainport is only used if it is
not the standard SIP port; otherwise, the port from the SIP pvt's recorded
self IP address is used.

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

ASTERISK-24178 #close
Reported by: Elazar Broad
patches:
  fromdomainport_fix.diff uploaded by Elazar Broad (License 5835)
........

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

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

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

Merged revisions 421720 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 17:35:15 +00:00
Richard Mudgett b7f98c3da4 chan_pjsip: Update media translation paths when new SDP negotiated.
On a SIP reinvite that changes media strams, the PJSIP channel driver was
flooding the log with "Asked to transmit frame type %s, while native
formats is %s" warnings.

* Fixes PJSIP not setting up translation paths when the formats change on
a reinvite.  AFS-63 was effectively reintroduced because of the media
formats work.  res_pjsip_sdp_rtp.c:set_caps()

* Improved the unexpected frame format WARNING message to include more
information.

* Added protective locking while altering formats on a channel.  Reworked
set_format() to simplify and protect the formats under manipulation.

* Restored some code that got lost in the media_formats work.
(channel.c:set_format() and res_pjsip_sdp_rtp.c:set_caps())

AFS-137 #close
Reported by: Mark Michelson

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

Merged revisions 421645 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-20 22:52:44 +00:00
Mark Michelson d0640ad7df Move evaluation of set_var options in pjsip to the end of channel initialization.
This allows for set_var to override certain defaults such as caller ID and codec
values. This also fixes a test suite regression. The "set_var" test suite test attempted
to use set_var to override caller ID, but a recent change caused that to no longer work.
........

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

Merged revisions 421566 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-20 20:04:43 +00:00
Richard Mudgett 83a9b91da9 chan_pjsip: Fix attended transfer connected line name update.
A calls B
B answers
B SIP attended transfers to C
C answers, B and C can see each other's connected line information
B completes the transfer
A has number but no name connected line information about C
  while C has the full information about A

I examined the incoming and outgoing party id information handling of
chan_pjsip and found several issues:

* Fixed ast_sip_session_create_outgoing() not setting up the configured
endpoint id as the new channel's caller id.  This is why party A got
default connected line information.

* Made update_initial_connected_line() use the channel's CALLERID(id)
information.  The core, app_dial, or predial routine may have filled in or
changed the endpoint caller id information.

* Fixed chan_pjsip_new() not setting the full party id information
available on the caller id and ANI party id.  This includes the configured
callerid_tag string and other party id fields.

* Fixed accessing channel party id information without the channel lock
held.

* Fixed using the effective connected line id without doing a deep copy
outside of holding the channel lock.  Shallow copy string pointers can
become stale if the channel lock is not held.

* Made queue_connected_line_update() also update the channel's
CALLERID(id) information.  Moving the channel to another bridge would need
the information there for the new bridge peer.

* Fixed off nominal memory leak in update_incoming_connected_line().

* Added pjsip.conf callerid_tag string to party id information from
enabled trust_inbound endpoint in caller_id_incoming_request().

AFS-98 #close
Reported by: Mark Michelson

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

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

Merged revisions 421403 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-19 16:16:03 +00:00
Damien Wedhorn c4c9d4ad6c Skinny: Fixup compile warning for non dev-mode.
........

Merged revisions 421376 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-18 21:18:17 +00:00
Richard Mudgett 969982b878 chan_sip: Fix type mismatch when the format is changed.
Symptom is most likely an invalid ao2 object bad magic number message or a
less likely crash.
........

Merged revisions 420881 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-12 23:45:17 +00:00
Matthew Jordan 91f7b66183 chan_sip: Mark chan_sip and its files as extended support
........

Merged revisions 420562 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-08 17:53:39 +00:00
Richard Mudgett a1424a2f1a chan_sip: Replace sip_tls_read() and resolve the large SDP poll issue.
Replace sip_tls_read() and sip_tcp_read() with a single function and
resolve the poll/wait issue with large SDP payloads.

ASTERISK-18345 #close
Reported by: Stephane Chazelas
Patches:
      tcptls_pollv4.diff (license #5835) patch uploaded by Elazar Broad

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-07 21:58:38 +00:00
Richard Mudgett ea7d4ab09e chan_iax2: Several media format fixes.
* Fixed the iax.conf bandwidth option.  This is the root cause of
ASTERISK-24150.

* Added checks in iax2_request() to ensure that there are actual formats
requested for the new channel to prevent any more fracks from issues like
ASTERISK-24150.  This is a consequence of the iax.conf bandwidth option
not working.

* Fixed struct iax2_codec_pref.order member size mismatch issue when
converting to and from the codec preference order list passed over the
wire.  In addition the values sent over the wire are now compatible with
previous Asterisk versions.

* Fixed several issues dealing with the struct iax2_codec_pref members.
Off-by-one, array limit errors, and the order/framing members always need
to be updated together.

* Made iax2_request() setup the channel's native format preference order
according to the user's wishes.  The new media format strategy needs the
order specified earler.

* Fixed usage of ast_format_compatibility_bitfield2format().  The function
can return NULL if the bitfield was not associated with a function.

* Deleted dead code iax2_codec_pref_getsize() and
iax2_codec_pref_setsize().

* Made iax2_parse_allow_disallow() and iax2_codec_pref_string() call
iax2_codec_pref_to_cap() instead of inlining it.

* Made IAX_CAPABILITY_MEDBANDWIDTH, IAX_CAPABILITY_LOWBANDWIDTH, and
IAX_CAPABILITY_LOWFREE constants again as they were in Asterisk v1.8.

* Renamed prefs to prefs_global so it won't get confused with the local
pref versions.

* Fixed too small buffer in handle_cli_iax2_show_peer().

* Fixed ast_cli() calls in handle_cli_iax2_show_peer() to output complete
lines.

* Changed struct create_addr_info.prefs to be struct iax2_codec_pref as an
optimization so iax2_request() and iax2_call() do less work.

* Fixed a potential deadlock in ast_iax2_new() on an off-nominal path when
the pbx could not get started.

* Made set_config() setup a local prefs list along side the local
capability format bitfield.  Once the config is loaded, then the local
copies are put into the global versions.

* Fix unininialized codec_buf in function_iaxpeer().

ASTERISK-24150 #close
Reported by: Scott Griepentrog

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-07 18:51:16 +00:00
Matthew Jordan 47bf7efc4d Multiple revisions 420089-420090,420097
........
  r420089 | mjordan | 2014-08-05 15:10:52 -0500 (Tue, 05 Aug 2014) | 72 lines
  
  ARI: Add channel technology agnostic out of call text messaging
  
  This patch adds the ability to send and receive text messages from various
  technology stacks in Asterisk through ARI. This includes chan_sip (sip),
  res_pjsip_messaging (pjsip), and res_xmpp (xmpp). Messages are sent using the
  endpoints resource, and can be sent directly through that resource, or to a
  particular endpoint.
  
  For example, the following would send the message "Hello there" to PJSIP
  endpoint alice with a display URI of sip:asterisk@mycooldomain.org:
  
  ari/endpoints/sendMessage?to=pjsip:alice&from=sip:asterisk@mycooldomain.org&body=Hello+There
  
  This is equivalent to the following as well:
  
  ari/endpoints/PJSIP/alice/sendMessage?from=sip:asterisk@mycooldomain.org&body=Hello+There
  
  Both forms are available for message technologies that allow for arbitrary
  destinations, such as chan_sip.
  
  Inbound messages can now be received over ARI as well. An ARI application that
  subscribes to endpoints will receive messages from those endpoints:
  
  {
    "type": "TextMessageReceived",
    "timestamp": "2014-07-12T22:53:13.494-0500",
    "endpoint": {
      "technology": "PJSIP",
      "resource": "alice",
      "state": "online",
      "channel_ids": []
    },
    "message": {
      "from": "\"alice\" <sip:alice@127.0.0.1>",
      "to": "pjsip:asterisk@127.0.0.1",
      "body": "Watson, come here.",
      "variables": []
    },
    "application": "testsuite"
  }
  
  The above was made possible due to some rather major changes in the message
  core. This includes (but is not limited to):
  - Users of the message API can now register message handlers. A handler has
    two callbacks: one to determine if the handler has a destination for the
    message, and another to handle it.
  - All dialplan functionality of handling a message was moved into a message
    handler provided by the message API.
  - Messages can now have the technology/endpoint associated with them.
    Various other properties are also now more easily accessible.
  - A number of ao2 containers that weren't really needed were replaced with
    vectors. Iteration over ao2_containers is expensive and pointless when
    the lifetime of things is well defined and the number of things is very
    small.
  
  res_stasis now has a new file that makes up its structure, messaging. The
  messaging functionality implements a message handler, and passes received
  messages that match an interested endpoint over to the app for processing.
  
  Note that inadvertently while testing this, I reproduced ASTERISK-23969.
  res_pjsip_messaging was incorrectly parsing out the 'to' field, such that
  arbitrary SIP URIs mangled the endpoint lookup. This patch includes the
  fix for that as well.
  
  Review: https://reviewboard.asterisk.org/r/3726
  
  ASTERISK-23692 #close
  Reported by: Matt Jordan
  
  ASTERISK-23969 #close
  Reported by: Andrew Nagy
........
  r420090 | mjordan | 2014-08-05 15:16:37 -0500 (Tue, 05 Aug 2014) | 2 lines
  
  Remove automerge properties :-(
........
  r420097 | mjordan | 2014-08-05 16:36:25 -0500 (Tue, 05 Aug 2014) | 2 lines
  
  test_message: Fix strict-aliasing compilation issue
........

Merged revisions 420089-420090,420097 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-05 21:44:09 +00:00
Mark Michelson ca725e1cf6 Add the ability to retrieve the source port of a SIP call.
This adds the ability to call CHANNEL(recvport) on chan_sip
channels to see the port on which an INVITE was received.

ASTERISK-24040 #close
Reported by dtryba
Patches:
	dialplan_functions.patch uploaded by dtryba (License #6628)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-04 20:25:16 +00:00
Matthew Jordan bbeaeea1a3 res_hep_rtcp: Add module that sends RTCP information to a Homer Server
This patch adds a new module to Asterisk, res_hep_rtcp. The module subscribes
to the RTCP topics in Stasis and receives RTCP information back from the
message bus. It encodes into HEPv3 packets and sends the information to the
res_hep module for transmission.

Using this, someone with a Homer server can get live call quality monitoring
for all RTP-based channels in their Asterisk 12+ systems.

In addition, there were a few bugs in the RTP engine, res_rtp_asterisk, and
chan_pjsip that were uncovered by the tests written for the Asterisk Test
Suite. This patch fixes the following:
1) chan_pjsip failed to set its channel unique ids on its RTP instance on
   outbound calls. It now does this in the appropriate location, in the
   serialized call callback.
2) The rtp_engine was overflowing some values when packed into JSON.
   Specifically, some longs and unsigned ints can't be be packed into integer
   values, for obvious reasons. Since libjansson only supports integers,
   floats, strings, booleans, and objects, we print these values into strings.
3) res_rtp_asterisk had a few problems:
   (a) it would emit a source IP address of 0.0.0.0 if bound to that IP
       address. We now use ast_find_ourip to get a better IP address, and
       properly marshal the result into an ast_strdupa'd string.
   (b) Reports can be generated with no report bodies. In particular, this
       occurs when a sender is transmitting information to a receiver (who
       will send no RTP back to the sender). As such, the sender has no report
       body for what it received. We now properly handle this case, and the
       sender will emit SR reports with no body. Likewise, if we receive an
       RTCP packet with no report body, we will still generate the appropriate
       events.

ASTERISK-24119 #close
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-31 11:57:51 +00:00
Mark Michelson dcf1ad14da Add module support level to ast_module_info structure. Print it in CLI "module show" .
ASTERISK-23919 #close
Reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25 16:47:17 +00:00
Corey Farrell 5bea6c1b1c chan_sip: complete upgrade to ao2
This change upgrades sip_registry and sip_subscription_mwi to astobj2.

ASTERISK-24067 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3759/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-24 17:47:29 +00:00
Matthew Jordan f6283866c1 device state: Update the core to report ONHOLD if a channel is on hold
In Asterisk, it is possible for a device to have a status of ONHOLD. This is
not typically an easy thing to determine, as a channel being on hold is not
a direct channel state. Typically, this has to be calculated outside of the
core independently in channel drivers, notably, chan_sip and chan_pjsip. Both
of these channel drivers already have to calculate device state in a fashion
more complex than the core can handle, as they aggregate all state of all
channels associated with a peer/endpoint; they also independently track
whether or not one of those channels is currently on hold and mark the device
state appropriately.

In 12+, we now have the ability to report an AST_DEVICE_ONHOLD state for all
channels that defer their device state to the core. This is due to channel hold
state actually now being tracked on the channel itself. If a channel driver
defers its device state to the core (which many, such as DAHDI, IAX2, and
others do in most situations), the device state core already goes out to get a
channel associated with the device. As such, it can now also factor the channel
hold state in its calculation.

This patch adds this logic to the device state core. It also uses an existing
mapping between device state and channel state to handle more channel states.
chan_pjsip has been updated slightly as well to make use of this (as it was,
for some reason, reporting a channel state of BUSY as a device state of INUSE,
which feels slightly wrong).

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

ASTERISK-24038 #close


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-24 15:20:58 +00:00
Matthew Jordan bb87796f67 ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech
This patch serves two purposes:
(1) It fixes some bugs with endpoint subscriptions not reporting all of the
    channel events
(2) It serves as the preliminary work needed for ASTERISK-23692, which allows
    for sending/receiving arbitrary out of call text messages through ARI in a
    technology agnostic fashion.

The messaging functionality described on ASTERISK-23692 requires two things:
(1) The ability to send/receive messages associated with an endpoint. This is
    relatively straight forwards with the endpoint core in Asterisk now.
(2) The ability to send/receive messages associated with a technology and an
    arbitrary technology defined URI. This is less straight forward, as
    endpoints are formed from a tech + resource pair. We don't have a
    mechanism to note that a technology that *may* have endpoints exists.

This patch provides such a mechanism, and fixes a few bugs along the way.

The first major bug this patch fixes is the forwarding of channel messages
to their respective endpoints. Prior to this patch, there were two problems:
(1) Channel caching messages weren't forwarded. Thus, the endpoints missed
    most of the interesting bits (such as channel creation, destruction, state
    changes, etc.)
(2) Channels weren't associated with their endpoint until after creation.
    This resulted in endpoints missing the channel creation message, which
    limited the usefulness of the subscription in the first place (a major use
    case being 'tell me when this endpoint has a channel'). Unfortunately,
    this meant another parameter to ast_channel_alloc. Since not all channel
    technologies support an ast_endpoint, this patch makes such a call
    optional and opts for a new function, ast_channel_alloc_with_endpoint.

When endpoints are created, they will implicitly create a technology endpoint
for their technology (if one does not already exist). A technology endpoint is
special in that it has no state, cannot have channels created for it, cannot
be created explicitly, and cannot be destroyed except on shutdown. It does,
however, have all messages from other endpoints in its technology forwarded to
it.

Combined with the bug fixes, we now have Stasis messages being properly
forwarded. Consider the following scenario: two PJSIP endpoints (foo and bar),
where bar has a single channel associated with it and foo has two channels
associated with it. The messages would be forwarded as follows:

channel PJSIP/foo-1 --
                      \
                       --> endpoint PJSIP/foo --
                      /                         \
channel PJSIP/foo-2 --                           \
                                                  ---- > endpoint PJSIP
                                                /
channel PJSIP/bar-1 -----> endpoint PJSIP/bar --

ARI, through the applications resource, can:
 - subscribe to endpoint:PJSIP/foo and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2 and endpoint PJSIP/foo
 - subscribe to endpoint:PJSIP/bar and get notifications for channels
   PJSIP/bar-1 and endpoint PJSIP/bar
 - subscribe to endpoint:PJSIP and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2,PJSIP/bar-1 and endpoints PJSIP/foo,PJSIP/bar

Note that since endpoint PJSIP never changes, it never has events itself. It
merely provides an aggregation point for all other endpoints in its technology
(which in turn aggregate all channel messages associated with that endpoint).

This patch also adds endpoints to res_xmpp and chan_motif, because the actual
messaging work will need it (messaging without XMPP is just sad).

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

ASTERISK-23692
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-22 16:20:58 +00:00
Joshua Colp 84beaf27bc chan_iax2: Restore previous behavior of iax2_best_codec.
The iax2_best_codec function was changed to convert the formats
into a format compatibilities structure and grab the first
format from it. The resulting order differs from the previous
order of iax2_best_codec which causes unexpected formats to
get chosen (such as g723).

This commit brings back the old behavior of iax2_best_codec by
having a specified preference list.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-22 14:36:26 +00:00
Kinsey Moore 6e31ca48b0 Fix build in dev-mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-21 17:01:05 +00:00
Jonathan Rose 7622f1ad2a chan_iax2: Restore codec choice behavior from media formats branch
After merging the media formats branch, chan_iax2 was discarding
codec preferences for the purpose of choosing which codec a
channel would use once a call started. This patch restores the
Asterisk 1.8-12 codec choice behaviors.

ASTERISK-23958 #close
Review: https://reviewboard.asterisk.org/r/3800/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-21 16:26:36 +00:00
Joshua Colp 41337750c3 chan_iax2: Only send mini frames if the underlying format has not changed, not if it has.
ASTERISK-24072 #close
Reported by: Matt Jordan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-21 16:09:33 +00:00
Corey Farrell e04607f8a3 res_smdi: convert to astobj2
Remove functions:
	ast_smdi_interface_unref
	ast_smdi_md_message_putback
	ast_smdi_mwi_message_putback
	ast_smdi_md_message destructor
	ast_smdi_mwi_message destructor

Includes for astobj.h are removed everywhere it's possible.

ASTERISK-24066 #close
Review: https://reviewboard.asterisk.org/r/3758/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-21 08:41:29 +00:00
Matthew Jordan a2c912e997 media formats: re-architect handling of media for performance improvements
In the old times media formats were represented using a bit field. This was
fast but had a few limitations.
 1. Asterisk was limited in how many formats it could handle.
 2. Formats, being a bit field, could not include any attribute information.
    A format was strictly its type, e.g., "this is ulaw".
This was changed in Asterisk 10 (see
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal for
notes on that work) which led to the creation of the ast_format structure.
This structure allowed Asterisk to handle attributes and bundle information
with a format.

Additionally, ast_format_cap was created to act as a container for multiple
formats that, together, formed the capability of some entity. Another
mechanism was added to allow logic to be registered which performed format
attribute negotiation. Everywhere throughout the codebase Asterisk was
changed to use this strategy.

Unfortunately, in software, there is no free lunch. These new capabilities
came at a cost.

Performance analysis and profiling showed that we spend an inordinate
amount of time comparing, copying, and generally manipulating formats and
their related structures. Basic prototyping has shown that a reasonably
large performance improvement could be made in this area. This patch is the
result of that project, which overhauled the media format architecture
and its usage in Asterisk to improve performance.

Generally, the new philosophy for handling formats is as follows:
 * The ast_format structure is reference counted. This removed a large amount
   of the memory allocations and copying that was done in prior versions.
 * In order to prevent race conditions while keeping things performant, the
   ast_format structure is immutable by convention and lock-free. Violate this
   tenet at your peril!
 * Because formats are reference counted, codecs are also reference counted.
   The Asterisk core generally provides built-in codecs and caches the
   ast_format structures created to represent them. Generally, to prevent
   inordinate amounts of module reference bumping, codecs and formats can be
   added at run-time but cannot be removed.
 * All compatibility with the bit field representation of codecs/formats has
   been moved to a compatibility API. The primary user of this representation
   is chan_iax2, which must continue to maintain its bit-field usage of formats
   for interoperability concerns.
 * When a format is negotiated with attributes, or when a format cannot be
   represented by one of the cached formats, a new format object is created or
   cloned from an existing format. That format may have the same codec
   underlying it, but is a different format than a version of the format with
   different attributes or without attributes.
 * While formats are reference counted objects, the reference count maintained
   on the format should be manipulated with care. Formats are generally cached
   and will persist for the lifetime of Asterisk and do not explicitly need
   to have their lifetime modified. An exception to this is when the user of a
   format does not know where the format came from *and* the user may outlive
   the provider of the format. This occurs, for example, when a format is read
   from a channel: the channel may have a format with attributes (hence,
   non-cached) and the user of the format may last longer than the channel (if
   the reference to the channel is released prior to the format's reference).

For more information on this work, see the API design notes:
  https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

Finally, this work was the culmination of a large number of developer's
efforts. Extra thanks goes to Corey Farrell, who took on a large amount of the
work in the Asterisk core, chan_sip, and was an invaluable resource in peer
reviews throughout this project.

There were a substantial number of patches contributed during this work; the
following issues/patch names simply reflect some of the work (and will cause
the release scripts to give attribution to the individuals who work on them).

Reviews:
 https://reviewboard.asterisk.org/r/3814
 https://reviewboard.asterisk.org/r/3808
 https://reviewboard.asterisk.org/r/3805
 https://reviewboard.asterisk.org/r/3803
 https://reviewboard.asterisk.org/r/3801
 https://reviewboard.asterisk.org/r/3798
 https://reviewboard.asterisk.org/r/3800
 https://reviewboard.asterisk.org/r/3794
 https://reviewboard.asterisk.org/r/3793
 https://reviewboard.asterisk.org/r/3792
 https://reviewboard.asterisk.org/r/3791
 https://reviewboard.asterisk.org/r/3790
 https://reviewboard.asterisk.org/r/3789
 https://reviewboard.asterisk.org/r/3788
 https://reviewboard.asterisk.org/r/3787
 https://reviewboard.asterisk.org/r/3786
 https://reviewboard.asterisk.org/r/3784
 https://reviewboard.asterisk.org/r/3783
 https://reviewboard.asterisk.org/r/3778
 https://reviewboard.asterisk.org/r/3774
 https://reviewboard.asterisk.org/r/3775
 https://reviewboard.asterisk.org/r/3772
 https://reviewboard.asterisk.org/r/3761
 https://reviewboard.asterisk.org/r/3754
 https://reviewboard.asterisk.org/r/3753
 https://reviewboard.asterisk.org/r/3751
 https://reviewboard.asterisk.org/r/3750
 https://reviewboard.asterisk.org/r/3748
 https://reviewboard.asterisk.org/r/3747
 https://reviewboard.asterisk.org/r/3746
 https://reviewboard.asterisk.org/r/3742
 https://reviewboard.asterisk.org/r/3740
 https://reviewboard.asterisk.org/r/3739
 https://reviewboard.asterisk.org/r/3738
 https://reviewboard.asterisk.org/r/3737
 https://reviewboard.asterisk.org/r/3736
 https://reviewboard.asterisk.org/r/3734
 https://reviewboard.asterisk.org/r/3722
 https://reviewboard.asterisk.org/r/3713
 https://reviewboard.asterisk.org/r/3703
 https://reviewboard.asterisk.org/r/3689
 https://reviewboard.asterisk.org/r/3687
 https://reviewboard.asterisk.org/r/3674
 https://reviewboard.asterisk.org/r/3671
 https://reviewboard.asterisk.org/r/3667
 https://reviewboard.asterisk.org/r/3665
 https://reviewboard.asterisk.org/r/3625
 https://reviewboard.asterisk.org/r/3602
 https://reviewboard.asterisk.org/r/3519
 https://reviewboard.asterisk.org/r/3518
 https://reviewboard.asterisk.org/r/3516
 https://reviewboard.asterisk.org/r/3515
 https://reviewboard.asterisk.org/r/3512
 https://reviewboard.asterisk.org/r/3506
 https://reviewboard.asterisk.org/r/3413
 https://reviewboard.asterisk.org/r/3410
 https://reviewboard.asterisk.org/r/3387
 https://reviewboard.asterisk.org/r/3388
 https://reviewboard.asterisk.org/r/3389
 https://reviewboard.asterisk.org/r/3390
 https://reviewboard.asterisk.org/r/3321
 https://reviewboard.asterisk.org/r/3320
 https://reviewboard.asterisk.org/r/3319
 https://reviewboard.asterisk.org/r/3318
 https://reviewboard.asterisk.org/r/3266
 https://reviewboard.asterisk.org/r/3265
 https://reviewboard.asterisk.org/r/3234
 https://reviewboard.asterisk.org/r/3178

ASTERISK-23114 #close
Reported by: mjordan
  media_formats_translation_core.diff uploaded by kharwell (License 6464)
  rb3506.diff uploaded by mjordan (License 6283)
  media_format_app_file.diff uploaded by kharwell (License 6464) 
  misc-2.diff uploaded by file (License 5000)
  chan_mild-3.diff uploaded by file (License 5000) 
  chan_obscure.diff uploaded by file (License 5000) 
  jingle.diff uploaded by file (License 5000) 
  funcs.diff uploaded by file (License 5000) 
  formats.diff uploaded by file (License 5000) 
  core.diff uploaded by file (License 5000) 
  bridges.diff uploaded by file (License 5000) 
  mf-codecs-2.diff uploaded by file (License 5000) 
  mf-app_fax.diff uploaded by file (License 5000) 
  mf-apps-3.diff uploaded by file (License 5000) 
  media-formats-3.diff uploaded by file (License 5000) 

ASTERISK-23715
  rb3713.patch uploaded by coreyfarrell (License 5909)
  rb3689.patch uploaded by mjordan (License 6283)
  
ASTERISK-23957
  rb3722.patch uploaded by mjordan (License 6283) 
  mf-attributes-3.diff uploaded by file (License 5000) 

ASTERISK-23958
Tested by: jrose
  rb3822.patch uploaded by coreyfarrell (License 5909) 
  rb3800.patch uploaded by jrose (License 6182)
  chan_sip.diff uploaded by mjordan (License 6283) 
  rb3747.patch uploaded by jrose (License 6182)

ASTERISK-23959 #close
Tested by: sgriepentrog, mjordan, coreyfarrell
  sip_cleanup.diff uploaded by opticron (License 6273)
  chan_sip_caps.diff uploaded by mjordan (License 6283) 
  rb3751.patch uploaded by coreyfarrell (License 5909) 
  chan_sip-3.diff uploaded by file (License 5000) 

ASTERISK-23960 #close
Tested by: opticron
  direct_media.diff uploaded by opticron (License 6273) 
  pjsip-direct-media.diff uploaded by file (License 5000) 
  format_cap_remove.diff uploaded by opticron (License 6273) 
  media_format_fixes.diff uploaded by opticron (License 6273) 
  chan_pjsip-2.diff uploaded by file (License 5000) 

ASTERISK-23966 #close
Tested by: rmudgett
  rb3803.patch uploaded by rmudgetti (License 5621)
  chan_dahdi.diff uploaded by file (License 5000) 
  
ASTERISK-24064 #close
Tested by: coreyfarrell, mjordan, opticron, file, rmudgett, sgriepentrog, jrose
  rb3814.patch uploaded by rmudgett (License 5621) 
  moh_cleanup.diff uploaded by opticron (License 6273) 
  bridge_leak.diff uploaded by opticron (License 6273) 
  translate.diff uploaded by file (License 5000) 
  rb3795.patch uploaded by rmudgett (License 5621) 
  tls_fix.diff uploaded by mjordan (License 6283) 
  fax-mf-fix-2.diff uploaded by file (License 5000) 
  rtp_transfer_stuff uploaded by mjordan (License 6283) 
  rb3787.patch uploaded by rmudgett (License 5621) 
  media-formats-explicit-translate-format-3.diff uploaded by file (License 5000) 
  format_cache_case_fix.diff uploaded by opticron (License 6273) 
  rb3774.patch uploaded by rmudgett (License 5621) 
  rb3775.patch uploaded by rmudgett (License 5621) 
  rtp_engine_fix.diff uploaded by opticron (License 6273) 
  rtp_crash_fix.diff uploaded by opticron (License 6273) 
  rb3753.patch uploaded by mjordan (License 6283) 
  rb3750.patch uploaded by mjordan (License 6283) 
  rb3748.patch uploaded by rmudgett (License 5621) 
  media_format_fixes.diff uploaded by opticron (License 6273) 
  rb3740.patch uploaded by mjordan (License 6283) 
  rb3739.patch uploaded by mjordan (License 6283) 
  rb3734.patch uploaded by mjordan (License 6283) 
  rb3689.patch uploaded by mjordan (License 6283) 
  rb3674.patch uploaded by coreyfarrell (License 5909) 
  rb3671.patch uploaded by coreyfarrell (License 5909) 
  rb3667.patch uploaded by coreyfarrell (License 5909) 
  rb3665.patch uploaded by mjordan (License 6283) 
  rb3625.patch uploaded by coreyfarrell (License 5909) 
  rb3602.patch uploaded by coreyfarrell (License 5909) 
  format_compatibility-2.diff uploaded by file (License 5000) 
  core.diff uploaded by file (License 5000) 
  


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-20 22:06:33 +00:00
Scott Griepentrog f91989d44e media formats: fix ref leak of peer for mwi subscription
Holding a reference to the peer during mwi subscriptions
resulted in a circular reference because the final event
message would not be sent until destruction of the peer.

Instead, pass the name of the peer to the event callback
so that it can fail gracefully after the peer has gone.

ASTERISK-23959
Review: https://reviewboard.asterisk.org/r/3754/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-18 17:42:41 +00:00
Matthew Jordan 1ce23d4534 chan_sip: Make progressinband=never really mean 'never'
progressinband=never in sip.conf is easily defeated if an onward trunk sends a
progress indication of its own. This is almost certain to happen if the onward
trunk is ISDN or IAX as these technologies send a progress indication even if
early media is not required. This progress message is passed to the caller,
and causes the "never" option to be rather badly named.

This patch changes the behaviour of this setting in the following ways:

1) In sip_write(), do not pass the media unless we have either progressed
   beyond INV_EARLY_MEDIA, or we are in INV_EARLY_MEDIA state, and early
   media is both set-up and wanted. This helps resolve double-ringing on some
   buggy handsets.

2) In sip_indicate(), if we see AST_CONTROL_PROGRESS, but
   SIP_PROG_INBAND_NEVER is set, send a 180 Ringing instead to avoid implicitly
   enabling early media. Avoid sending double ring indications.

NOTE: the meaning of the SIP_PROGRESS_SENT flag changes slightly in this patch
to also encapsulate the fact that a channel has *sent or received* a 183
Progress indication. This makes the updated code in sip_write() much more
simple.

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

ASTERISK-23972 #close
Reported by: Steve Davies
patches:
  inband_never_present_early_media2 uploaded by Steve Davies (License 5012)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-17 21:04:01 +00:00
Corey Farrell 7b7132710b Remove include of astobj.h from channels/dahdi/bridge_native_dahdi.c.
The include was unneeded, this is split off from r3758 as it applies to 12.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-16 23:08:19 +00:00
Matthew Jordan fd94fea599 res_pjsip: Support setting a default accountcode on endpoints
Most channel drivers let you specify a default accountcode to be set on
channels associated with a particular peer/endpoint/object. Prior to this
patch, chan_pjsip/res_pjsip did not support such a setting.

This patch adds a new setting to the res_pjsip endpoint object, 'accountcode'.
When a channel is created that is associated with an endpoint with this value
set, the channel will automatically have its accountcode property set to the
value configured for the endpoint.

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

ASTERISK-24000 #close
Reported by: Matt Jordan
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-16 14:03:51 +00:00