]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
9 years agores_pjsip_sdp_rtp: Fix multiple keepalive scheduled items. 60/1160/1
Joshua Colp [Sat, 29 Aug 2015 01:22:45 +0000 (22:22 -0300)] 
res_pjsip_sdp_rtp: Fix multiple keepalive scheduled items.

The keepalive support in res_pjsip_sdp_rtp currently assumes
that a stream will only be negotiated once. This is false.
If the stream is replaced and later added back it can be
negotiated again causing multiple keepalive scheduled items
to exist. This change explicitly deletes the existing
keepalive scheduled item before adding the new one.

The res_pjsip_sdp_rtp module also does not stop RTP
keepalives or timeout timer if the stream has been
replaced. This change adds a callback to the session media
interface to allow a media stream to be stopped without
the resources being destroyed. This allows the scheduled
items and RTP to be stopped when the stream no longer
exists.

ASTERISK-25356 #close

Change-Id: Ibe6a7cc0927c87326fd5f1c0d4ad889dbfbea1de

9 years agoMerge "res_pjsip_session: Don't invoke session supplements twice for BYE requests...
Mark Michelson [Fri, 28 Aug 2015 17:29:25 +0000 (12:29 -0500)] 
Merge "res_pjsip_session: Don't invoke session supplements twice for BYE requests." into 13

9 years agoMerge "res_pjsip: Add common ast_sip_get_host_ip API." into 13
Joshua Colp [Thu, 27 Aug 2015 20:41:59 +0000 (15:41 -0500)] 
Merge "res_pjsip: Add common ast_sip_get_host_ip API." into 13

9 years agoMerge "Chaos: make hangup NULL tolerant" into 13
Mark Michelson [Thu, 27 Aug 2015 19:53:42 +0000 (14:53 -0500)] 
Merge "Chaos: make hangup NULL tolerant" into 13

9 years agores_pjsip_session: Don't invoke session supplements twice for BYE requests. 52/1152/1
Joshua Colp [Thu, 27 Aug 2015 17:26:09 +0000 (14:26 -0300)] 
res_pjsip_session: Don't invoke session supplements twice for BYE requests.

When a BYE request is received the PJSIP invite session implementation
creates and sends a 200 OK response before we are aware of it. This
causes the INVITE session state callback to be called into and ultimately
the session supplements run on the BYE request. Once this response has
been sent the normal transaction state callback is invoked which
invokes the session supplements on the BYE request again. This can
be problematic in particular with res_pjsip_rfc3326 as it may
attempt to update the hangup cause code on the channel while it is
in the process of being hung up.

This change makes it so the session supplements are only invoked
once by the INVITE session state callback.

ASTERISK-25318 #close

Change-Id: I69c17df55ccbb61ef779ac38cc8c6b411376c19a

9 years agoChaos: handle failed allocation in get_media_encryption_type 48/1148/1
Scott Griepentrog [Wed, 26 Aug 2015 20:26:00 +0000 (15:26 -0500)] 
Chaos: handle failed allocation in get_media_encryption_type

If the ast_strndup() call fails to allocate a copy of the
transport string for parsing, fail gracefully.

ASTERISK-25323
Reported by: Scott Griepentrog

Change-Id: Ia4b905ce6d03da53fea526224455c1044b1a5a28

9 years agoChaos: make hangup NULL tolerant 46/1146/1
Scott Griepentrog [Wed, 26 Aug 2015 19:25:42 +0000 (14:25 -0500)] 
Chaos: make hangup NULL tolerant

In chan_pjsip_new, if allocation of the pvt
structure fails, ast_hangup is called.  But
it was written to assume pvt was valid, and
this change corrects that.

ASTERISK-25323
Reported by: Scott Griepentrog

Change-Id: I5f47860fe9cee4cd56abd3f79b108678ab72cc87

9 years agochan_sip: Allow call pickup to set the hangup cause. 42/1142/1
Joshua Colp [Wed, 26 Aug 2015 10:40:32 +0000 (07:40 -0300)] 
chan_sip: Allow call pickup to set the hangup cause.

The call pickup implementation in chan_sip currently sets the channel
hangup cause to "normal clearing" if call pickup is successfully
performed. This action overwrites the "answered elsewhere" hangup cause
set by the call pickup code and can result in the SIP device in
question showing a missed call when it should not.

This change sets the hangup cause to "normal clearing" as a
default initially but allows the call pickup to change it as
needed.

ASTERISK-25346 #close

Change-Id: I00ac2c269cee9e29586ee2c65e83c70e52a02cff

9 years agores_pjsip: Add common ast_sip_get_host_ip API. 37/1137/2
Joshua Colp [Tue, 25 Aug 2015 12:17:34 +0000 (09:17 -0300)] 
res_pjsip: Add common ast_sip_get_host_ip API.

Modules commonly used the pj_gethostip function for retrieving the
IP address of the host. This function does not cache the result and may
result in a DNS lookup occurring, or additional work. If the DNS
server is unreachable or network issues arise this can cause the
pj_gethostip function to block for a period of time.

This change adds an ast_sip_get_host_ip and ast_sip_get_host_ip_string
function which does the same thing but caches the host IP address at
module load time. This results in no additional work being done each
time the local host IP address is needed.

ASTERISK-25342 #close

Change-Id: I3205deb679b01fa5ac05a94b623bfd620a2abe1e

9 years agoMerge "res_pjsip_pubsub: On recreated notify fail deleted sub_tree is referenced...
Mark Michelson [Mon, 24 Aug 2015 22:16:25 +0000 (17:16 -0500)] 
Merge "res_pjsip_pubsub: On recreated notify fail deleted sub_tree is referenced" into 13

9 years agoMerge "bridge: Kick channel from bridge if hung up during action." into 13
Mark Michelson [Mon, 24 Aug 2015 22:11:56 +0000 (17:11 -0500)] 
Merge "bridge: Kick channel from bridge if hung up during action." into 13

9 years agoMerge "res_pjsip/pjsip_configuration: Disregard empty auth values" into 13
Joshua Colp [Mon, 24 Aug 2015 18:59:25 +0000 (13:59 -0500)] 
Merge "res_pjsip/pjsip_configuration: Disregard empty auth values" into 13

9 years agores_pjsip_pubsub: On recreated notify fail deleted sub_tree is referenced 30/1130/1
Joshua Colp [Mon, 24 Aug 2015 16:04:57 +0000 (13:04 -0300)] 
res_pjsip_pubsub: On recreated notify fail deleted sub_tree is referenced

When recreating a subscription it is possible for a freed sub_tree
to be referenced when the initial NOTIFY fails to be created.

Change-Id: I681c215309aad01b21d611c2de47b3b0a6022788

9 years agobridge: Kick channel from bridge if hung up during action. 33/1133/1
Joshua Colp [Mon, 24 Aug 2015 11:21:37 +0000 (08:21 -0300)] 
bridge: Kick channel from bridge if hung up during action.

