Commit Graph

29545 Commits

Author SHA1 Message Date
Jenkins2 c247625012 Merge "chan_sip: Better ICE handling for RTCP-MUX" 2017-05-24 11:41:02 -05:00
Jenkins2 cd0e6a2324 Merge "res_rtp_asterisk: rtcp mux using the wrong srtp unprotecting algorithm" 2017-05-24 11:25:58 -05:00
Jenkins2 2200009099 Merge "res_format_attr_h26x: Trim blanks in fmtp attributes" 2017-05-24 11:02:24 -05:00
Sean Bright d847fe6585 res_agi: Allow configuration of audio format of EAGI pipe
This change allows the format of the EAGI audio pipe to be changed by
setting the dialplan variable 'EAGI_AUDIO_FORMAT' to the name of one of
the loaded formats.

ASTERISK-26124 #close

Change-Id: I7a10fad401ad2a21c68c2e7246fa357d5cee5bbd
2017-05-23 16:51:19 -04:00
Sean Bright e2e6baa8d8 res_agi: Clarify 'RECORD FILE' documentation
Documented the 'beep' option in both the parameters list and the command
description.

ASTERISK-23839 #close

Change-Id: I4970395c922dbdce3f7cf0f56d5b065ec9aa53ea
2017-05-23 13:35:26 -05:00
Sean Bright 3dcb3c88aa res_agi: Prevent crash when SET VARIABLE called without arguments
Explicitly check that the appropriate number of arguments were passed to
SET VARIABLE before attempting to reference them. Also initialize the
arguments array to zeroes before populating it.

ASTERISK-22432 #close

Change-Id: I5143607d80a2724f749c1674f3126b04ed32ea97
2017-05-23 13:08:44 -05:00
Sean Bright e490aa3176 res_agi: Fix malformed AGI usage response
If the generated XML documentation for a command does not end with a \n,
the postamble of the usage message does not appear on its own line.

ASTERISK-25662 #close

Change-Id: If190f1e9e37fe215fed95897d78d4a6e142b0020
2017-05-23 12:37:28 -05:00
Sean Bright 8ae0227cf3 res_format_attr_h26x: Trim blanks in fmtp attributes
Some devices separate format attributes with a semicolon followed by a
space, so trim blanks before trying to match them.

ASTERISK-27008 #close

Change-Id: Ia44cb2e4fef5c73dc541a29da79cb0e19c22d9cc
2017-05-23 10:57:57 -05:00
Joshua Colp faab058014 app_queue: Fix members showing as being in call when not.
A change was done which added an 'in_call' flag to queue
members that was set to true while talking to an agent.
Unfortunately in practice this does not accurately reflect
whether they are talking to an agent or not. If a Local
channel is involved and a transfer is performed then the
app_queue application would incorrectly think the agent
was still in a call with the caller. This was done to
fix a race condition between an agent becoming available
by device state and the checking of the last call information
for the wrapup time. There was a small window where the
last call information would be the previous value instead
of the new one.

This change goes about fixing the original issue in a
different way by considering the call completed if device
state is received which would make the agent available
and if they are currently in a call. If this occurs the
last call information is updated before the agent becomes
available ensuring that old information is not present
when checking if the member should be called. This also
improves the transfer situation by actually updating
and enforcing the wrapup time.

ASTERISK-26399
ASTERISK-26400
ASTERISK-26715
ASTERISK-26975

Change-Id: Ife1cb686e3173b3a6d368601adef9aff69d4beea
2017-05-23 09:24:22 -05:00
Joshua Colp dece2eb892 Merge "res_pjsip_session : fixed wrong From Header number On Re-invite" 2017-05-23 09:17:13 -05:00
Robert Mordec 36e90952ec app_confbridge: Race between removing and playing name recording while leaving
When user leaves a conference, its channel calls async_play_sound_file()
in order to play the name announcement and then unlinks the sound file.
The async_play_sound_file() function adds a task to conference playback queue,
which then runs playback_common() function in a different thread.

It leads to a race condition when, in some cases, channel thread may unlink
the sound file before playback_common() had a chance to open it.

This patch creates a file deletion task, that is queued after playback.

ASTERISK-27012 #close

Change-Id: I412f7922d412004b80917d4e892546c15bd70dd3
2017-05-23 07:20:01 -05:00
Kevin Harwell 440ff38c08 res_rtp_asterisk: rtcp mux using the wrong srtp unprotecting algorithm
When using rtcp mux if an rtcp payload came in it would still use the srtp
unprotect algorithm instead of the srtp unprotect rtcp method. Since rtcp
data was being passed to the rtp unprotect method this would result in an
error.

