Commit Graph

120 Commits

Author SHA1 Message Date
Torrey Searle bf4340f0ec res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough
When moh_passthrough is used, asterisk is only generating invites
of type sendonly and sendrecv instead of taking fully into account
the on hold state of the local and remote parties

ASTERISK-28738 #close

Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761
2020-02-17 08:35:02 -06:00
Kevin Harwell b805e1237d srtp: Fix possible race condition, and add NULL checks
Somehow it's possible for the srtp session object to be NULL even though the
Asterisk srtp object itself is valid. When this happened it would cause a
crash down in the srtp code when attempting to protect or unprotect data.

After looking at the code there is at least one spot that makes this situation
possible. If Asterisk fails to unprotect the data, and after several retries
it still can't then the srtp->session gets freed, and set to NULL while still
leaving the Asterisk srtp object around. However, according to the original
issue reporter this does not appear to be their situation since they found
no errors logged stating the above happened (which Asterisk does for that
situation).

An issue was found however, where a possible race condition could occur between
the pjsip incoming negotiation, and the receiving of RTP packets. Both places
could attempt to create/setup srtp for the same rtp instance at the same time.
This potentially could be the cause of the problem as well.

Given the above this patch adds locking around srtp setup for a given rtp, or
rtcp instance. NULL checks for the session have also been added within the
protect and unprotect functions as a precaution. These checks should at least
stop Asterisk from crashing if it gets in this situation again.

This patch also fixes one other issue noticed during investigation. When doing
a replace the old object was freed before creating the replacement. If the new
replacement object failed to create then the rtp/rtcp instance would now point
to freed srtp data which could potentially cause a crash as well when the next
attempt to reference it was made. This is now fixed so the old srtp object is
kept upon replacement failure.

Lastly, more logging has been added to help diagnose future issues.

ASTERISK-28472

Change-Id: I240e11cbb1e9ea8083d59d50db069891228fe5cc
2019-08-08 11:31:15 -05:00
Kevin Harwell 93936e367d res_pjsip_sdp_rtp: Remove unused variable
The variable 'endpoint_caps' in function 'set_caps' is not used, so remove.

ASTERISK-28458

Change-Id: Ia8766d05a0738aecb29dd018302c2dafca5cab34
2019-07-01 09:51:15 -06:00
Joshua Colp 6bb70c93f1 rtp: Add support for transport-cc in receiver direction.
The transport-cc draft is a mechanism by which additional information
about packet reception can be provided to the sender of packets so
they can do sender side bandwidth estimation. This is accomplished
by having a transport specific sequence number and an RTCP feedback
message. This change implements this in the receiver direction.

For each received RTP packet where transport-cc is negotiated we store
the time at which the RTP packet was received and its sequence number.
At a 1 second interval we go through all packets in that period of time
and use the stored time of each in comparison to its preceding packet to
calculate its delta. This delta information is placed in the RTCP
feedback message, along with indicators for any packets which were not
received.

The browser then uses this information to better estimate available
bandwidth and adjust accordingly. This may result in it lowering the
available send bandwidth or adjusting how "bursty" it can be.

ASTERISK-28400

Change-Id: I654a2cff5bd5554ab94457a14f70adb71f574afc
2019-05-01 05:13:14 -06:00
George Joseph 8f9ffe5905 res_pjsip_sdp_rtp: Fix return code from apply_negotiated_sdp_stream
apply_negotiated_sdp_stream was returning a "1" when no joint
capabilities were found on an outgoing call instead of a "-1".
This indicated to res_pjsip_session that the handler DID handle
the sdp when in fact it didn't.  Without the appropriate setup,
a subsequent media frame coming in would have an invalid stream_num
and cause a seg fault when the stream was attempted to be retrieved.

apply_negotiated_sdp_stream now returns the correct "-1" and any
media is now discarded before it reaches the core stream processing.

ASTERISK-28260
Reported by: Sotiris Ganouris

Change-Id: Ia095cb16b4862f2f6ad6d2d2a77453fa2542371f
2019-02-28 11:35:53 -06:00
Joshua Colp e6b67b2a5d res_pjsip_sdp_rtp: Allow only single ssrc attribute.
When processing SSRC attributes we were iterating through
all of them, even though we only need to know the remote
SSRC once. This was problematic because some browsers group
SSRCs together on a stream, and due to our negotiation only
end up using the first one. Since we set the second one as
the remote SSRC we would drop the received media from them
instead of allowing it through.