When executing an action in a bridge it is possible for the
channel to be hung up without the bridge becoming aware of it.
This is most easily reproducible by hanging up when the bridge
is streaming DTMF due to a feature timeout. This change makes
it so after action execution the channel is checked to determine
if it has been hung up and if it has it is kicked from the bridge.

ASTERISK-25341 #close

Change-Id: I6dd8b0c3f5888da1c57afed9e8a802ae0a053062

9 years agores_pjsip/pjsip_configuration: Disregard empty auth values 28/1128/2
Matt Jordan [Sun, 23 Aug 2015 23:26:50 +0000 (18:26 -0500)] 
res_pjsip/pjsip_configuration: Disregard empty auth values

When an endpoint is backed by a non-static conf file backend (such as
the AstDB or Realtime), the 'auth' object may be returned as being an
empty string. Currently, res_pjsip will interpret that as being a valid
auth object, and will attempt to authenticate inbound requests. This
isn't desired; is an auth value is empty (which the name of an auth
object cannot be), we should instead interpret that as being an invalid
auth object and skip it.

ASTERISK-25339 #close

Change-Id: Ic32b0c6eb5575107d5164a8c40099e687cd722c7

9 years agoMerge topic 'ASTERISK-25215' into 13
Joshua Colp [Thu, 20 Aug 2015 16:33:51 +0000 (11:33 -0500)] 
Merge topic 'ASTERISK-25215' into 13

* changes:
  app_queue.c: Extract some functions for simpler code.
  app_queue.c: Fix error checking in QUEUE_MEMBER() read.

9 years agoMerge "contrib: script install_prereq should install sqlite3" into 13
Mark Michelson [Wed, 19 Aug 2015 21:56:22 +0000 (16:56 -0500)] 
Merge "contrib: script install_prereq should install sqlite3" into 13

9 years agoari/ari_websockets.c: Fix ast_debug parameter type mismatch. 23/1123/1
Richard Mudgett [Wed, 19 Aug 2015 17:10:12 +0000 (12:10 -0500)] 
ari/ari_websockets.c: Fix ast_debug parameter type mismatch.

This is a type mismatch fix of the debugging commit
c63316eec10e1990a88bf4712238d6deb375bfa9 made to find out why
a testsuite test was failing only on one of the continuous
integration build agents.

Change-Id: Iba34f6e87cec331f6ac80e4daff6476ea6f00a75

9 years agocontrib: script install_prereq should install sqlite3 20/1120/1
Scott Griepentrog [Wed, 19 Aug 2015 15:30:12 +0000 (10:30 -0500)] 
contrib: script install_prereq should install sqlite3

Asterisk needs the sqlite 3 library, which is package
sqlite-devel in CentOS. By adding this package to the
script, a problem with configure failing is resolved.

ASTERISK-25331 #close
Reported by: Kevin Harwell

Change-Id: I90efaf6a01914fea03f21e5cdbd91c348f44b0ec

9 years agoMerge "res_ari.c: Add missing off nominal unlock and remove a RAII_VAR()." into 13
Matt Jordan [Wed, 19 Aug 2015 13:42:18 +0000 (08:42 -0500)] 
Merge "res_ari.c: Add missing off nominal unlock and remove a RAII_VAR()." into 13

9 years agoMerge "res_http_websocket.c: Fix some off nominal path cleanup." into 13
Matt Jordan [Wed, 19 Aug 2015 13:43:01 +0000 (08:43 -0500)] 
Merge "res_http_websocket.c: Fix some off nominal path cleanup." into 13

9 years agores_http_websocket.c: Fix some off nominal path cleanup. 16/1116/1
Richard Mudgett [Tue, 18 Aug 2015 21:06:54 +0000 (16:06 -0500)] 
res_http_websocket.c: Fix some off nominal path cleanup.

* Remove extraneous unlock on off-nominal path.
* Add missing HTTP error reply.

Change-Id: I1f402bfe448fba8696b507477cab5f060ccd9b2b

9 years agores_ari.c: Add missing off nominal unlock and remove a RAII_VAR(). 15/1115/1
Richard Mudgett [Tue, 18 Aug 2015 19:46:46 +0000 (14:46 -0500)] 
res_ari.c: Add missing off nominal unlock and remove a RAII_VAR().

Change-Id: I0c5e7b34057f26dadb39489c4dac3015c52f5dbf

9 years agoapp_queue.c: Extract some functions for simpler code. 07/1107/2
Richard Mudgett [Mon, 17 Aug 2015 21:41:19 +0000 (16:41 -0500)] 
app_queue.c: Extract some functions for simpler code.

* Extract set_queue_member_pause() from set_member_paused() for simpler
and more consistent code.

* Extract set_queue_member_ringinuse() from
set_member_ringinuse_help_members() for simpler code.

Change-Id: Iecc1f4119c63347341d7ea6b65f5fc4963706306

9 years agoapp_queue.c: Fix setting QUEUE_MEMBER 'paused' and 'ringinuse'. 05/1105/2
Richard Mudgett [Fri, 14 Aug 2015 17:55:28 +0000 (12:55 -0500)] 
app_queue.c: Fix setting QUEUE_MEMBER 'paused' and 'ringinuse'.

Setting the 'paused' and 'ringinuse' options on a queue member using the
dialplan function QUEUE_MEMBER did not behave the same way as the
equivalent dialplan applications or AMI actions.

* Made queue_function_mem_write() call the set_member_paused() and
set_member_value() for the 'paused' and 'ringinuse' options respectively.
A beneficial side effect is that the queue name is now optional and sets
the value in all queues the interface is a member.

* Update QUEUE_MEMBER XML documentation.

* Fix error checking in QUEUE_MEMBER() write.

ASTERISK-25215 #close
Reported by: Lorne Gaetz

Change-Id: I3a016be8dc94d63a9cc155295ff9c9afa5f707cb

9 years agoapp_queue.c: Fix error checking in QUEUE_MEMBER() read. 06/1106/2
Richard Mudgett [Mon, 17 Aug 2015 18:34:15 +0000 (13:34 -0500)] 
app_queue.c: Fix error checking in QUEUE_MEMBER() read.

Change-Id: I7294e13d27875851c2f4ef6818adba507509d224

9 years agoCHAOS: prevent sorcery object with null id 01/1101/1
Scott Griepentrog [Mon, 17 Aug 2015 16:00:53 +0000 (11:00 -0500)] 
CHAOS: prevent sorcery object with null id

When allocating a sorcery object, fail if the
id value was not allocated.

ASTERISK-25323
Reported by: Scott Griepentrog

Change-Id: I152133fb7545a4efcf7a0080ada77332d038669e

9 years agores_pjsip_sdp_rtp: Restore removed NULL check. 97/1097/1
Mark Michelson [Fri, 14 Aug 2015 20:46:05 +0000 (15:46 -0500)] 
res_pjsip_sdp_rtp: Restore removed NULL check.

