Age | Commit message (Collapse) | Author |
|
|
|
ast_stream_topology_set_stream." into 15
|
|
A previous commit made it so when an invite session transitioned into a
disconnected state destruction of the Asterisk pjsip session object was
postponed until either a transport error occurred or the event timer
expired. However, if a call was rejected (for instance a 488) before the
session was fully established the event timer may not have been initiated,
or it was canceled without triggering either of the session finalizing states
mentioned above.
Really the only time destruction of the session should be delayed is when a
BYE is being transacted. This is because it's possible in some cases for the
session to be disconnected, but the BYE is still transacting.
This patch makes it so the session object always gets released (no more
memory leak) when the pjsip session is in a disconnected state. Except when
the method is a BYE. Then it waits until a transport error occurs or an event
timeout.
ASTERISK-27345 #close
Reported by: Corey Farrell
Change-Id: I1e724737b758c20ac76d19d3611e3d2876ae10ed
|
|
* Pre-initialize cloned media state vectors to final size to ensure
vector errors cannot happen later in the clone initialization.
* Release session_media on vector replace failure in
ast_sip_session_media_state_add.
* Release clone and media_state in ast_sip_session_refresh if we fail to
append to the stream topology, return an error.
Change-Id: Ib5ffc9b198683fa7e9bf166d74d30c1334c23acb
|
|
Free memory and return error if ast_stream_topology_set_stream fails.
Change-Id: I9f4dbf44bed627243d2f1dd8aea2eab6c38a028d
|
|
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
|
|
PJSIP allows a domain name as external_media_address. This allows chan_pjsip to
be used behind a NAT with changing IP addresses. The IP address of that domain
is resolved to the c= line already. This change sets also the o= line to that
domain.
ASTERISK-27341 #close
Change-Id: I690163b6e762042ec38b3995aa5c9bea909d8ec4
|
|
Move ast_sip_add_usereqphone to be called after anonymization of URIs,
to prevent the user_eq_phone adding "user=phone" to URIs containing a
username that is not a phonenumber (RFC3261 19.1.1). An extra call to
ast_sip_add_usereqphone on the saved version before anonymization is
added to add user=phone" to the PAI.
ASTERISK-27047 #close
Change-Id: Ie5644bc66341b86dc08b1f7442210de2e6acdec6
|
|
|
|
ASTERISK-27306
Change-Id: I2c8d3fc148f9f53715c958314e1146f9611741f3
|
|
res_pjsip and res_pjsip_session had circular references, preventing both
modules from shutting down.
* Move session supplement registration to res_pjsip.
* Use create internal functions for use by pjsip_message_filter.c.
ASTERISK-27306
Change-Id: Ifbd5c19ec848010111afeab2436f9699da06ba6b
|
|
into 15
|
|
|
|
For some scenarios when an outgoing call was made only a subset of the
configured codecs were offered. If the codecs being offered happened to
not have a codec supported by the phone then the call would fail.
For instance Alice and Bob both are configured in Asterisk for g722 and ulaw(
allow=!all,g722,ulaw). Alice's endpoint however only supports g722 while Bob's
only supports ulaw. When Alice calls Bob, Alice negotiates g722 fine with
Asterisk. But when Asterisk sends the outgoing offer to Bob it only contains
g722 and not both g722 and ulaw, so the call ends.
This patch makes it so all the audio codecs configured on the endpoint always
get sent, and not just a subset. However priority is given to those codecs that
are compatible with the "other side".
ASTERISK-27259 #close
Change-Id: Iffabc373bd94cd1dc700925dcfe406e12918c696
|
|
reinvite" into 15
|
|
|
|
When pruning a request to change the topology of a channel be
more intelligent about the resulting topology that is actually
used for SDP renegotiation.
In a case where a stream has not already been negotiated we
don't need to renegotiate and offer a declined stream. This can
occur if something in Asterisk (such as ConfBridge) requests
to add video to a PJSIP channel that has no video codecs configured.
In this case since the stream did not already exist we can safely
remove the stream from the requested topology, resulting in no
renegotiation occurring.
In a case where a renegotiation is requested with a codec that is
not supported we can reuse the formats of the existing stream if
it exists to ensure that the stream continues to flow, instead of
removing it.
Change-Id: I636540798d55922377318fe619c510fb6ed125fb
|
|
During a reinvite, if a remote endpoint error occurs and it returns a 500 the
session would end. This patch makes it so the session is not terminated, but
continues as it was.
The reason for this is because some endpoints may send non session terminating
"server errors" like a failed codec negotiation. So in this case instead of
ending the call it can hopefully continue. In the case of a real server error
the session is already "doomed", will be known soon enough and appropriately
ended by Asterisk later.
Change-Id: Ifeedae86b8cb44b92d52c79046522ec5f0aff1d5
|
|
|
|
into 15
|
|
Change-Id: If3ab0d73d79ac4623308bd48508af2bfd554937d
|
|
When an INVITE came in with both audio and video streams but there
were no audio codecs defined for the endpoint, we weren't declining
the audio stream. Since it's usually the first/transport stream,
when the video stream was processed and tried to use the transport,
it was empty and caused a crash. We now decline the the stream if
there are no matching codecs so when the video stream is processed,
it's now the first/transport stream and processes normally.
Change-Id: Ic854eda54c95031e66b076ecfae3041d34daa692
|
|
into 15
|
|
|
|
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
|
|
There was an issue reported where an SDP received on a 183 Session
Progress message caused a crash because the pending streams had
already been processed when the OK was received. In that case the
pending topology was legitimately NULL. There was an assert for an
incorrect number of streams in the topology but not one for
topology being NULL. In any case, if you're not in dev-mode the
asserts don't do anything and since the scenario is legit, the
asserts weren't appropriate anyway.
* Changed several asserts to warning or debug messages and return
codes as appropriate.
ASTERISK-27264
Reported by: Daniel Heckl
Change-Id: I58daaa9d2938fa980857ab3ec41925ab5ff9c848
|
|
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
|
|
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
|
|
|
|
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
|
|
Stream names within Asterisk can have meaning so when an externally
initiated renegotiation occurs we need to preserve the name of
the stream if it already exists.
Change-Id: I29f50d0cc7f3238287d6d647777e76e1bdf8c596
|
|
If an SDP answer hasn't been sent yet, it's legal to change it.
This is required for PJSIP_DTMF_MODE to work correctly, and can
also have use in the future for updating codecs too.
ASTERISK-27209 #close
Change-Id: Idbbfb7cb3f72fbd96c94d10d93540f69bd51e7a1
|
|
If a previously active stream is declined we could crash because the
channel's thread is still using the stream while we are updating the
topology in the serializer thread.
* Defer removing any declined stream's handler until we have blocked the
channel's thread with the channel lock.
ASTERISK-27212
Change-Id: I50e1d3ef26f8e41948f4c411ee329aa3b960a420
|
|
|
|
A change was made long ago where the session was kept around
until the underlying INVITE session had been destroyed. This
had the side effect of also keeping the underlying media resources
around for this time as well.
This change ensures that when we are told to terminate the
session we immediately release any media sessions associated
with it.
ASTERISK-27110
Change-Id: I643e431d5c3bf05cda220c1d39e824a505a29b82
|
|
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
|
|
This reverts commit 6c374d863c420d2519a52fffba3de5f935a30cdb.
Change-Id: Ia89836005df66ef540885afd6f171886de0db442
|
|
A change was made long ago where the session was kept around
until the underlying INVITE session had been destroyed. This
had the side effect of also keeping the underlying media resources
around for this time as well.
This change ensures that when we know the session is ending we
release the media resources immediately.
ASTERISK-27110
Change-Id: I3c6a82fe7d2c50b9dc9197cb12ef22f20d337501
|
|
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
|
|
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
|
|
This change does a few things to improve packet loss and renegotiation:
1. On outgoing RTP streams we will now properly reflect out of order
packets and packet loss in the sequence number. This allows the
remote jitterbuffer to better reorder things.
2. Video updates can now be discarded for a period of time
after one has been sent to prevent flooding of clients.
3. For declined and removed streams we will now release any
media session resources associated with them. This was not
previously done and caused an issue where old state was being
used for a new stream.
4. RTP bundling was not actually removing bundled RTP instances
from the parent. This has been resolved by removing based on
the RTP instance itself and not the SSRC.
5. The code did not properly handle explicitly unbundling an
RTP instance from its parent. This now works as expected.
ASTERISK-27143
Change-Id: Ibd91362f0e4990b6129638e712bc8adf0899fd45
|
|
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
|
|
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
|
|
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
|
|
|
|
There was a typo introduced in commit 776ffd77 which was preventing
the transport's external media address from being used.
ASTERISK-27024 #close
Reported-by: Christopher van de Sande
patches:
patch.diff submitted by Florian Floimair (license 6892)
Change-Id: I7ec617171eaa2d86d2680b00cf37d5088adafc27
|
|
When doing an attended transfer it's possible for the transferer, after
receiving an accepted response from Asterisk, to send a BYE to Asterisk,
which can then be processed before Asterisk has time to start and/or
complete the transfer process. This of course causes the transfer to not
complete successfully, thus dropping the call.
This patch makes it so any BYEs received from the transferer, after the REFER,
that initiate a session end are deferred until the transfer is complete. This
allows the channel that would have otherwise been hung up by Asterisk to
remain available throughout the transfer process.
ASTERISK-27053 #close
Change-Id: I43586db79079457d92d71f1fd993be9a3b409d5a
|
|
This introduces the ability for PJSIP code to specify filtering flags
when retrieving PJSIP contacts. The first flag for use causes the
query code to only retrieve contacts that are not unreachable. This
change has been leveraged by both the Dial() process and the
PJSIP_DIAL_CONTACTS dialplan function so they will now only attempt
calls to contacts which are not unreachable.
ASTERISK-26281
Change-Id: I8233b4faa21ba3db114f5a42e946e4b191446f6c
|
|
|
|
Retransmissions of an initial INVITE could be queued in the serializer
before we have processed the first INVITE message. If the first INVITE
message doesn't get completely processed before the retransmissions are
seen then we could try to setup the same call from the retransmissions. A
symptom of this is seeing a (key exists) message associated with an
INVITE. An earlier change attempted to address this kind of problem by
calculating a distributor serializer to use for unassociated messages.
Part of that change also made incoming calls keep using that distributor
serializer. (ASTERISK-26088) However, some leftover code was still
deferring the INVITE processing to the session's serializer even though we
were already in that serializer. This not only is unnecessary but would
cause the same call resetup problem.
* Removed the code to defer processing the initial INVITE to the session's
serializer because we are already running in that serializer.
ASTERISK-26998 #close
Change-Id: I1e822d82dcc650e508bc2d40d545d5de4f3421f6
|