In the future this may be extended to allow SSRC groups
and to use information from the attributes.

Change-Id: I4dc87087dbe56a83aa65f0f897bbd4ca75ec1270
2019-02-21 12:08:34 -06:00
Xiemin Chen a526676836 bridge_softmix: Use MSID:LABEL metadata as the cloned stream's appendix
To avoid the stream name collide if there're more than one video track
in one client. If client has multi video tracks, the name of ast_stream
which represents each video track may be the same. Use the MSID:LABEL
here because it's identifiable.

ASTERISK-28196 #close
Reported-by: xiemchen

Change-Id: Ib62b2886e8d3a30e481d94616b0ceaeab68a870b
2019-01-22 09:01:34 -06:00
Joshua Colp 18e206381a res_pjsip_sdp_rtp: Only enable abs-send-time when WebRTC is enabled.
For video streams it was possible for the abs-send-time information
to be placed into RTP streams even if not negotiated. Depending on
the endpoint in use this could cause video to not flow.

We now only enable abs-send-time for negotiation if WebRTC is enabled.

ASTERISK-28230

Change-Id: I0eb682302f8da3a4ea3c42e839208d55f825ed0c
2019-01-07 10:35:18 -05:00
Joshua Colp ce9a980be6 pjproject: Upgrade to 2.8.
This change brings in PJSIP 2.8, removes all the patches
that were merged upstream, and makes a minor change to
support a breaking change that was done.

ASTERISK-28059

Change-Id: I5097772b11b0f95c3c1f52df6400158666f0a189
2018-09-18 11:32:18 -05:00
Torrey Searle 926d647def res/res_pjsip_sdp_rtp: put rtcp-mux in answer only if offered
If in the initial sdp the caller doesn't include the line
a=rtcp-mux

Then asterisk shoud not include rtcp-mux in the response regardless
of rtcp-mux being enabled on the endpoint

ASTERISK-28007 #close

Change-Id: I58e9b9f40a139afc0da5de41906cc608fb62adc7
2018-08-16 02:06:43 -05:00
George Joseph c8e4cd8bce Merge "res_pjsip_sdp_rtp: include ice in ANSWER only if offered" 2018-07-18 14:29:19 -05:00
George Joseph 34f3fe9552 app_confbridge: Use the SDP 'label' attribute to correlate users
Previously, the msid "label" attribute was used to correlate
participant info but because streams could be reused, the msid
wasn't being updated correctly when someone left the bridge and
another joined.

Now, instead of looking for the msid attribute on a channel's streams,
app_confbridge sets an "SDP:LABEL" attribute on the stream which
res_pjsip_sdp_rtp looks for.  If it finds it, it adds a "label"
attribute to the current sdp.

Change-Id: I6cbaa87fb59a2e0688d956e72d2d09e4ac20d5a5
2018-07-13 11:33:30 -05:00
Torrey Searle 1445384699 res_pjsip_sdp_rtp: include ice in ANSWER only if offered
Keep track if ICE candidates were in the SDP offer & only put them
in the corresponding SDP answer if the offer condaind ICE candidates

ASTERISK-27957 #close

Change-Id: Idf2597ee48e9a287e07aa4030bfa705430a13a92
2018-07-13 03:03:40 -05:00
George Joseph e7a7506f9c app_confbridge: Enable sending events to participants
ConfBridge can now send events to participants via in-dialog MESSAGEs.
All current Confbridge events are supported, such as ConfbridgeJoin,
ConfbridgeLeave, etc.  In addition to those events, a new event
ConfbridgeWelcome has been added that will send a list of all
current participants to a new participant.

For all but the ConfbridgeWelcome event, the JSON message contains
information about the bridge, such as its id and name, and information
about the channel that triggered the event such as channel name,
callerid info, mute status, and the MSID labels for their audio and
video tracks. You can use the labels to correlate callerid and mute
status to specific video elements in a webrtc client.

To control this behavior, the following options have been added to
confbridge.conf:

bridge_profile/enable_events:  This must be enabled on any bridge where
events are desired.

user_profile/send_events:  This must be set for a user profile to send
events.  Different user profiles connected to the same bridge can have
different settings.  This allows admins to get events but not normal
users for instance.