When sending an RTP keepalive, we need to be sure we're not dealing with
a NULL RTP instance. There had been a NULL check, but the commit that
added the rtp_timeout and rtp_hold_timeout options removed the NULL
check.

Change-Id: I2d7dcd5022697cfc6bf3d9e19245419078e79b64

9 years agoaudiohook.c: Simplify variable usage in audiohook_read_frame_both(). 87/1087/2
Richard Mudgett [Thu, 13 Aug 2015 17:30:00 +0000 (12:30 -0500)] 
audiohook.c: Simplify variable usage in audiohook_read_frame_both().

Change-Id: I58bed58631a94295b267991c5b61a3a93c167f0c

9 years agoaudiohook.c: Fix MixMonitor crash when using the r() or t() options. 86/1086/2
Richard Mudgett [Thu, 13 Aug 2015 17:22:14 +0000 (12:22 -0500)] 
audiohook.c: Fix MixMonitor crash when using the r() or t() options.

The built frame format in audiohook_read_frame_both() is now set to a
signed linear format before the rx and tx frames are duplicated instead of
only for the mixed audio frame duplication.

ASTERISK-25322 #close
Reported by Sean Pimental

Change-Id: I86f85b5c48c49e4e2d3b770797b9d484250a1538

9 years agoMerge "chan_sip.c: wrong peer searched in sip_report_security_event" into 13
Mark Michelson [Thu, 13 Aug 2015 21:12:23 +0000 (16:12 -0500)] 
Merge "chan_sip.c: wrong peer searched in sip_report_security_event" into 13

9 years agochan_sip.c: wrong peer searched in sip_report_security_event 82/1082/2
Kevin Harwell [Wed, 12 Aug 2015 17:59:53 +0000 (12:59 -0500)] 
chan_sip.c: wrong peer searched in sip_report_security_event

In chan_sip, after handling an incoming invite a security event is raised
describing authorization (success, failure, etc...). However, it was doing
a lookup of the peer by extension. This is fine for register messages, but
in the case of an invite it may search and find the wrong peer, or a non
existent one (for instance, in the case of call pickup). Also, if the peers
are configured through realtime this may cause an unnecessary database lookup
when caching is enabled.

This patch makes it so that sip_report_security_event searches by IP address
when looking for a peer instead of by extension after an invite is processed.

ASTERISK-25320 #close

Change-Id: I9b3f11549efb475b6561c64f0e6da1a481d98bc4

9 years agores_http_websocket: When shutting down a session don't close closed socket 78/1078/2
Joshua Colp [Thu, 13 Aug 2015 10:26:51 +0000 (07:26 -0300)] 
res_http_websocket: When shutting down a session don't close closed socket

Due to the use of ast_websocket_close in session termination it is
possible for the underlying socket to already be closed when the
session is terminated. This occurs when the close frame is attempted
to be written out but fails.

Change-Id: I7572583529a42a7dc911ea77a974d8307d5c0c8b

9 years agoMerge "res_http_websocket: Forcefully terminate on write errors." into 13
Joshua Colp [Wed, 12 Aug 2015 18:42:59 +0000 (13:42 -0500)] 
Merge "res_http_websocket: Forcefully terminate on write errors." into 13

9 years agoMerge topic 'ASTERISK-25315' into 13
Mark Michelson [Wed, 12 Aug 2015 18:37:38 +0000 (13:37 -0500)] 
Merge topic 'ASTERISK-25315' into 13

* changes:
  chan_dahdi.c: Flush the DAHDI write buffer after starting DTMF.
  chan_dahdi.c: Lock private struct for ast_write().

9 years agoMerge "chan_sip: Fix negotiation of iLBC 30." into 13
Joshua Colp [Wed, 12 Aug 2015 18:36:01 +0000 (13:36 -0500)] 
Merge "chan_sip: Fix negotiation of iLBC 30." into 13

9 years agores_http_websocket: Forcefully terminate on write errors. 73/1073/1
Joshua Colp [Tue, 11 Aug 2015 10:24:30 +0000 (07:24 -0300)] 
res_http_websocket: Forcefully terminate on write errors.

The res_http_websocket module will currently attempt to close
the WebSocket connection if fatal cases occur, such as when
attempting to write out data and being unable to. When the
fatal cases occur the code attempts to write a WebSocket close
frame out to have the remote side close the connection. If
writing this fails then the connection is not terminated.

This change forcefully terminates the connection if the
WebSocket is to be closed but is unable to send the close frame.

ASTERISK-25312 #close

Change-Id: I10973086671cc192a76424060d9ec8e688602845

9 years agochan_dahdi.c: Flush the DAHDI write buffer after starting DTMF. 65/1065/1
Richard Mudgett [Mon, 10 Aug 2015 18:43:19 +0000 (13:43 -0500)] 
chan_dahdi.c: Flush the DAHDI write buffer after starting DTMF.

Pressing DTMF digits on a phone to go out on a DAHDI channel can result in
the digit not being recognized or even heard by the peer.

Phone -> Asterisk -> DAHDI/channel

Turns out the DAHDI behavior with DTMF generation (and any other generated
tones) is exposed by the "buffers=" setting in chan_dahdi.conf.  When
Asterisk requests to start sending DTMF then DAHDI waits until its write
buffer is empty before generating any samples for the DTMF tones.  When
Asterisk subsequently requests DAHDI to stop sending DTMF then DAHDI
immediately stops generating the DTMF samples.  As a result, the more
samples there are in the DAHDI write buffer the shorter the time DTMF
actually gets sent on the wire.  If there are more samples in the write
buffer than the time DTMF is supposed to be sent then no DTMF gets sent on
the wire.  With the "buffers=12,half" setting and each buffer representing
20 ms of samples then the DAHDI write buffer is going to contain around
120 ms of samples.  For DTMF to be recognized by the peer the actual sent
DTMF duration needs to be a minimum of 40 ms.  Therefore, the intended
duration needs to be a minimum of 160 ms for the peer to receive the
minimum DTMF digit duration to recognize it.

A simple and effective solution to work around the DAHDI behavior is for
Asterisk to flush the DAHDI write buffer when sending DTMF so the full
duration of DTMF is actually sent on the wire.  When someone is going to
send DTMF they are not likely to be talking before sending the tones so
the flushed write samples are expected to just contain silence.

* Made dahdi_digit_begin() flush the DAHDI write buffer after requesting
to send a DTMF digit.

ASTERISK-25315 #close
Reported by John Hardin

Change-Id: Ib56262c708cb7858082156bfc70ebd0a220efa6a

9 years agochan_dahdi.c: Lock private struct for ast_write(). 64/1064/1
Richard Mudgett [Wed, 5 Aug 2015 19:21:50 +0000 (14:21 -0500)] 
chan_dahdi.c: Lock private struct for ast_write().

There is a window of opportunity for DTMF to not go out if an audio frame
is in the process of being written to DAHDI while another thread starts
sending DTMF.  The thread sending the audio frame could be past the
currently dialing check before being preempted by another thread starting
a DTMF generation request.  When the thread sending the audio frame
resumes it will then cause DAHDI to stop the DTMF tone generation.  The
result is no DTMF goes out.

