Commit Graph

29777 Commits

Author SHA1 Message Date
George Joseph 9b3f6d26bd res_pjsip_t38: Make t38_reinvite_response_cb tolerant of NULL channel
t38_reinvite_response_cb can get called by res_pjsip_session's
session_inv_on_tsx_state_changed in situations where session->channel
is NULL.  If it is, the ast_log warning segfaults because it tries
to get the channel name from a NULL channel.

* Check session->channel and print "unknown channel" when it's NULL.

ASTERISK-27236
Reported by: Ross Beer

Change-Id: I4326e288d36327f6c79ab52226d54905cdc87dc7
2017-09-05 05:57:59 -05:00
Jenkins2 991750d3f1 Merge "chan_pjsip: Add tag info in CHANNEL function" 2017-08-31 17:33:05 -05:00
Joshua Colp be8639f81b Merge "res_rtp_asterisk: Allow remote SSRC to change on an RTP instance." 2017-08-31 16:50:50 -05:00
Joshua Colp 8cfff60cee Merge "res_rtp_asterisk: Only learn a new source in learn state." 2017-08-31 08:34:48 -05:00
Jenkins2 41ab281f1a Merge "pjsip_message_ip_updater: Fix issue handling "tel" URIs" 2017-08-31 08:30:17 -05:00
George Joseph f78f5278ff pjsip_message_ip_updater: Fix issue handling "tel" URIs
sanitize_tdata was assuming all URIs were SIP URIs so when a non
SIP uri was in the From, To or Contact headers, the unconditional
cast of a non-pjsip_sip_uri structure to pjsip_sip_uri caused
a segfault when trying to access uri->other_param.

* Added PJSIP_URI_SCHEME_IS_SIP(uri) || PJSIP_URI_SCHEME_IS_SIPS(uri)
  checks before attempting to cast or use the returned uri.

ASTERISK-27152
Reported-by: Ross Beer

Change-Id: Id380df790e6622c8058a96035f8b8f4aa0b8551f
2017-08-30 18:46:05 +00:00
Corey Farrell 1bf3dfffd7 AST-2017-006: Fix app_minivm application MinivmNotify command injection
An admin can configure app_minivm with an externnotify program to be run
when a voicemail is received.  The app_minivm application MinivmNotify
uses ast_safe_system() for this purpose which is vulnerable to command
injection since the Caller-ID name and number values given to externnotify
can come from an external untrusted source.

* Add ast_safe_execvp() function.  This gives modules the ability to run
external commands with greater safety compared to ast_safe_system().
Specifically when some parameters are filled by untrusted sources the new
function does not allow malicious input to break argument encoding.  This
may be of particular concern where CALLERID(name) or CALLERID(num) may be
used as a parameter to a script run by ast_safe_system() which could
potentially allow arbitrary command execution.

* Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp()
instead of ast_safe_system() to avoid command injection.

* Document code injection potential from untrusted data sources for other
shell commands that are under user control.

ASTERISK-27103

Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
2017-08-30 18:43:38 +00:00
Joshua Colp 7f2a60fb38 res_rtp_asterisk: Only learn a new source in learn state.
This change moves the logic which learns a new source address
for RTP so it only occurs in the learning state. The learning
state is entered on initial allocation of RTP or if we are
told that the remote address for the media has changed. While
in the learning state if we continue to receive media from
the original source we restart the learning process. It is
only once we receive a sufficient number of RTP packets from
the new source that we will switch to it. Once this is done
the closed state is entered where all packets that do not
originate from the expected source are dropped.

The learning process has also been improved to take into
account the time between received packets so a flood of them
while in the learning state does not cause media to be switched.

Finally RTCP now drops packets which are not for the learned
SSRC if strict RTP is enabled.

ASTERISK-27013

Change-Id: I56a96e993700906355e79bc880ad9d4ad3ab129c
2017-08-30 18:39:26 +00:00
Joshua Colp 5ba82cedc6 res_rtp_asterisk: Allow remote SSRC to change on an RTP instance.
When SDP renegotiation occurs it is possible for an RTP
instance to be reused for a new stream, resulting in the remote
SSRC changing if it is part of a bundle group. This change
allows this and updates its mapping in the current bundle
group.

ASTERISK-27231

Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490
2017-08-30 09:18:56 -05:00
Jenkins2 36c1513148 Merge "bridge_native_rtp.c: Fixup native_rtp_framehook()" 2017-08-30 08:58:35 -05:00
Andre Nazario 71be8d5bbe chan_pjsip: Add tag info in CHANNEL function
Create local_tag and remote_tag in CHANNEL info to get tag from From and
To headers of a SIP dialog.

ASTERISK-27220

Change-Id: I59b16c4b928896fcbde02ad88f0e98922b15d524
2017-08-30 07:52:24 -05:00
Richard Mudgett 4650fc477a bridge_native_rtp.c: Fixup native_rtp_framehook()
* Fix framehook to test frame type for control frame.
* Made framehook exit early if frame type is not a control frame.
* Eliminated RAII_VAR in framehook.
* Use switch instead of else-if ladder for control frame handling.