This patch ensures that the correct unprotect method is chosen by making
sure the passed in rtcp flag is appropriately set when rtcp mux is enabled
and an rtcp payload is received.

ASTERISK-26979 #close

Change-Id: Ic5409f9d1a267f1d4785fc5aed867daaecca6241
2017-05-22 14:05:51 -05:00
Sean Bright 0f487978a9 chan_sip: Better ICE handling for RTCP-MUX
If we are offered or are offering RTCP-MUX, don't consider RTCP ICE
candidates. This confuses certain browsers (current Firefox for
example) and causes intial audio setup delays.

ASTERISK-26982 #close

Change-Id: Ifeaf47e83972fe8dbe58b7fb3d6d1823400cfb91
2017-05-22 09:01:57 -05:00
Steve Davies be4beff3e4 app_queue: Add QUEUE_RAISE_PENALTY feature
Additional variable to work alongside QUEUE_MAX_PENALTY and QUEUE_MIN_PENALTY,
including an extra parameter in queuerules.conf. This value causes lower
Agent penalty values to "raise up" so that they can join higher penalty agents
and be treated equally after a period of time.

ASTERISK-26995 #close

Change-Id: If1c6421a983667a5ac4c359f6dac25b212b4c459
2017-05-22 09:20:02 -03:00
Joshua Colp 95c6b98acf Merge "app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDON" 2017-05-22 05:37:32 -05:00
Joshua Colp 8a83b473f1 Merge "app_stream_echo: Added a multi-stream echo application" 2017-05-22 05:03:05 -05:00
Jenkins2 5fffb96736 Merge "core/conversions: Added string to unsigned integer and long conversions" 2017-05-22 04:59:49 -05:00
Jenkins2 b5570de7b4 Merge "res_hep_rtcp: Add support level to module info" 2017-05-19 18:19:01 -05:00
Jenkins2 7631988c3d Merge "AST-2017-004: chan_skinny: Add EOF check in skinny_session" 2017-05-19 15:08:42 -05:00
Jenkins2 79c7067c5e Merge "AST-2017-003: Handle zero-length body parts correctly." 2017-05-19 14:41:50 -05:00
Mark Michelson 7c0466092c AST-2017-003: Handle zero-length body parts correctly.
ASTERISK-26939 #close

Change-Id: I7ea235ab39833a187db4e078f0788bd0af0a24fd
2017-05-19 11:19:56 -05:00
George Joseph 949e9147bf AST-2017-004: chan_skinny: Add EOF check in skinny_session
The while(1) loop in skinny_session wasn't checking for EOF so
a packet that was longer than a header but still truncated
would spin the while loop infinitely.  Not only does this
permanently tie up a thread and drive a core to 100% utilization,
the call of ast_log() in such a tight loop eats all available
process memory.

Added poll with timeout to top of read loop

ASTERISK-26940 #close
Reported-by: Sandro Gauci

Change-Id: I2ce65f3c5cb24b4943a9f75b64d545a1e2cd2898
2017-05-19 11:19:09 -05:00
Mark Michelson 2bb98d8fac AST-2017-002: Ensure transaction key buffer is large enough.
ASTERISK-26938 #close

Change-Id: I266490792fd8896a23be7cb92f316b7e69356413
2017-05-19 11:18:14 -05:00
Sean Bright 4141748e85 res_hep_rtcp: Add support level to module info
Change-Id: I5661478f9cf12d431f730e42be79323b62831e92
2017-05-18 16:36:21 -05:00
Kevin Harwell a60d1f3974 app_stream_echo: Added a multi-stream echo application
If the channel does not have multi-stream support then this application acts
just like app_echo. If it does have multi-stream support then each stream is
echoed back to itself (one-to-one).