* Made dahdi_write() lock the private struct before writing to the DAHDI
file descriptor.

ASTERISK-25315
Reported by John Hardin

Change-Id: Ib4e0264cf63305ed5da701188447668e72ec9abb

9 years agores_pjsip.c: Fix crash from corrupt saved SUBSCRIBE message. 63/1063/1
Richard Mudgett [Mon, 10 Aug 2015 23:23:02 +0000 (18:23 -0500)] 
res_pjsip.c: Fix crash from corrupt saved SUBSCRIBE message.

If the saved SUBSCRIBE message is not parseable for whatever reason then
Asterisk could crash when libpjsip tries to parse the message and adds an
error message to the parse error list.

* Made ast_sip_create_rdata() initialize the parse error rdata list.  The
list is checked after parsing to see that it remains empty for the
function to return successful.

ASTERISK-25306
Reported by Mark Michelson

Change-Id: Ie0677f69f707503b1a37df18723bd59418085256

9 years agoMerge "res/res_format_attr_silk: Expose format attributes to other modules" into 13
Matt Jordan [Tue, 11 Aug 2015 16:59:44 +0000 (11:59 -0500)] 
Merge "res/res_format_attr_silk: Expose format attributes to other modules" into 13

9 years agoMerge "main/format: Add an API call for retrieving format attributes" into 13
Matt Jordan [Tue, 11 Aug 2015 16:59:39 +0000 (11:59 -0500)] 
Merge "main/format: Add an API call for retrieving format attributes" into 13

9 years agochan_sip: Fix negotiation of iLBC 30. 57/1057/2
Alexander Traud [Mon, 10 Aug 2015 12:40:02 +0000 (14:40 +0200)] 
chan_sip: Fix negotiation of iLBC 30.

iLBC 20 was advertised in a SIP/SDP negotiation. However, only iLBC 30 is
supported. Removes "a=fmtp:x mode=y" from SDP. Because of RFC 3952 section 5,
only iLBC 30 is negotiated now.

ASTERISK-25309 #close

Change-Id: I92d724600a183eec3114da0ac607b994b1a793da

9 years agoMerge "Replace htobe64 with htonll" into 13
Joshua Colp [Mon, 10 Aug 2015 16:39:05 +0000 (11:39 -0500)] 
Merge "Replace htobe64 with htonll" into 13

9 years agoMerge "res_pjsip_pubsub: More accurately persist packet." into 13
Joshua Colp [Mon, 10 Aug 2015 14:03:18 +0000 (09:03 -0500)] 
Merge "res_pjsip_pubsub: More accurately persist packet." into 13

9 years agores/res_format_attr_silk: Expose format attributes to other modules 54/1054/1
Matt Jordan [Sun, 9 Aug 2015 23:42:00 +0000 (18:42 -0500)] 
res/res_format_attr_silk: Expose format attributes to other modules

This patch adds the .get callback to the format attribute module, such
that the Asterisk core or other third party modules can query for the
negotiated format attributes.

Change-Id: Ia24f55cf9b661d651ce89b4f4b023d921380f19c

9 years agomain/format: Add an API call for retrieving format attributes 53/1053/1
Matt Jordan [Sun, 9 Aug 2015 22:56:48 +0000 (17:56 -0500)] 
main/format: Add an API call for retrieving format attributes

Some codecs that may be a third party library to Asterisk need to have
knowledge of the format attributes that were negotiated. Unfortunately,
when the great format migration of Asterisk 13 occurred, that ability
was lost.

This patch adds an API call, ast_format_attribute_get, to the core
format API, along with updates to the unit test to check the new API
call. A new callback is also now available for format attribute modules,
such that they can provide the format attribute values they manage.

Note that the API returns a void *. This is done as the format attribute
modules themselves may store format attributes in any particular manner
they like. Care should be taken by consumers of the API to check the
return value before casting and dereferencing. Consumers will obviously
need to have a priori knowledge of the type of the format attribute as
well.

Change-Id: Ieec76883dfb46ecd7aff3dc81a52c81f4dc1b9e3

10 years agoMerge "rtp_engine.c: Fix performance issue with several channel drivers that use...
Matt Jordan [Sat, 8 Aug 2015 13:07:18 +0000 (08:07 -0500)] 
Merge "rtp_engine.c: Fix performance issue with several channel drivers that use RTP." into 13

10 years agoReplace htobe64 with htonll 51/1051/1
David M. Lee [Sat, 8 Aug 2015 03:11:03 +0000 (22:11 -0500)] 
Replace htobe64 with htonll

We don't have a compatability function to fill in a missing htobe64; but
we already have one for the identical htonll.

Change-Id: Ic0a95db1c5b0041e14e6b127432fb533b97e4cac

10 years agoARI: Retrieve existing log channels 86/986/14
Scott Emidy [Fri, 7 Aug 2015 19:20:29 +0000 (14:20 -0500)] 
ARI: Retrieve existing log channels

An http request can be sent to get the existing Asterisk logs.

The command "curl -v -u user:pass -X GET 'http://localhost:8088
/ari/asterisk/logging'" can be run in the terminal to access the
newly implemented functionality.

* Retrieve all existing log channels

ASTERISK-25252

Change-Id: I7bb08b93e3b938c991f3f56cc5d188654768a808

10 years agoARI: Creating log channels 42/1042/5
Scott Emidy [Fri, 7 Aug 2015 16:14:06 +0000 (11:14 -0500)] 
ARI: Creating log channels

An http request can be sent to create a log channel
in Asterisk.

The command "curl -v -u user:pass -X POST
'http://localhost:088/ari/asterisk/logging/mylog?
configuration=notice,warning'" can be run in the terminal
to access the newly implemented functionality for ARI.

* Ability to create log channels using ARI

ASTERISK-25252

Change-Id: I9a20e5c75716dfbb6b62fd3474faf55be20bd782

10 years agoMerge "ARI: Deleting log channels" into 13
Joshua Colp [Fri, 7 Aug 2015 15:41:22 +0000 (10:41 -0500)] 
Merge "ARI: Deleting log channels" into 13

10 years agoMerge "res_pjsip: Ensure sanitized XML is NULL terminated." into 13
Joshua Colp [Fri, 7 Aug 2015 15:23:40 +0000 (10:23 -0500)] 
Merge "res_pjsip: Ensure sanitized XML is NULL terminated." into 13

10 years agoARI: Deleting log channels 48/1048/4
Scott Emidy [Thu, 6 Aug 2015 20:18:04 +0000 (15:18 -0500)] 
ARI: Deleting log channels

An http request can be sent to delete a log channel
in Asterisk.

The command "curl -v -u user:pass -X DELETE 'http://localhost:8088
/ari/asterisk/logging/mylog'" can be run in the terminal
to access the newly implemented functionally for ARI.

* Able to delete log channels using ARI