Change-Id: Ia555fc3600bd85470e3c0141147dbe3ad07c1d18
2017-08-29 14:37:30 -05:00
Sean Bright 06cc5ae9ff confbridge: Handle user hangup during name recording
This prevents orphaned CBAnn channels from getting stuck in the bridge.

ASTERISK-26994 #close
Reported by: James Terhune

Change-Id: I5e43e832a9507ec3f2c59752cd900b41dab80457
2017-08-29 09:28:11 -05:00
Jenkins2 c4a006613c Merge "core: Reduce video update queueing." 2017-08-29 06:13:09 -05:00
Jenkins2 f47733cea0 Merge "app_record: Resolve some absolute vs. relative filename bugs" 2017-08-29 05:57:07 -05:00
Jenkins2 92b1086488 Merge "voicemail: Fix various abuses of mkstemp" 2017-08-29 05:17:21 -05:00
Joshua Colp 9a9589e8e1 core: Reduce video update queueing.
A video update frame is used to indicate that a channel
with video negotiated should provide a full frame so the
decoder decoding the stream is able to do so. In situations
where a queue is used to store frames it makes no sense
for the queue to contain multiple video update frames. One
is sufficient to have a full frame be sent.

ASTERISK-27222

Change-Id: Id3f40a6f51b740ae4704003a1800185c0c658ee7
2017-08-28 11:12:50 -05:00
Joshua Colp 9d0c3564ee Merge "res/res_pjsip_session: allow SDP answer to be regenerated" 2017-08-28 07:34:47 -05:00
Jenkins2 e31d4ddaf1 Merge "alembic: Add dtls_fingerprint column in ps_endpoints table" 2017-08-28 06:47:40 -05:00
Sean Bright da13cdb9e7 voicemail: Fix various abuses of mkstemp
mkstemp() returns a unique filename, but appending an extension to that
filename does not guarantee uniqueness. Instead, use mkdtemp() and we
can put whatever extension we want on the files that we create inside
the directory.

In the case of app_minivm, we also now properly clean up any temporary
files that we create.

ASTERISK-20858 #close
Reported by: Walter Doekes

Change-Id: I30ad04f0e115f0b11693ff678ba5184d8b938e43
2017-08-25 16:08:55 -05:00
Sean Bright 43670e471f app_record: Resolve some absolute vs. relative filename bugs
If the Record() application is called with a relative filename that
includes directories, we were not properly creating the intermediate
directories and Record() would fail.

Secondarily, updated the documentation for RECORDED_FILE to mention
that it does not include a filename extension.

Finally, rewrote the '%d' functionality to be a bit more straight
forward and less noisy.

ASTERISK-16777 #close
Reported by: klaus3000

Change-Id: Ibc2640cba3a8c7f17d97b02f76b7608b1e7ffde2
2017-08-25 12:27:12 -05:00
Jenkins2 179524c255 Merge "app_queue: Evaluate realtime queues when running dialplan functions" 2017-08-25 09:32:28 -05:00
Joshua Colp a6a3737519 Merge "chan_pjsip.c: Fix topology refresh response code accuracy." 2017-08-25 08:32:43 -05:00
Joshua Colp 7c9ab297df Merge "app_voicemail: Honor escape digits in "greeting only" mode" 2017-08-25 08:28:11 -05:00
Florian Floimair 2ee644aacf alembic: Add dtls_fingerprint column in ps_endpoints table
The ps_endpoints table was missing the dtls_fingerprint column
introduced with commit adba2a8d7f.

ASTERISK-27168 #close

Change-Id: I9cb5006f7f50718b5239919562773adabb334cfd
2017-08-25 08:11:04 -05:00
Torrey Searle 33a648d4c6 res/res_pjsip_session: allow SDP answer to be regenerated
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
2017-08-25 14:27:24 +02:00
Sean Bright 02f95d290f app_queue: Evaluate realtime queues when running dialplan functions
ASTERISK-19103 #close
Reported by: Jim Van Meggelen

Change-Id: I4bd32a9d1fcebb8ac56bff0e084d4f53e31b692b
2017-08-24 09:44:27 -05:00
Sean Bright b1097be134 app_voicemail: Honor escape digits in "greeting only" mode
ASTERISK-21241 #close
Reported by: Eelco Brolman
Patches:
	Patch uploaded by Eelco Brolman (License 6442)

Change-Id: Icbe39b5c82a49b46cf1d168dc17766f3d84f54fe
2017-08-24 09:04:13 -05:00
Sean Bright 7937d5b8b3 res_smdi: Clean up memory leak
Change-Id: I1e33290929e1aa7c5b9cb513f8254f2884974de8
2017-08-24 08:39:50 -05:00
Joshua Colp 5570cf22fa Merge "res_pjsip_session.c: Fix crash when declining an active stream." 2017-08-23 14:49:26 -05:00
Jenkins2 a1e9ec40df Merge changes from topic 'ASTERISK-27212'
* changes:
  bridge_channel.c: Fix FRACK when mapping frames to the bridge.
  bridge: Fix softmix bridge deadlock.