user_profile/echo_events:  In some cases, you might not want the user
triggering the event to get the event sent back to them.  To prevent it,
set this to false.

A change was also made to res_pjsip_sdp_rtp to save the generated msid
to the stream so it can be re-used.  This allows participant A's video
stream to appear as the same label to all other participants.

Change-Id: I26420aa9f101f0b2387dc9e2fd10733197f1318e
2018-06-13 09:12:18 -06:00
Joshua Colp a507c73a78 rtp: Add support for RTP extension negotiation and abs-send-time.
When RTP was originally created it had the ability to place a single
extension in an RTP packet. In practice people wanted to potentially
put multiple extensions in one and so RFC 5285 (obsoleted by RFC
8285) came into existence. This allows RTP extensions to be negotiated
with a unique identifier to be used in the RTP packet, allowing
multiple extensions to be present in the packet.

This change extends the RTP engine API to add support for this. A
user of it can enable extensions and the API provides the ability to
retrieve the information (to construct SDP for example) and to provide
negotiated information (from SDP). The end result is that the RTP
engine can then query to see if the extension has been negotiated and
what unique identifier is to be used. It is then up to the RTP engine
implementation to construct the packet appropriately.

The first extension to use this support is abs-send-time which is
defined in the REMB draft[1] and is a second timestamp placed in an
RTP packet which is for when the packet has left the sending system.
It is used to more accurately determine the available bandwidth.

ASTERISK-27831

[1] https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03

Change-Id: I508deac557867b1e27fc7339be890c8018171588
2018-05-23 09:41:59 -06:00
Ben Ford f5d5083ea7 res_rtp_asterisk: Add support for receiving and handling NACK requests.
Adds the ability to receive and handle incoming NACK requests if
retransmissions are enabled. If retransmissions are enabled, a data
buffer is allocated that stores packets being sent. If a NACK request
is received, the packet requested for retransmission is sent if it is
still in the buffer. In the same request, if any of the following 16
packets are marked as not received, those will be sent as well if
available, as outlined in RFC4585.

Also changes RTCP RR and SR to use media source SSRC instead of packet
source SSRC when determining which instance to use for RTCP reports.

For more information, refer to the wiki page:
https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements

ASTERISK-27806 #close

Change-Id: I7f7f124af3b9d5d2fd9cffc6ba8cb48a6fff06ec
2018-04-16 17:21:18 -06:00
Joshua Colp 115939caeb rtp: Add REMB RTP property and set it on PJSIP video RTP.
This change adds a property to RTP instances to indicate that
REMB support is enabled and that sending/receiving should be
passed through.

This also enables it on video RTP instances in PJSIP if
WebRTC support is enabled.

Finally the goog-remb extension is added to the SDP using
the rtcp-fb attribute to indicate our support for it.

Details about REMB can be found on the draft document for it:
https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03

Change-Id: I1902dda1c0882bd1a0d71b2f120684b44b97e789
2018-03-19 07:48:47 -06:00
Ben Ford 0be1c388e4 Add extended properties to rtp_engine for RTP retransmission support.
A couple of additional properties are needed in rtp_engine to enable
support for packet retransmission: AST_RTP_PROPERTY_RETRANS_RECV and
AST_RTP_PROPERTY_RETRANS_SEND. These will both be enabled automatically
if an endpoint has the webrtc option enabled. While this adds no
functionality currently, it will serve as a building block for future
changes for RTP retransmission support.

For more information, refer to the wiki page:
https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements

Change-Id: Ic598acd042a045f9d10e5bdccb66f4efc9e587cc
2018-02-23 12:56:00 -06:00
Corey Farrell 527cf5a570 Remove redundant module checks and references.
This removes references that are no longer needed due to automatic
references created by module dependencies.

In addition this removes most calls to ast_module_check as they were
checking modules which are listed as dependencies.

Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
2018-01-24 13:37:29 -05:00
Corey Farrell 9cfdb81e91 loader: Add dependency fields to module structures.
* Declare 'requires' and 'enhances' text fields on module info structure.
* Rename 'nonoptreq' to 'optional_modules'.
* Update doxygen comments.