ASTERISK-25252

Change-Id: Id6eeb54ebcc511595f0418d586ff55914bc3aae6

10 years agores_pjsip_pubsub: More accurately persist packet. 44/1044/2
Mark Michelson [Thu, 6 Aug 2015 17:48:07 +0000 (12:48 -0500)] 
res_pjsip_pubsub: More accurately persist packet.

The pjsip_rx_data structure has a pkt_info.packet field on it that is
the packet that was read from the transport. For datagram transports,
the packet read from the transport will correspond to the SIP message
that arrived. For streamed transports, however, it is possible to read
multiple SIP messages in one packet.

In a recent case, Asterisk crashed on a system where TCP was being used.
This is because at some point, a read from the TCP socket resulted in a
200 OK response as well as an incoming SUBSCRIBE request being stored in
rdata->pkt_info.packet. When the SUBSCRIBE was processed, the
combination 200 OK and SUBSCRIBE was saved in persistent storage. Later,
a restart of Asterisk resulted in the crash because the persistent
subscription recreation code ended up building the 200 OK response
instead of a SUBSCRIBE request, and we attempted to access
request-specific data.

The fix here is to use the pjsip_msg_print() function in order to
persist SUBSCRIBE requests. This way, rather than using the raw socket
data, we use the parsed SIP message that PJSIP has given us. If we
receive multiple SIP messages from a single read, we will be sure only
to save off the relevant SIP message. There also is a safeguard put in
place to make sure that if we do end up reconstructing a SIP response,
it will not cause a crash.

ASTERISK-25306 #close
Reported by Mark Michelson

Change-Id: I4bf16f7b76a2541d10b55de82bcd14c6e542afb2

10 years agoMerge "res_rtp_asterisk.c: Fix off-nominal crash potential." into 13
Joshua Colp [Thu, 6 Aug 2015 17:05:07 +0000 (12:05 -0500)] 
Merge "res_rtp_asterisk.c: Fix off-nominal crash potential." into 13

10 years agoMerge topic 'misc_rtp_tweaks' into 13
Joshua Colp [Thu, 6 Aug 2015 16:50:25 +0000 (11:50 -0500)] 
Merge topic 'misc_rtp_tweaks' into 13

* changes:
  rtp_engine.c: Must protect mime_types_len with mime_types_lock.
  res_pjsip_sdp_rtp.c: Fixup some whitespace.

10 years agores_pjsip: Ensure sanitized XML is NULL terminated. 38/1038/2
Joshua Colp [Tue, 4 Aug 2015 21:12:59 +0000 (18:12 -0300)] 
res_pjsip: Ensure sanitized XML is NULL terminated.

The ast_sip_sanitize_xml function is used to sanitize
a string for placement into XML. This is done by examining
an input string and then appending values to an output
buffer. The function used by its implementation, strncat,
has specific behavior that was not taken into account.
If the size of the input string exceeded the available
output buffer size it was possible for the sanitization
function to write past the output buffer itself causing
a crash. The crash would either occur because it was
writing into memory it shouldn't be or because the resulting
string was not NULL terminated.

This change keeps count of how much remaining space is
available in the output buffer for text and only allows
strncat to use that amount.

Since this was exposed by the res_pjsip_pidf_digium_body_supplement
module attempting to send a large message the maximum allowed
message size has also been increased in it.

A unit test has also been added which confirms that the
ast_sip_sanitize_xml function is providing NULL terminated
output even when the input length exceeds the output
buffer size.

ASTERISK-25304 #close

Change-Id: I743dd9809d3e13d722df1b0509dfe34621398302

10 years agoMerge "res_pjsip_sdp_rtp.c: Fix processing wrong SDP media list." into 13
Joshua Colp [Thu, 6 Aug 2015 09:52:31 +0000 (04:52 -0500)] 
Merge "res_pjsip_sdp_rtp.c: Fix processing wrong SDP media list." into 13

10 years agoMerge "res_rtp_asterisk: Don't leak temporary key when enabling PFS." into 13
Mark Michelson [Wed, 5 Aug 2015 17:45:09 +0000 (12:45 -0500)] 
Merge "res_rtp_asterisk: Don't leak temporary key when enabling PFS." into 13

10 years agores_rtp_asterisk: Don't leak temporary key when enabling PFS. 36/1036/2
Joshua Colp [Wed, 5 Aug 2015 10:23:21 +0000 (07:23 -0300)] 
res_rtp_asterisk: Don't leak temporary key when enabling PFS.

A change recently went in which enabled perfect forward secrecy for
DTLS in res_rtp_asterisk. This was accomplished two different ways
depending on the availability of a feature in OpenSSL. The fallback
method created a temporary instance of a key but did not free it.
This change fixes that.

ASTERISK-25265

Change-Id: Iadc031b67a91410bbefb17ffb4218d615d051396

10 years agores_http_websocket: Debug write lengths. 33/1033/1
Mark Michelson [Tue, 4 Aug 2015 14:47:34 +0000 (09:47 -0500)] 
res_http_websocket: Debug write lengths.

Commit 39cc28f6ea2140ad6d561fd4c9e9a66f065cecee attempted to fix a
test failure observed on 32 bit test agents by ensuring that a cast from
a 32 bit unsigned integer to a 64 bit unsigned integer was happening in
a predictable place. As it turns out, this did not cause test runs to
succeed.

This commit adds several redundant debug messages that print the payload
lengths of websocket frames. The idea here is that this commit will not
cause tests to succeed for the faulty test agent, but we might deduce
where the fault lies more easily this way by observing at what point the
expected value (537) changes to some ungangly huge number.

If you are wondering why something like this is being committed to the
branch, keep in mind that in commit
39cc28f6ea2140ad6d561fd4c9e9a66f065cecee I noted that the observed test
failures only happen when automated tests are run. Attempts to run the
tests by hand manually on the test agent result in the tests passing.

Change-Id: I14a65c19d8af40dadcdbd52348de3b0016e1ae8d

10 years agoMerge "res_http_websocket: Avoid passing strlen() to ast_websocket_write()." into 13
Matt Jordan [Mon, 3 Aug 2015 16:51:56 +0000 (11:51 -0500)] 
Merge "res_http_websocket: Avoid passing strlen() to ast_websocket_write()." into 13

10 years agores_http_websocket: Avoid passing strlen() to ast_websocket_write(). 31/1031/1
Mark Michelson [Mon, 3 Aug 2015 16:06:07 +0000 (11:06 -0500)] 
res_http_websocket: Avoid passing strlen() to ast_websocket_write().

We have seen a rash of test failures on a 32-bit build agent. Commit
48698a5e21d7307f61b5fb2bd39fd593bc1423ca solved an obvious problem where
we were not encoding a 64-bit value correctly over the wire. This
commit, however, did not solve the test failures.