2017-08-23 14:45:52 -05:00
Jenkins2 9e79976212 Merge "channel: Fix topology API locking." 2017-08-23 14:17:11 -05:00
Joshua Colp c7edd0b493 Merge "app_confbridge: Document sfu video_mode value." 2017-08-23 13:05:35 -05:00
Jenkins2 0a44f61a5c Merge "bridge_softmix.c: Restored softmix_bridge_leave() shortcut exit." 2017-08-23 12:21:47 -05:00
Jenkins2 e8cf4ab833 Merge "confbridge.h: Fix doxygen comments." 2017-08-23 12:05:29 -05:00
Jenkins2 1e579b1185 Merge "bridge_softmix.c: Remove always true test." 2017-08-23 11:55:01 -05:00
Jenkins2 aad6fa6dc7 Merge "app_queue: Fix initial hold time queue statistic" 2017-08-23 11:11:38 -05:00
Richard Mudgett f2c14f00b8 res_pjsip_session.c: Fix crash when declining an active stream.
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
2017-08-22 11:59:49 -05:00
Richard Mudgett 17976d1b4e bridge_channel.c: Fix FRACK when mapping frames to the bridge.
* Add protection checks when mapping streams to the bridge.  The channel
and bridge may be in the process of updating the stream mapping when a
media frame comes in so we may not be able to map the frame at the time.

* We need to map the streams to the bridge's stream numbers right before
they are written into the bridge.  That way we don't have to keep
locking/unlocking the bridge and we won't have any synchronization
problems before the frames actually go into the bridge.

* Protect the deferred queue with the bridge_channel lock.

ASTERISK-27212

Change-Id: Id6860dd61b594b90c8395f6e2c0150219094c21a
2017-08-22 11:59:49 -05:00
Richard Mudgett 9c70c88369 channel: Fix topology API locking.
* ast_channel_request_stream_topology_change() must not be called with any
channel locks held.

* ast_channel_stream_topology_changed() must be called with only the
passed channel lock held.

ASTERISK-27212

Change-Id: I843de7956d9f1cc7cc02025aea3463d8fe19c691
2017-08-22 11:59:49 -05:00
Richard Mudgett 6ad8249233 bridge: Fix softmix bridge deadlock.
* Fix deadlock in
bridge_softmix.c:softmix_bridge_stream_topology_changed() between
bridge_channel and channel locks.

* The new bridge technology topology change callbacks must be called with
the bridge locked.  The callback references the bridge channel list, the
bridge technology could change, and the bridge stream mapping is updated.

ASTERISK-27212

Change-Id: Ide4360ab853607e738ad471721af3f561ddd83be
2017-08-22 11:59:49 -05:00
Richard Mudgett 850a3fd017 chan_pjsip.c: Fix topology refresh response code accuracy.
There are other 1xx and 2xx codes than 100 and 200 respectively.

Change-Id: I680db0997343256add1478714f5bf5b5569aee17
2017-08-22 11:33:25 -05:00
Richard Mudgett 87c7a1c79c bridge_softmix.c: Restored softmix_bridge_leave() shortcut exit.
Change-Id: I13026cd90954e0265eab94a0faf635a3e11f0e35
2017-08-22 11:26:09 -05:00
Richard Mudgett 5bbf7b2aad app_confbridge: Document sfu video_mode value.
Change-Id: I26e17df2c93f3933b23f78070603adbcc84ba204
2017-08-22 11:23:45 -05:00
Richard Mudgett f96536b1ea confbridge.h: Fix doxygen comments.
Change-Id: I16133166a85fdb557c66ffcbfe8128d0b4725b0e
2017-08-22 11:21:13 -05:00
Richard Mudgett 946ef2d711 bridge_softmix.c: Remove always true test.
Change-Id: I26238df2ff0d0f6dfe95c3aa35da588f1ee71727
2017-08-22 11:11:26 -05:00
Jenkins2 c86619bab8 Merge "res_xmpp: fix inverted return code check in OAuth" 2017-08-22 07:57:39 -05:00
Sungtae Kim 22af5e3784 app_queue: Fix initial hold time queue statistic
Fixed to use correct initial value and fixed to use the
correct queue info to check the first value.

ASTERISK-27204

Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73
2017-08-22 07:36:25 -05:00
Joshua Colp e6611528a3 Merge "res_calendar_icalendar: Properly handle recurring events" 2017-08-22 05:11:51 -05:00
Michael Kuron 83b81d1f8d res_xmpp: fix inverted return code check in OAuth
fetch_access_token calls func_curl via ast_func_read. The latter returns 0 upon
success and -1 if the function is not available.
This commit inverts the return code check so that an error is printed if the
module is not loaded and not if it is loaded.

ASTERISK-27207 #close

Change-Id: I9ef903f80702d1218e8701f65a4e5e918e6548fb
2017-08-22 00:36:07 -05:00