Still need to investigate dependencies among modules I cannot compile.

Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
2018-01-15 13:25:51 -05:00
Sean Bright 15f8b9b8bf ice: Increase foundation buffer size
Per RFC 5245, the foundation specified with an ICE candidate can be up
to 32 characters but we are only allowing for 31.

ASTERISK-27498 #close
Reported by: Michele Prà

Change-Id: I05ce7a5952721a76a2b4c90366168022558dc7cf
2017-12-31 11:34:41 -05:00
George Joseph 283d2df680 res_pjsip_sdp_rtp: Add NULL check in add_crypto_to_stream
add_crypto_to_stream wasn't checking for a NULL
session->inv_session->neg before calling pjmedia_sdp_neg_get_state.
This was causing a crash if the negotiation hadn't already been
completed and asterisk was compiled with --enable-dev-mode.

Change-Id: I57c6229954a38145da9810fc18657bfcc4d9d0c9
2017-12-14 13:05:23 -07:00
Joshua Colp 4c535f5c30 core / pjsip: Add support for grouping streams together.
In WebRTC streams (or media tracks in their world) can be grouped
together using the mslabel. This informs the browser that each
should be synchronized with each other.

This change extends the stream API so this information can
be stored with streams. The PJSIP support has been extended
to use the mslabel to determine grouped streams and store
this association on the streams. Finally when creating the
SDP the group information is used to cause each media stream
to use the same mslabel.

ASTERISK-27379

Change-Id: Id6299aa031efe46254edbdc7973c534d54d641ad
2017-10-30 17:10:03 -05:00
George Joseph 6f0431798e res_pjsip_sdp_rtp: Fix setting of address type for rtp_ipv6
create_outgoing_sdp_stream was setting "addr_type = STR_IP6" only
when an ipv6 media_address was specified on the endpoint.  If
rtp_ipv6 was set and ast_sip_get_host_ip_string returned an ipv6
address, we were leaving the addr_type set at the default of
STR_IP4.  This caused the address type to be set incorrectly on the
"o" and "c" SDP attributes even though the address was set
correctly.  Some clients don't like the mismatch.

 * Removed the test for endpoint/media_address and now check all
   addresses for ipv6.

ASTERISK-27198
Reported by: Martin Cisárik

Change-Id: I5214fc31b728117842243807e7927a319cf77592
2017-10-23 12:36:16 -05:00
Joshua Colp f77a2367e7 Merge "bridge: Change participant SFU streams when source streams change." 2017-09-21 15:56:47 -05:00
Joshua Colp f2985e3106 bridge: Change participant SFU streams when source streams change.
Some endpoints do not like a stream being reused for a new
media stream. The frame/jitterbuffer can rely on underlying
attributes of the media stream in order to order the packets.
When a new stream takes its place without any notice the
buffer can get confused and the media ends up getting dropped.

This change uses the SSRC change to determine that a new source
is reusing an existing stream and then bridge_softmix renegotiates
each participant such that they see a new media stream. This
causes the frame/jitterbuffer to start fresh and work as expected.

ASTERISK-27277

Change-Id: I30ccbdba16ca073d7f31e0e59ab778c153afae07
2017-09-21 12:20:02 -05:00
Ben Ford e666051d79 res_pjsip_session: Check for removed stream state.
When a sip session is refreshed, the stream topology is looped
through, checking each stream for compatible formats. This would
cause a crash if the stream state was AST_STREAM_STATE_REMOVED,
since the formats would never be set for this stream, causing
a NULL value to be returned from ast_stream_get_formats. This
commit adds a check for streams with removed states.

Also removed a stray semicolon.

Change-Id: Ic86f8b65a4a26a60885b28b8b1a0b22e1b471d42
2017-09-20 12:14:45 -05:00
Walter Doekes 680aba21ec res/res_pjsip: Fix localnet checks in pjsip, part 2.
In 45744fc53, I mistakenly broke SDP media address rewriting by
misinterpreting which address was checked in the localnet comparison.

Instead of checking the remote peer address to decide whether we need
media address rewriting, we check our local media address: if it's
local, then we rewrite. This feels awkward, but works and even made
directmedia work properly if you set local_net. (For the record: for
local peers, the SDP media rewrite code is not called, so the
comparison does no harm there.)

ASTERISK-27248 #close