In the failing tests, ARI is attempting to send a 537 byte text frame
over a websocket. When sending a frame this small, 16 bits are all that
is required in order to encode the payload length on the websocket
frame. However, ast_websocket_write() thinks that the payload length is
greater than 65535 and therefore writes out a 64 bit payload length.
Inspecting this payload length, the lower 32 bits are exactly what we
would expect it to be, 537 in hex. The upper 32 bits, are junk values
that are not expected to be there.

In the failure, we are passing the result of strlen() to a function that
expects a uint64_t parameter to be passed in. strlen() returns a size_t,
which on this 32-bit machine is 32 bits wide. Normally, passing a 32-bit
unsigned value to somewhere where a 64-bit unsigned value is expected
would cause no problems. In fact, in manual runs of failing tests, this
works just fine. However, ast_websocket_write() uses the Asterisk
optional API, which means that rather than a simple function call, there
are a series of macros that are used for its declaration and
implementation. These macros may be causing some sort of error to occur
when converting from a 32 bit quantity to a 64 bit quantity.

This commit changes the logic by making existing ast_websocket_write()
calls use ast_websocket_write_string() instead. Within
ast_websocket_write_string(), the 64-bit converted strlen is saved in a
local variable, and that variable is passed to ast_websocket_write()
instead.

Note that this commit message is full of speculation rather than
certainty. This is because the observed test failures, while always
present in automated test runs, never occur when tests are manually
attempted on the same test agent. The idea behind this commit is to fix
a theoretical issue by performing changes that should, at the least,
cause no harm. If it turns out that this change does not fix the failing
tests, then this commit should be reverted.

Change-Id: I4458dd87d785ca322b89c152b223a540a3d23e67

10 years agores/res_rtp_asterisk: Add ECDH support 30/1030/1
Mark Duncan [Tue, 28 Jul 2015 10:33:39 +0000 (19:33 +0900)] 
res/res_rtp_asterisk: Add ECDH support

This will add ECDH support to Asterisk. It will
detect auto ECDH support in OpenSSL
(1.0.2b and above) during ./configure. If this is
available, it will use it,
otherwise it will fall back to prime256v1 (this
behavior is consistent with
other projects such as Apache and nginx).

This fixes WebRTC being broken in Firefox 38+ due
to Firefox now only supporting
ciphers with perfect forward secrecy.

ASTERISK-25265 #close

Change-Id: I8c13b33a2a79c0bde2e69e4ba6afa5ab9351465b

10 years agoMerge topic 'misc_rtp_tweaks' into 13
Joshua Colp [Mon, 3 Aug 2015 13:43:50 +0000 (08:43 -0500)] 
Merge topic 'misc_rtp_tweaks' into 13

* changes:
  rtp_engine.h: No sense allowing payload types larger than RFC allows.
  rtp_engine.c: Minor tweaks.
  rtp_engine.h: Misc comment fixes.
  chan_sip.c: Tweak glue->update_peer() parameter nil value.

10 years agoMerge "ARI: Rotate log channels." into 13
Mark Michelson [Fri, 31 Jul 2015 16:57:39 +0000 (11:57 -0500)] 
Merge "ARI: Rotate log channels." into 13

10 years agoARI: Rotate log channels. 88/988/5
Benjamin Ford [Wed, 29 Jul 2015 19:17:09 +0000 (14:17 -0500)] 
ARI: Rotate log channels.

An http request can be sent to rotate a specified log channel.
If the channel does not exist, an error response will be
returned.

The command "curl -v -u user:pass -X PUT 'http://localhost:8088
/ari/asterisk/logging/logChannelName/rotate'" can be run in the
terminal to access this new functionality.

* Added the ability to rotate log files through ARI

ASTERISK-25252

Change-Id: Iaefa21cbbc1b29effb33004ee3d89c977e76ab01

10 years agortp_engine.c: Fix performance issue with several channel drivers that use RTP. 08/1008/1
Richard Mudgett [Wed, 29 Jul 2015 18:49:47 +0000 (13:49 -0500)] 
rtp_engine.c: Fix performance issue with several channel drivers that use RTP.

ast_rtp_codecs_get_payload() gets called once or twice for every received
RTP frame so it would be nice to not allocate an ao2 object to then have
it destroyed shortly thereafter.  The ao2 object gets allocated only if
the payload type is not set by the channel driver as a negotiated value.
The issue affects chan_skinny, chan_unistim, chan_rtp, and chan_ooh323.

* Made static_RTP_PT[] an array of ao2 objects that
ast_rtp_codecs_get_payload() can return instead of an array of structs
that must be copied into a created ao2 object.

ASTERISK-25296 #close
Reported by: Richard Mudgett

Change-Id: Icb6de5cd90bfae07d44403a1352963db9109dac0

10 years agores_rtp_asterisk.c: Fix off-nominal crash potential. 07/1007/1
Richard Mudgett [Wed, 29 Jul 2015 22:00:05 +0000 (17:00 -0500)] 
res_rtp_asterisk.c: Fix off-nominal crash potential.

ASTERISK-25296
Reported by: Richard Mudgett

Change-Id: I08549fb7c3ab40a559f41a3940f3732a4059b55b

10 years agortp_engine.c: Must protect mime_types_len with mime_types_lock. 06/1006/1
Richard Mudgett [Wed, 29 Jul 2015 18:48:12 +0000 (13:48 -0500)] 
rtp_engine.c: Must protect mime_types_len with mime_types_lock.

Change-Id: I44220dd369cc151ebf5281d5119d84bb9e54d54e

10 years agores_pjsip_sdp_rtp.c: Fix processing wrong SDP media list. 04/1004/1
Richard Mudgett [Fri, 24 Jul 2015 23:42:29 +0000 (18:42 -0500)] 
res_pjsip_sdp_rtp.c: Fix processing wrong SDP media list.

Change-Id: I7c076826c2d3c6ae8c923ca73b7a71980cca11f2

10 years agores_pjsip_sdp_rtp.c: Fixup some whitespace. 05/1005/1
Richard Mudgett [Fri, 24 Jul 2015 23:38:11 +0000 (18:38 -0500)] 
res_pjsip_sdp_rtp.c: Fixup some whitespace.

Change-Id: Ib4eb7ef7dcaf93ddc26538f0a498aaf110d7a973

10 years agortp_engine.h: No sense allowing payload types larger than RFC allows. 03/1003/1
Richard Mudgett [Tue, 28 Jul 2015 00:10:11 +0000 (19:10 -0500)] 
rtp_engine.h: No sense allowing payload types larger than RFC allows.

* Tweaked add_static_payload() to not use magic numbers.

Change-Id: I1719ff0f6d3ce537a91572501eae5bcd912a420b

10 years agortp_engine.c: Minor tweaks. 02/1002/1
Richard Mudgett [Thu, 23 Jul 2015 19:04:16 +0000 (14:04 -0500)] 
rtp_engine.c: Minor tweaks.

* Fix off nominial ref leak of new_type in
ast_rtp_codecs_payloads_set_m_type().