If a "num" is specified, then a new topology is made that contains clones (from
the channel's topology) of all media types that are not equal to the given
"type". If the media type differs then the first stream matching the "type" is
cloned into the new topology and then up to "num" - 1 of the same stream are
also cloned into it. Any additional streams from the original topology matching
the "type" are subsequently ignored (i.e. not added to the new topology).

For this same case when a frame is read from a stream that frame is still
echoed back like before, but now that frame is also echoed out to the
additional streams that matched on the specified "type".

ASTERISK-26997 #close

Change-Id: I254144486734178e196c7f590a26ffc13543ff2c
2017-05-17 17:41:11 -05:00
Kevin Harwell 51375686f7 core/conversions: Added string to unsigned integer and long conversions
Added functions that convert a string to an unsigned integer or unsigned long.
A couple of unit test were also created to test the routines. The reasons for
adding these conversion utilities (and hopefully eventually more) are as
follows:

  * Conversion routines are functionally contained with consistent and
    better error checking
  * The function names offer a better description of what is happening
  * It encourages code reuse for easier bug fixing at a single source
  * It's simpler to use
  * It's unit testable

For instance, currently in a lot of places when converting to an integer or
similar the "sscanf" function is used. When using "sscanf" it may not be
immediately clear what's happening as it lacks semantic naming. Limited error
checking is usually done as well. For example, most of the time a check is done
to make sure the value converted, but does not check for overflows or negative
valued conversions when converting unsigned numbers.

Why use/wrap "strtoul" and not "sscanf" then? Primarily, it lacks some of the
built in error handling that "strtoul" has. For instance "strtoul" contains
overflow checks. Less so, but can still factor as reasons, "sscanf" is slightly
more complex in its use. And maybe a bit controversial, but it may be ("big if")
potentially slower than "strtoul" in some cases.

Change-Id: If7eaca4a48f8c7b89cc8b5a1f4bed2852fca82bb
2017-05-17 17:41:11 -05:00
Jenkins2 e74c48a46f Merge "res_pjsip_session.c: Process initial INVITE sooner. (key exists)" 2017-05-17 11:40:28 -05:00
Joshua Colp aa4c800060 Merge "Fix spelling queues.conf.sample file" 2017-05-17 10:40:11 -05:00
Joshua Colp 5a7af00e80 asterisk: Audit locking of channel when manipulating flags.
When manipulating flags on a channel the channel has to be
locked to guarantee that nothing else is also manipulating
the flags. This change introduces locking where necessary to
guarantee this. It also adds helper functions that manipulate
channel flags and lock to reduce repeated code.

ASTERISK-26789

Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
2017-05-16 14:25:23 +00:00
Richard Mudgett 30fbed65f1 res_pjsip_session.c: Process initial INVITE sooner. (key exists)
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
2017-05-15 15:12:26 -05:00
Joshua Colp 094093b31d Merge "chan_sip: Change sip_get_codec() to return correct codec list" 2017-05-15 09:28:11 -05:00
Rodrigo Ramírez Norambuena 6e7b78414f Fix spelling queues.conf.sample file
Change-Id: Ie1c2d83af66f27a449da09a68d987e0992627fee
2017-05-14 01:37:09 -04:00
George Joseph ce4d8dac91 Merge changes from topic 'sdp_api_adjustments'
* changes:
  SDP: Make process possible multiple fmtp attributes per rtpmap.
  SDP: Explicitly stop a RTP instance before destoying it.
  SDP: Rework merge_capabilities().
  SDP: Update ast_get_topology_from_sdp() to keep RTP map.
2017-05-12 12:29:39 -05:00
George Joseph 28d4e6be9b Merge "SDP: Remove sdp_state.remote_capabilities" 2017-05-12 12:29:15 -05:00
Jenkins2 f09e079294 Merge "SDP: Add interface_address to specify our address to use." 2017-05-12 11:49:58 -05:00
Vitezslav Novy 93b7f84c1a chan_sip: Change sip_get_codec() to return correct codec list
Return cahnnel nativeformats to fix bridge technology selection process.
Same approach as in pjsip module.

ASTERISK-26143
Reported-by: Henning Holtschneider

Change-Id: I64e863753954d6ad67a9e722df2ebc328705ad48
2017-05-12 04:33:12 -05:00
Jenkins2 57217e4cc2 Merge "res_hep_rtcp: Provide chan_sip Call-ID for RTCP messages." 2017-05-11 16:39:54 -05:00
Jenkins2 542dd7d795 Merge "logger: Added logger_queue_limit to the configuration options." 2017-05-11 12:03:07 -05:00
Alexei Gradinari 808f299808 res_pjsip: New endpoint option "refer_blind_progress"
This option was added to turn off notifying the progress details
on Blind Transfer. If this option is not set then the chan_pjsip
will send NOTIFY "200 OK" immediately after "202 Accepted".

Some SIP phones like Mitel/Aastra or Snom keep the line busy until
receive "200 OK".

ASTERISK-26333 #close

Change-Id: Id606fbff2e02e967c02138457badc399144720f2
2017-05-11 10:50:35 -05:00
Jenkins2 8b15719a11 Merge "tcptls: Improve error messages for TLS connections." 2017-05-11 10:46:15 -05:00
Jenkins2 2cb4cdc004 Merge "Prevent Undefined Capath Crash" 2017-05-11 10:38:38 -05:00
Ivan Poddubny 045dbcc2d6 app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDON
There are 2 places in app_queue.c that log EXITEMPTY event: one in
wait_our_turn, and another one in queue_exec in the loop trying to
call an agent after wait_our_turn.

In most cases it leads to logging EXITEMPTY twice.

ABANDON is also logged on two places, and in the rare case when an agent
and caller hang up simultaneously it's also possible to get duplicates
in queue_log.

This commit changes wait_our_turn to return -1 ("the caller should exit
the queue") instead of 0 ("the caller's turn has arrived") in case of
leaving when empty, so queue_exec skips the agent calling loop.

Also, leave_queue is now executed only once in this case, because 2nd
time is just a noop when the queue entry has already been removed.

Also, it sets qe->handled to -1 to indicate that the call was not
answered by an agent, but the necessary handling has already been done
in order to avoid logging an extra ABANDON entry.

ASTERISK-25665 #close
Reported by: Ove Aursand

Change-Id: I4578dd383bf2ac41589cf167865e8aaebcd4c11e
2017-05-11 08:32:40 +02:00
Richard Mudgett b8659be9b0 SDP: Make process possible multiple fmtp attributes per rtpmap.
Change-Id: Ie7511008d82b59590e0eb520a21b5e1da4bd7349
2017-05-09 12:57:57 -05:00
Richard Mudgett c2906dfa05 SDP: Remove sdp_state.remote_capabilities
The sdp_state.remote_capabilities was only used inside merge_sdps() and
subsequent calls to merge_sdps() by re-INVITE's would leak them.

Change-Id: I0ceb7838ea044cc913e8ad4a255c39c9740ae0ce
2017-05-09 12:57:57 -05:00
Richard Mudgett 16785c0908 SDP: Add interface_address to specify our address to use.
When we optionally set the interface_address we are forcing the media to
go out a specific interface address.  This allows us to optionally have
the media go out the interface that SIP signalling came in on or if we are
configured to have the media always go out a specific address.

Change-Id: I160d9fac322a075bd2557b430632544178196189
2017-05-09 12:57:57 -05:00
Richard Mudgett 367042bd3e SDP: Explicitly stop a RTP instance before destoying it.
* Made sdp_add_m_from_rtp_stream() and sdp_add_m_from_udptl_stream()
handle generating disabled/declined streams.

* Added /main/sdp/sdp_merge_asymmetric unit test.  It currently does not
check the offerer side negotiated SDP because that isn't the purpose of
this patch and there is much to be done to handle declined/dummy streams.

* Added T.38 image streams to the /main/sdp/sdp_merge_symmetric and
/main/sdp/sdp_merge_crisscross unit tests.

Change-Id: Ib4dcb3ca4f9a9133b376f4e3302f9a1f963f2b31
2017-05-09 12:57:57 -05:00
Richard Mudgett be5809fac8 SDP: Rework merge_capabilities().
* Tried to give better variable names.
* Made our SDP answer use the offer's RTP payload types as the SDP RFC
says we SHOULD.
* Updating the local topology now takes the stream format caps.  We are
likely preparing to send an offer.

Change-Id: I34d3be8e3036402a8575ffcae3eebc5ce348d7c0
2017-05-09 12:57:57 -05:00
Richard Mudgett ae7689f093 SDP: Update ast_get_topology_from_sdp() to keep RTP map.
* Add failure exits to ast_get_topology_from_sdp().

Change-Id: I4cc85c1ede8d712766ed20f544dbcef04c8c1049
2017-05-09 12:57:57 -05:00
Joshua Colp cbbd119c21 tcptls: Improve error messages for TLS connections.
This change uses the functions provided by OpenSSL to query
and better construct error messages for situations where
the connection encounters a problem.

ASTERISK-26606

Change-Id: I7ae40ce88c0dc4e185c4df1ceb3a6ccc198f075b
2017-05-09 16:12:04 +00:00
Joshua Elson 10a4439ac9 Prevent Undefined Capath Crash
It is possible to initialize a valid config without a capath
or cafile definition. This will cause a crash on a reload.

This fix ensures capath is always allocated.

ASTERISK-26983 #close

Change-Id: I63ff715d9d9023427543a5b8a4ba7b0d82533c12
2017-05-09 09:22:00 -05:00