Change-Id: I566be1c33f4d0a689567d451ed46bab9c3861d4f
2017-09-10 06:19:28 -05:00
Walter Doekes f856d9b42b res/res_pjsip: Standardize/fix localnet checks across pjsip.
In 2dee95cc (ASTERISK-27024) and 776ffd77 (ASTERISK-26879) there was
confusion about whether the transport_state->localnet ACL has ALLOW or
DENY semantics.

For the record: the localnet has DENY semantics, meaning that "not in
the list" means ALLOW, and the local nets are in the list.

Therefore, checks like this look wrong, but are right:

    /* See if where we are sending this request is local or not, and if
       not that we can get a Contact URI to modify */
    if (ast_apply_ha(transport_state->localnet, &addr) != AST_SENSE_ALLOW) {
        ast_debug(5, "Request is being sent to local address, "
                     "skipping NAT manipulation\n");

(In the list == localnet == DENY == skip NAT manipulation.)

And conversely, other checks that looked right, were wrong.

This change adds two macro's to reduce the confusion and uses those
instead:

    ast_sip_transport_is_nonlocal(transport_state, addr)
    ast_sip_transport_is_local(transport_state, addr)

ASTERISK-27248 #close

Change-Id: Ie7767519eb5a822c4848e531a53c0fd054fae934
2017-09-05 09:17:32 -05:00
Torrey Searle a2dde59154 res_rtp_asterisk: Make P2P bridge Asymmetric codec aware
Introduce a new property to rtp-engine to make it aware of
the desire for assymetric codecs or not.  If asymmetric codecs
is not allowed, the bridge will compare read/write formats
and shut down the p2p bridge if needed

ASTERISK-26745 #close

Change-Id: I0d9c83e5356df81661e58d40a8db565833501a6f
2017-08-09 08:57:50 -05:00
Kevin Harwell 104a8047a5 res_pjsip_session/_sdp_rtp: Handling of 'msid' is incorrect
Currently, the handling of the msid attribute is not quite right. According to
the spec the msid's between the offer/answer are not dependent upon one another.
Meaning the same msid's given in an offer do not have to be returned in the
answer for a given stream. And they probably shouldn't be (copied/reused) since
this can potentially cause some browser side confusion.

This patch generates new msids when both an offer and answer are sent from
Asterisk. However, Asterisk does reuse the original msid it sent out for a
reinvite. Also audio+video streams are paired together by sharing the same
stream id, but a different track id.

ASTERISK-27179 #close

Change-Id: Ifaec06dc7e65ad841633a24ebec8c8a9302d6643
2017-08-04 17:15:40 -05:00
Joshua Colp 2a4283f3e7 res_pjsip: Add support for dnsmgr to external_media_address.
The "external_media_address" option on transports is now
resolved using dnsmgr. This allows it to be automatically
refreshed regularly if refreshes are enabled in dnsmgr.
If the system is using a dynamic IP address a dynamic DNS
hostname can be provided to keep the IP address up to
date.

Change-Id: Ia54771720dff0105bde55d5bbb81a3ba437e05b2
2017-08-01 15:42:38 -06:00
Torrey Searle 65c560894d chan_pjsip: add a new function PJSIP_DTMF_MODE
This function is a replica of SIPDtmfMode, allowing the DTMF mode of a
PJSIP call to be modified on a per-call basis

ASTERISK-27085 #close

Change-Id: I20eef5da3e5d1d3e58b304416bc79683f87e7612
2017-08-01 15:41:53 -06:00
Kevin Harwell 7da6ddda30 res_pjsip: Add "webrtc" configuration option
This patch creates a new configuration option called "webrtc". When enabled it
defaults and enables the following options that are needed in order for webrtc
to work in Asterisk:

  rtcp-mux, use_avpf, ice_support, and use_received_transport=enabled
  media_encryption=dtls
  dtls_verify=fingerprint
  dtls_setup=actpass

When "webrtc" is enabled, this patch also parses the "msid" media level
attribute from an SDP. It will also appropriately add it onto the outgoing
session when applicable.

Lastly, when "webrtc" is enabled h264 RTCP FIR feedback frames are now sent.

ASTERISK-27119 #close

Change-Id: I5ec02e07c5d5b9ad86a34fdf31bf2f9da9aac6fd
2017-07-13 18:19:35 -05:00
Joshua Colp 065c3005ad res_rtp_asterisk / res_pjsip: Add support for BUNDLE.
BUNDLE is a specification used in WebRTC to allow multiple
streams to use the same underlying transport. This reduces
the number of ICE and DTLS negotiations that has to occur
to 1 normally.

This change implements this by adding support for it to
the RTP SDP module in PJSIP. BUNDLE can be turned on using
the "bundle" option and on an offer we will offer to
bundle streams together. On an answer we will accept any
bundle groups provided. Once accepted each stream is bundled
to another RTP instance for transport.

For the res_rtp_asterisk changes the ability to bundle
an RTP instance to another based on the SSRC received
from the remote side has been added. For outgoing traffic
if an RTP instance is bundled to another we will use the
other RTP instance for any transport related things. For
incoming traffic received from the transport instance we
look up the correct instance based on the SSRC and use it
for any non-transport related data.

ASTERISK-27118

Change-Id: I96c0920b9f9aca7382256484765a239017973c11
2017-07-13 14:47:50 +00:00
Torrey Searle fb7247c57c res_pjsip: Add DTMF INFO Failback mode
The existing auto dtmf mode reverts to inband if 4733 fails to be
negotiated.  This patch adds a new mode auto_info which will
switch to INFO instead of inband if 4733 is not available.

ASTERISK-27066 #close

Change-Id: Id185b11e84afd9191a2f269e8443019047765e91
2017-06-29 07:57:01 -06:00
Mark Michelson 45df25a579 chan_pjsip: Add support for multiple streams of the same type.
The stream topology (list of streams and order) is now stored with the
configured PJSIP endpoints and used during the negotiation process.

Media negotiation state information has been changed to be stored
in a separate object. Two of these objects exist at any one time
on a session. The active media state information is what was previously
negotiated and the pending media state information is what the
media state will become if negotiation succeeds. Streams and other
state information is stored in this object using the index (or
position) of each individual stream for easy lookup.

The ability for a media type handler to specify a callback for
writing has been added as well as the ability to add file
descriptors with a callback which is invoked when data is available
to be read on them. This allows media logic to live outside of
the chan_pjsip module.

Direct media has been changed so that only the first audio and
video stream are directly connected. In the future once the RTP
engine glue API has been updated to know about streams each individual
stream can be directly connected as appropriate.

Media negotiation itself will currently answer all the provided streams
on an offer within configured limits and on an offer will use the
topology created as a result of the disallow/allow codec lines.

If a stream has been removed or declined we will now mark it as such
within the resulting SDP.

Applications can now also request that the stream topology change.
If we are told to do so we will limit any provided formats to the ones
configured on the endpoint and send a re-invite with the new topology.

Two new configuration options have also been added to PJSIP endpoints:

max_audio_streams: determines the maximum number of audio streams to
offer/accept from an endpoint. Defaults to 1.

max_video_streams: determines the maximum number of video streams to
offer/accept from an endpoint. Defaults to 1.

ASTERISK-27076

Change-Id: I8afd8dd2eb538806a39b887af0abd046266e14c7
2017-06-28 18:36:29 +00:00
Joshua Colp d3e951edf5 pjsip: Extend 'asymmetric_rtp_codec' option to include us changing.
PJSIP support in Asterisk differs from chan_sip in that it
allows media to be sent as-is without transcoding provided
the codecs were negotiated in the SDP. This is allowed
according to the RFC. Support for this differs quite a lot
though and some endpoints do not handle it well.

This change extends the 'asymmetric_rtp_codec' option to
also cover this case. When set to no (the default) the code
behaves as chan_sip does - the best codec is selected and
we will only ever send that, unless we change what we are
sending if the remote side changes. When set to yes we
will send media as-is without transcoding if the codec
has been negotiated in the SDP.

ASTERISK-26996

Change-Id: Ib1647f6902a0843e8c435946f831c2159e8d1d51
2017-06-07 13:34:58 +00:00
Jenkins2 e478d2eb94 Merge "res_pjsip_sdp_rtp: No rtpmap for static RTP payload IDs in SDP." 2017-04-26 10:44:00 -05:00
Alexander Traud 72c5f3b0ba res_pjsip_sdp_rtp: No rtpmap for static RTP payload IDs in SDP.
This saves around 100 bytes when G.711, G.722, G.729, and GSM are advertised in
SDP. This reduces the chance to hit the MTU bearer of 1300 bytes for SIP over
UDP, if many codecs are allowed in Asterisk. This new feature is enabled
together with the optional feature compact_headers=yes via the file pjsip.conf.

ASTERISK-26932 #close

Change-Id: Iaa556ab4c8325cd34c334387ab2847fab07b1689
2017-04-13 11:05:25 +02:00
George Joseph 747beb1ed1 modules: change module LOAD_FAILUREs to LOAD_DECLINES
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed
to AST_MODULE_LOAD_DECLINE.  This prevents asterisk from exiting
if a module can't be loaded.  If the user wishes to retain the
FAILURE behavior for a specific module, they can use the "require"
or "preload-require" keyword in modules.conf.

A new API was added to logger: ast_is_logger_initialized().  This
allows asterisk.c/check_init() to print to the error log once the
logger subsystem is ready instead of just to stdout.  If something
does fail before the logger is initialized, we now print to stderr
instead of stdout.

Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-04-12 15:57:21 -06:00
Richard Mudgett 6f793ac149 res_pjsip_sdp_rtp.c: Don't use deprecated transport struct member.
* create_rtp(): Eliminate use of deprecated transport struct member.  That
member and several others in the transport structure were deprecated
because of an infinite loop created when using realtime configuration.
See 2451d4e455

ASTERISK-26851

Change-Id: I0533aa13c9ce3c6cc394e0fd2b5bf1cd1b2ef3bc
2017-04-11 12:58:35 -05:00
Richard Mudgett f2ee8ac21e res_pjsip_sdp_rtp.c: Don't alter global addr variable.
* create_rtp(): Fix unexpected alteration of global address_rtp if a
transport is bound to an address.

* create_rtp(): Fix use of uninitialized memory if the endpoint RTP media
address is invalid or the transport has an invalid address.

ASTERISK-26851

Change-Id: Icde42e65164a88913cb5c2601b285eebcff397b7
2017-04-04 13:38:07 -05:00
Richard Mudgett 3d8899bacf Add DTLS sanity check.
Change-Id: Ib32612cf6c7ce9213a11b9cba82f630f8cd3564b
2017-03-27 15:43:03 -06:00
Sean Bright d08c69a9e2 res_pjsip_sdp_rtp: Set hangup cause for RTP timeouts
chan_sip sets the hangup cause code to AST_CAUSE_REQUESTED_CHAN_UNAVAIL
(44) when a channel is hung up due to an RTP timeout. So do the same
when it happens with PJSIP for parity.

Change-Id: I3546ebbde6460c22a27c9da1bf321711b5961ab8
2017-03-24 10:31:39 -06:00
Joshua Colp f5603cb1ec Merge "res/res_pjsip_session: Only check localnet if it is defined" 2017-03-20 14:39:20 -05:00
Joshua Colp 7f87cd7b4e Merge "res_pjsip_sdp_rtp.c: Fix cut-n-paste error" 2017-03-17 14:45:05 -05:00
Richard Mudgett 49b1f1ca16 res_pjsip_sdp_rtp.c: Fix cut-n-paste error
We were inadvertenly referencing the cos_video option to determine if we
should set the tos_audio and cos_audio value on the RTP instance.

Change-Id: Ia7964f486801d39dc6f5dae570baff079e1595b0
2017-03-16 14:49:24 -06:00
Matt Jordan e6dc28b78f res/res_pjsip_session: Only check localnet if it is defined
If local_net is not defined on a transport, transport_state->localnet
will be NULL. ast_apply_ha will, be default, return AST_SENSE_ALLOW in
this case, causing the external_media_address, if set, to be skipped.

This patch causes us to only check if we are sending within a network if
local_net is defined.

ASTERISK-26879 #close

Change-Id: Ib661c31a954cabc9c99f1f25c9c9a5c5b82cbbfb
2017-03-16 14:03:43 -06:00
Richard Begg 44568fc712 res_pjsip_sdp_rtp: RTP instance does not use same IP as explicit transport
Currently a wildcard address is used for the local RTP socket, which
will not always result in the same address as used by the SIP socket
(e.g. if explicit transport addresses are configured).
Use the transport's host address when binding new local RTP sockets if
available.

ASTERISK-26851

Change-Id: I098c29c9d1f79a4f970d72ba894874ac75954f1a
2017-03-16 13:14:58 -06:00