* No need to lock static_RTP_PT_lock in
ast_rtp_codecs_payloads_set_m_type() and
ast_rtp_codecs_payloads_set_rtpmap_type_rate() before the payload type
parameter sanity check.

* No need to create ast_rtp_payload_type ao2 objects with a lock since the
lock is not used.

Change-Id: I64dd1bb4dfabdc7e981e3f61448beac9bb7504d4

10 years agortp_engine.h: Misc comment fixes. 01/1001/1
Richard Mudgett [Thu, 23 Jul 2015 17:41:12 +0000 (12:41 -0500)] 
rtp_engine.h: Misc comment fixes.

Change-Id: If98139264d5d97427b4685ecbdc54518f725bc43

10 years agochan_sip.c: Tweak glue->update_peer() parameter nil value. 00/1000/1
Richard Mudgett [Fri, 17 Jul 2015 21:23:53 +0000 (16:23 -0500)] 
chan_sip.c: Tweak glue->update_peer() parameter nil value.

Change glue->update_peer() parameter from 0 to NULL to better indicate it
is a pointer.

Change-Id: I8ff2e5087f0e19f6998e3488a712a2470cc823bd

10 years agores_pjsip_session.c: Fix crashes seen when call cancelled. 95/995/1
Richard Mudgett [Thu, 30 Jul 2015 22:05:57 +0000 (17:05 -0500)] 
res_pjsip_session.c: Fix crashes seen when call cancelled.

Two testsuite tests crashed in the same place as a result of an INVITE
being CANCELed.

tests/channels/pjsip/resolver/srv/failover/in_dialog/transport_unspecified
tests/channels/pjsip/resolver/srv/failover/in_dialog/transport_tcp

The session pointer is no longer in the inv->mod_data[session_module.id]
location because the INVITE transaction has reached the terminated state.

ASTERISK-25297 #close
Reported by: Richard Mudgett

Change-Id: Idb75fdca0321f5447d5dac737a632a5f03614427

10 years agoMerge "Add a test event for inband ringing." into 13
Joshua Colp [Thu, 30 Jul 2015 21:56:00 +0000 (16:56 -0500)] 
Merge "Add a test event for inband ringing." into 13

10 years agores_http_websocket: Properly encode 64 bit payload 90/990/1
Mark Michelson [Wed, 29 Jul 2015 19:35:58 +0000 (14:35 -0500)] 
res_http_websocket: Properly encode 64 bit payload

A test agent was continuously failing all ARI tests when run against
Asterisk 13. As it turns out, the reason for this is that on those test
runs, for some reason we decided to use the super extended 64 bit
payload length for websocket text frames instead of the extended 16 bit
payload length. For 64-bit payloads, the expected byte order over the
network is

7, 6, 5, 4, 3, 2, 1, 0

However, we were sending the payload as

3, 2, 1, 0, 7, 6, 5, 4

This meant that we were saying to expect an absolutely MASSIVE payload
to arrive. Since we did not follow through on this expected payload
size, the client would sit patiently waiting for the rest of the payload
to arrive until the test would time out.

With this change, we use the htobe64() function instead of htonl() so
that a 64-bit byte-swap is performed instead of a 32 bit byte-swap.

Change-Id: Ibcd8552392845fbcdd017a8c8c1043b7fe35964a

10 years agoAdd a test event for inband ringing. 83/983/1
Mark Michelson [Wed, 29 Jul 2015 17:23:43 +0000 (12:23 -0500)] 
Add a test event for inband ringing.

This event is necessary for the bridge_wait_e_options test to be able to
confirm that ringing is being played on the local channel that runs the
BridgeWait() application with the e(r) option.

ASTERISK-25292 #close
Reported by Kevin Harwell

Change-Id: Ifd3d3d2bebc73344d4b5310d0d55c7675359d72e

10 years agoMerge "holding_bridge: ensure moh participants get frames" into 13
Mark Michelson [Tue, 28 Jul 2015 22:05:49 +0000 (17:05 -0500)] 
Merge "holding_bridge: ensure moh participants get frames" into 13

10 years agoholding_bridge: ensure moh participants get frames 20/920/3
Jonathan Rose [Thu, 16 Jul 2015 17:16:25 +0000 (12:16 -0500)] 
holding_bridge: ensure moh participants get frames

Currently, if a blank musiconhold.conf is used, musiconhold will fail
to start for a channel going into a holding bridge with an anticipation
of getting music on hold. That being the case, no frames will be written
to the channel and that can pose a problem for blind transfers in PJSIP
which may rely on frames being written to get past the REFER framehook.
This patch makes holding bridges start a silence generator if starting
music on hold fails and makes it so that if no music on hold functions
are installed that the ast_moh_start function will report a failure so
that consumers of that function will be able to respond appropriately.

ASTERISK-25271 #close

Change-Id: I06f066728604943cba0bb0b39fa7cf658a21cd99

10 years agoBump the ARI version to 1.8.0 61/961/1
Matt Jordan [Fri, 24 Jul 2015 17:56:16 +0000 (12:56 -0500)] 
Bump the ARI version to 1.8.0

Due to backwards compatible changes, the ARI version should be bumped to
1.8.0 prior to the release of 13.5.0. Note that a previous patch already
bumped the version of AMI for this release.

Change-Id: I419033bfbbc0d3533a29ccb32b2981f39e0883e7

10 years agopjsip: Add rtp_timeout and rtp_timeout_hold endpoint options. 41/941/3
Joshua Colp [Sat, 18 Jul 2015 16:16:10 +0000 (13:16 -0300)] 
pjsip: Add rtp_timeout and rtp_timeout_hold endpoint options.

This change adds support for the 'rtp_timeout' and 'rtp_timeout_hold'
endpoint options. These allow the channel to be hung up if RTP
is not received from the remote endpoint for a specified number of
seconds.

ASTERISK-25259 #close

Change-Id: I3f39daaa7da2596b5022737b77799d16204175b9

10 years agoMerge "res_pjsip: Add rtp_keepalive to sample config file." into 13
Joshua Colp [Fri, 24 Jul 2015 15:42:56 +0000 (10:42 -0500)] 
Merge "res_pjsip: Add rtp_keepalive to sample config file." into 13

10 years agores_pjsip: Add rtp_keepalive to sample config file. 58/958/1
Mark Michelson [Fri, 24 Jul 2015 14:46:53 +0000 (09:46 -0500)] 
res_pjsip: Add rtp_keepalive to sample config file.

Change-Id: I5f62d0c5684f8b2335f9f8ac2d79ee04fbdafb19

10 years agoLocal channels: Alternate solution to ringback problem. 54/954/3
Mark Michelson [Thu, 23 Jul 2015 18:11:42 +0000 (13:11 -0500)] 
Local channels: Alternate solution to ringback problem.

Commit 54b25c80c8387aea9eb20f9f4f077486cbdf3e5d solved an issue where a
specific scenario involving local channels and a native local RTP bridge
could result in ringback still being heard on a calling channel even
after the call is bridged.

That commit caused many tests in the testsuite to fail with alarming
consequences, such as not sending DialBegin and DialEnd events, and
giving incorrect hangup causes during calls.

This commit reverts the previous commit and implements and alternate
solution. This new solution involves only passing AST_CONTROL_RINGING
frames across local channels if the local channel is in AST_STATE_RING.
Otherwise, the frame does not traverse the local channels. By doing
this, we can ensure that a playtones generator does not get started on
the calling channel but rather is started on the local channel on which
the ringing frame was initially indicated.

ASTERISK-25250 #close
Reported by Etienne Lessard

Change-Id: I3bc87a18a38eb2b68064f732d098edceb5c19f39

10 years agoMerge "audiohook: Use manipulated frame instead of dropping it." into 13
Matt Jordan [Thu, 23 Jul 2015 01:02:26 +0000 (20:02 -0500)] 
Merge "audiohook: Use manipulated frame instead of dropping it." into 13

10 years agoMerge "Local channels: Do not block control -1 payloads." into 13
Joshua Colp [Wed, 22 Jul 2015 18:19:02 +0000 (13:19 -0500)] 
Merge "Local channels: Do not block control -1 payloads." into 13

10 years agoaudiohook: Use manipulated frame instead of dropping it. 52/952/1
Joshua Colp [Wed, 22 Jul 2015 17:24:47 +0000 (14:24 -0300)] 
audiohook: Use manipulated frame instead of dropping it.

Previous changes to sample rate support in audiohooks accidentally
removed code responsible for allowing the manipulate audiohooks
to work. Without this code the manipulated frame would be dropped
and not used. This change restores it.

ASTERISK-25253 #close

Change-Id: I3ff50664cd82faac8941f976fcdcb3918a50fe13

10 years agoLocal channels: Do not block control -1 payloads. 50/950/1
Mark Michelson [Wed, 22 Jul 2015 14:46:29 +0000 (09:46 -0500)] 
Local channels: Do not block control -1 payloads.

Control frames with a -1 payload are used as a special signal to stop
playtones generators on channels. This indication is sent both by
app_dial as well as by ast_answer() when a call is answered in case any
tones were being generated on a calling channel.

This control frame type was made to stop traversing local channel pairs
as an optimization, because it was thought that it was unnecessary to
send these indications, and allowing such unnecessary control frames to
traverse the local channels would cause the local channels to optimize
away less quickly.

As it turns out, through some special magic dialplan code, it is
possible to have a tones being played on a non-local channel, and it is
important for the local channel to convey that the tones should be
stopped. The result of having tones continue to be played on the
non-local channel is that the tones play even once the channel has been
bridged. By not blocking the -1 control frame type, we can ensure that
this situation does not happen.

ASTERISK-25250 #close
Reported by Etienne Lessard

Change-Id: I0bcaac3d70b619afdbd0ca8a8dd708f33fd2f815

10 years agoaudiohook: Read the correct number of samples based on audiohook format. 45/945/1
Joshua Colp [Wed, 22 Jul 2015 10:16:40 +0000 (07:16 -0300)] 
audiohook: Read the correct number of samples based on audiohook format.

Due to changes in audiohooks to support different sample rates the
underlying storage of samples is in the format of the audiohook
itself and not of the format being requested. This means that if a
channel is using G722 the samples stored will be at 16kHz. If
something subsequently reads from the audiohook at a format which
is not the same sample rate as the audiohook the number of samples
needs to be adjusted.

Given the following example:
1. Channel writing into audiohook at 16kHz (as it is using G722).
2. Chanspy reading from audiohook at 8kHz.

The original code would read 160 samples from the audiohook for
each 20ms of audio. This is incorrect. Since the audio in the
audiohook is at 16kHz the actual number needing to be read is 320.
Failure to read this much would cause the audiohook to reset
itself constantly as the buffer became full.

This change adjusts the requested number of samples by determining
the duration of audio requested and then calculating how many
samples that would be in the audiohook format.

ASTERISK-25247 #close

Change-Id: Ia91ce516121882387a315fd8ee116b118b90653d

10 years agoMerge "Documentation: A couple of trivial fixes in sip.conf.sample and func_cdr.c...
Joshua Colp [Mon, 20 Jul 2015 23:30:40 +0000 (18:30 -0500)] 
Merge "Documentation: A couple of trivial fixes in sip.conf.sample and func_cdr.c" into 13

10 years agoDocumentation: A couple of trivial fixes in sip.conf.sample and func_cdr.c 36/936/1
Rusty Newton [Mon, 20 Jul 2015 17:39:48 +0000 (12:39 -0500)] 
Documentation: A couple of trivial fixes in sip.conf.sample and func_cdr.c

 * In sip.conf.sample fix sentence where we said that WS or WSS are supported
   transports for use in an outbound register definition. They are not
   supported in that case.
 * In func_cdr.c made it clear that the Disable option for CDR_PROP can be used
   to enable CDR on a channel.

ASTERISK-24867 #close
Reported by: Rusty Newton

ASTERISK-24853 #close
Reported by: PSDK

Change-Id: I3d698bc6302b9d00a0a995b5c4ad9a42d69b48ca

10 years agores_pjsip: Add rtp_keepalive endpoint option. 64/864/6
Mark Michelson [Thu, 9 Jul 2015 19:17:53 +0000 (14:17 -0500)] 
res_pjsip: Add rtp_keepalive endpoint option.

This adds an "rtp_keepalive" option for PJSIP endpoints. Similar to the
chan_sip option, this specifies an interval, in seconds, at which we
will send RTP comfort noise frames. This can be useful for keeping RTP
sessions alive as well as keeping NAT associations alive during lulls.

ASTERISK-25242 #close
Reported by Mark Michelson

Change-Id: I06660ba672c0a343814af4cec838e6025cafd54b

10 years agoMerge "chan_pjsip: Don't change formats when frame of unsupported format is received...
Matt Jordan [Mon, 20 Jul 2015 12:31:38 +0000 (07:31 -0500)] 
Merge "chan_pjsip: Don't change formats when frame of unsupported format is received." into 13

10 years agoMerge "res/res_musiconhold: Add a warning when MOH does not exist" into 13
Matt Jordan [Sun, 19 Jul 2015 15:57:50 +0000 (10:57 -0500)] 
Merge "res/res_musiconhold: Add a warning when MOH does not exist" into 13

10 years agoMerge "pbx.c: Post AMI VarSet event if delete a non-empty dialplan variable." into 13
Joshua Colp [Sun, 19 Jul 2015 14:54:38 +0000 (09:54 -0500)] 
Merge "pbx.c: Post AMI VarSet event if delete a non-empty dialplan variable." into 13

10 years agores/res_musiconhold: Add a warning when MOH does not exist 34/934/1
Michael Cargile [Thu, 16 Jul 2015 14:13:10 +0000 (10:13 -0400)] 
res/res_musiconhold: Add a warning when MOH does not exist

Change-Id: Ifdfbd0b97cf31478d29923ec30aabce28d01740b