]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
9 years agores_pjsip_transport_management: Kill idle TCP connections. 99/2599/2
Mark Michelson [Tue, 8 Mar 2016 18:12:16 +0000 (12:12 -0600)] 
res_pjsip_transport_management: Kill idle TCP connections.

"Idle" here means that someone connects to us and does not send a SIP
request. PJProject will not automatically time out such connections, so
it's up to Asterisk to do it instead.

When we receive an incoming TCP connection, we will start a timer
(equivalent to transaction timer D) waiting to receive an incoming
request. If we do not receive a request in that timeframe, then we will
shut down the TCP connection.

ASTERISK-25796 #close
Reported by George Joseph

AST-2016-005

Change-Id: I7b0d303e5d140d0ccaf2f7af562071e3d1130ac6

9 years agoRename res_pjsip_keepalive res_pjsip_transport_management 98/2598/1
Mark Michelson [Tue, 8 Mar 2016 16:52:19 +0000 (10:52 -0600)] 
Rename res_pjsip_keepalive res_pjsip_transport_management

ASTERISK-25796
Reported by George Joseph

AST-2016-005

Change-Id: Id322a05f927392293570599730050bc677d99433

9 years agoMerge "app_voicemail: Fix test_voicemail_notify_endl test." into 13
Joshua Colp [Wed, 13 Apr 2016 10:20:22 +0000 (05:20 -0500)] 
Merge "app_voicemail: Fix test_voicemail_notify_endl test." into 13

9 years agoMerge "res_pjsip_dialog_info: Add missing "direction" attribute in NOTIFY event"...
Joshua Colp [Tue, 12 Apr 2016 18:28:47 +0000 (13:28 -0500)] 
Merge "res_pjsip_dialog_info: Add missing "direction" attribute in NOTIFY event" into 13

9 years agoapp_voicemail: Fix test_voicemail_notify_endl test. 76/2576/1
Joshua Colp [Tue, 12 Apr 2016 14:10:45 +0000 (11:10 -0300)] 
app_voicemail: Fix test_voicemail_notify_endl test.

The test_voicemail_notify_endl test checks the end-of-line
characters of an email message to confirm that they are consistent.
The test wrongfully assumed that reading from the email message
into a buffer will always result in more than 1 character being
read. This is incorrect. If only 1 character was read the test
would go outside of the buffer and access other memory causing
a crash.

The test now checks to ensure that 2 or more characters are read
in ensuring the test stays within the buffer.

ASTERISK-25874 #close

Change-Id: Ic2c89cea6e90f2c0bc2d8138306ebbffd4f8b710

9 years agoMerge "res_pjsip: Add headers to AMI Event ContactStatusDetail" into 13
zuul [Tue, 12 Apr 2016 12:35:01 +0000 (07:35 -0500)] 
Merge "res_pjsip: Add headers to AMI Event ContactStatusDetail" into 13

9 years agores_pjsip: Add headers to AMI Event ContactStatusDetail 55/2555/4
Alexei Gradinari [Thu, 7 Apr 2016 21:18:03 +0000 (17:18 -0400)] 
res_pjsip: Add headers to AMI Event ContactStatusDetail

* Added Useragent and RegExpire headers to AMI Event
ContactStatusDetail with associated documentation.

ASTERISK-25903 #close

Change-Id: If3d121e943e588d016ba51d4eb9c6a421a562239

9 years agoMerge "res_pjsip_outbound_publish: Add transport for outbound PUBLISH" into 13
zuul [Tue, 12 Apr 2016 02:26:28 +0000 (21:26 -0500)] 
Merge "res_pjsip_outbound_publish: Add transport for outbound PUBLISH" into 13

9 years agoMerge "alembic: Remove batch operations (and sqlite support)" into 13
zuul [Tue, 12 Apr 2016 01:43:18 +0000 (20:43 -0500)] 
Merge "alembic:  Remove batch operations (and sqlite support)" into 13

9 years agoMerge "core_unreal: Fix hangupcauses not getting set on Local channels" into 13
Joshua Colp [Mon, 11 Apr 2016 23:02:42 +0000 (18:02 -0500)] 
Merge "core_unreal: Fix hangupcauses not getting set on Local channels" into 13

9 years agoMerge "res_pjsip contact: Lock expiration/addition of contacts" into 13
zuul [Mon, 11 Apr 2016 21:29:38 +0000 (16:29 -0500)] 
Merge "res_pjsip contact:  Lock expiration/addition of contacts" into 13

9 years agocore_unreal: Fix hangupcauses not getting set on Local channels 70/2570/2
Jaco Kroon [Mon, 11 Apr 2016 19:26:57 +0000 (21:26 +0200)] 
core_unreal: Fix hangupcauses not getting set on Local channels

ASTERISK-25912 #close

Change-Id: I8e72e6894feaf36c9450f2788d205d07baec23aa

9 years agoMerge "app_voicemail/IMAP: IMAP access FATAL error: Out of memory" into 13
zuul [Mon, 11 Apr 2016 19:10:51 +0000 (14:10 -0500)] 
Merge "app_voicemail/IMAP: IMAP access FATAL error: Out of memory" into 13

9 years agores_pjsip contact: Lock expiration/addition of contacts 25/2525/5
George Joseph [Fri, 1 Apr 2016 18:30:56 +0000 (12:30 -0600)] 
res_pjsip contact:  Lock expiration/addition of contacts

Contact expiration can occur in several places:  res_pjsip_registrar,
res_pjsip_registrar_expire, and automatically when anyone calls
ast_sip_location_retrieve_aor_contact.  At the same time, res_pjsip_registrar
may also be attempting to renew or add a contact.  Since none of this was locked
it was possible for one thread to be renewing a contact and another thread to
expire it immediately because it was working off of stale data.  This was the
casue of intermittent registration/inbound/nominal/multiple_contacts test
failures.

Now, the new named lock functionality is used to lock the aor during contact
expire and add operations and res_pjsip_registrar_expire now checks the
expiration with the lock held before deleting the contact.

ASTERISK-25885 #close
Reported-by: Josh Colp
Change-Id: I83d413c46a47796f3ab052ca3b349f21cca47059

9 years agoMerge "lock: Add named lock capability" into 13
zuul [Mon, 11 Apr 2016 17:56:40 +0000 (12:56 -0500)] 
Merge "lock:  Add named lock capability" into 13

9 years agopjproject: Add patch to fix Via IPv6 parsing 66/2566/1
George Joseph [Sun, 10 Apr 2016 19:16:42 +0000 (13:16 -0600)] 
pjproject:  Add patch to fix Via IPv6 parsing

There's a bug in pjproject's sip_parser where the ":" wasn't correctly
interpreted. This is causing IPv6 addresses in the "received" parameter of the
Via header to cause a syntax check failure.

This patch was submitted to Teluu on 4/10/2016.

ASTERISK-25910 #close
Reported-by: Anthony Messina
Change-Id: Ic7e4c4aa14ded61860401ec349f5177568c4d922

9 years agolock: Add named lock capability 21/2521/11
George Joseph [Fri, 1 Apr 2016 01:04:29 +0000 (19:04 -0600)] 
lock:  Add named lock capability

Locking some objects like sorcery objects can be tricky because the underlying
ao2 object may not be the same for all callers.  For instance, two threads that
call ast_sorcery_retrieve_by_id on the same aor name might actually get 2
different ao2 objects if the underlying wizard had to rehydrate the aor from a
database. Locking one ao2 object doesn't have any effect on the other even if
those objects had locks in the first place.

Named locks allow access control by keyspace and key strings.  Now an "aor"
named "1000" can be locked and any other thread attempting to lock "aor" "1000"
will wait regardless of whether the underlying ao2 object is the same or not.
Mutex and rwlocks are supported.

This capability will initially be used to lock an aor when multiple threads may
be attempting to prune expired contacts from it.

Change-Id: If258c0b7f92b02d07243ce70e535821a1ea7fb45

9 years agores_pjsip_outbound_publish: Add transport for outbound PUBLISH 37/2537/6
Alexei Gradinari [Tue, 5 Apr 2016 21:56:39 +0000 (17:56 -0400)] 
res_pjsip_outbound_publish: Add transport for outbound PUBLISH

The first available transport of the appropriate type is used now.
This patch adds new config option 'transport' for outbound-publish.
If transport is set then outbound PUBLISH requests will use this transport.

ASTERISK-25901 #close

Change-Id: Ib389130489b70e36795b0003fa5fd386e2680151

9 years agoMerge "pbx.c: Minor code rearangements." into 13
zuul [Fri, 8 Apr 2016 16:18:33 +0000 (11:18 -0500)] 
Merge "pbx.c: Minor code rearangements." into 13

9 years agores_pjsip_dialog_info: Add missing "direction" attribute in NOTIFY event 57/2557/2
Alexei Gradinari [Thu, 7 Apr 2016 21:39:19 +0000 (17:39 -0400)] 
res_pjsip_dialog_info: Add missing "direction" attribute in NOTIFY event

BLF pickup isn't working on Cisco SPA and Snom phones
if the direction="recipient" attribute is missing in 'dialog' tag.

This patch adds direction="recipient" if extension state is
Ringing.

ASTERISK-24601 #close

Change-Id: I5b2c097ca29fd59e92ba237ca5d397cb1b0bcd8c

9 years agopbx.c: Minor code rearangements. 58/2558/1
Richard Mudgett [Thu, 7 Apr 2016 15:59:13 +0000 (10:59 -0500)] 
pbx.c: Minor code rearangements.

* Pull out a loop invariant.

* Convert an else-if ladder to a switch statement.

Change-Id: I0a95cfa9474a4600b9865f7b444534d275b37e95

9 years agoapp_voicemail/IMAP: IMAP access FATAL error: Out of memory 45/2545/4
Alexei Gradinari [Thu, 7 Apr 2016 16:37:43 +0000 (12:37 -0400)] 
app_voicemail/IMAP: IMAP access FATAL error: Out of memory

Sometimes uw-imap function 'mail_fetchbody' returns huge len
which then pass to uw-imap function 'rfc822_base64'.
uw-imap tries to allocate huge memory and abort() on fail.

This patch check the len.
If the len more than max size (128 Mbytes) log error.
This patch also set variables len, newlen to avoid uninizialezed len.
This patch also check pointer returned by rfc822_base64.

ASTERISK-25899 #close

Change-Id: I4a0e7d655f11abef6a5224e2169df6d5c1f1caca

9 years agopbx: Update doxygen for extension state watchers. 53/2553/1
Richard Mudgett [Thu, 7 Apr 2016 17:26:57 +0000 (12:26 -0500)] 
pbx: Update doxygen for extension state watchers.

Change-Id: Id1403b12136de62a272c01bb355aef65fd2c2d1e

9 years agoalembic: Remove batch operations (and sqlite support) 46/2546/2
George Joseph [Thu, 7 Apr 2016 16:49:43 +0000 (10:49 -0600)] 
alembic:  Remove batch operations (and sqlite support)

Because SQLite doesn't support full ALTER capabilities, alembic scripts
require batch operations.  However, that capability wasn't available until
0.7.0 which some distributions haven't reached yet.  Therefore, the batch
operations introduced in commit 86d6e44cc (review 2319) have been reverted
and SQLite is unsupported again, for now anyway.

Tested the full upgrade and downgrade on MySQL/Mariadb and Postgresql.

ASTERISK-25890 #close
Reported-by: Harley Peters
Change-Id: I82eba5456736320256f6775f5b0b40133f4d1c80

9 years agores_pjsip_registrar_expire: Fix race condition at shutdown. 43/2543/3
Joshua Colp [Thu, 7 Apr 2016 16:05:26 +0000 (13:05 -0300)] 
res_pjsip_registrar_expire: Fix race condition at shutdown.

When shutting down, the PJSIP sorcery is destroyed. The registrar
expiration module queries the PJSIP sorcery to determine what
to expire. As there was no synchronization between termination
of the expiration thread and the unloading of the module it was
possible for the thread to try to access the PJSIP sorcery after
it had been destroyed.

This change ensures that the thread is shut down before allowing
the module to be considered unloaded.

Change-Id: I69fd239edbaaf160c2d37ae00d3ac06e5596fe8b

9 years agores_pjsip: Fix configuration setting of "regcontext". 41/2541/1
Joshua Colp [Wed, 6 Apr 2016 21:28:49 +0000 (18:28 -0300)] 
res_pjsip: Fix configuration setting of "regcontext".

Due to a merge problem two options were swapped causing the
regcontext setting to not get set.

Change-Id: Icb33edc668e7357bacbaec2861a6b5ac64edaff1

9 years agoframe.c: Copy the whole subclass in ast_frdup(). 39/2539/2
Jacek Konieczny [Wed, 6 Apr 2016 13:01:47 +0000 (15:01 +0200)] 
frame.c: Copy the whole subclass in ast_frdup().

The problem is ast_frdup() does not copy whole frame.subclass for voice,
video and image frames, only the format is copied.  For video frames, the
subclass structure contains the .frame_ending flag used to put the RTP
marker where it needs to be.

ASTERISK-25894 #close

Change-Id: I812ca90e84ed5d4f473b997d0dd0d3c5a915fe33

9 years agoMerge "res_pjsip: Handle deferred SDP hold/unhold properly." into 13
Joshua Colp [Wed, 6 Apr 2016 12:03:37 +0000 (07:03 -0500)] 
Merge "res_pjsip: Handle deferred SDP hold/unhold properly." into 13

9 years agores_pjsip: Handle deferred SDP hold/unhold properly. 33/2533/2
Mark Michelson [Tue, 5 Apr 2016 19:23:35 +0000 (14:23 -0500)] 
res_pjsip: Handle deferred SDP hold/unhold properly.

Some SIP devices indicate hold/unhold using deferred SDP reinvites. In
other words, they provide no SDP in the reinvite.

A typical transaction that starts hold might look something like this:

* Device sends reinvite with no SDP
* Asterisk sends 200 OK with SDP indicating sendrecv on streams.
* Device sends ACK with SDP indicating sendonly on streams.

At this point, PJMedia's SDP negotiator saves Asterisk's local state as
being recvonly.

Now, when the device attempts to unhold, it again uses a deferred SDP
reinvite, so we end up doing the following:

* Device sends reinvite with no SDP
* Asterisk sends 200 OK with SDP indicating recvonly on streams
* Device sends ACK with SDP indicating sendonly on streams

The problem here is that Asterisk offered recvonly, and by RFC 3264's
rules, if an offer is recvonly, the answer has to be sendonly. The
result is that the device is not taken off hold.

What is supposed to happen is that Asterisk should indicate sendrecv in
the 200 OK that it sends. This way, the device has the freedom to
indicate sendrecv if it wants the stream taken off hold, or it can
continue to respond with sendonly if the purpose of the reinvite was
something else (like a session timer refresher).

The fix here is to alter the SDP negotiator's state when we receive a
reinvite with no SDP. If the negotiator's state is currently in the
recvonly or inactive state, then we alter our local state to be
sendrecv. This way, we allow the device to indicate the stream state as
desired.

ASTERISK-25854 #close
Reported by Robert McGilvray

Change-Id: I7615737276165eef3a593038413d936247dcc6ed

9 years agoMerge "config: Allow filters when appending to a category" into 13
Joshua Colp [Tue, 5 Apr 2016 20:29:14 +0000 (15:29 -0500)] 
Merge "config:  Allow filters when appending to a category" into 13

9 years agoMerge "res_http_websocket: Make core supported." into 13
Joshua Colp [Tue, 5 Apr 2016 16:40:54 +0000 (11:40 -0500)] 
Merge "res_http_websocket: Make core supported." into 13

9 years agoconfig: Allow filters when appending to a category 87/2487/3
George Joseph [Mon, 28 Mar 2016 04:33:29 +0000 (22:33 -0600)] 
config:  Allow filters when appending to a category

In sorcery based config files where there are multiple categories with the same
name, you can't use the (+) operator to reliably append to a category because
config.c stops looking when it finds the first one with the same name.

Example:

[1000]
type = endpoint

[1000]
type = aor

[1000](+)
authenticate_qualify = yes

This config will fail because config.c appends authenticate_qualify to the
first category it finds, the endpoint, and that's not valid for endpoint.

Solution:

The capability to find a category that contains a certain variable already
exists so the only real change was to parse anything after the '+' that's not a
comma, as a filter string.

[1000]
type = endpoint

[1000]
type = aor

[1000](+type=aor)
authenticate_qualify = yes

This now works as expected.

Although the following example doesn't make any sense for pjsip, you can even
specify multiple filters:

[1000](+type=aor&qualify_frequency=10)

ASTERISK-25868 #close
Reported-by: Nick Repin
Change-Id: I10773da4c79db36fbf1993961992af63d3441580

9 years agores_http_websocket: Make core supported. 31/2531/1
Joshua Colp [Tue, 5 Apr 2016 15:21:32 +0000 (12:21 -0300)] 
res_http_websocket: Make core supported.

Websockets are a core part of ARI support and as such this
module should also be core supported.

Change-Id: I8f9283c6a167152761b92984779bb39e3db51a9c

9 years agoMerge "stringfields: Refactor to allow fields to be added to the end of structures...
Joshua Colp [Tue, 5 Apr 2016 15:10:52 +0000 (10:10 -0500)] 
Merge "stringfields:  Refactor to allow fields to be added to the end of structures" into 13

9 years agoMerge "res_rtp_asterisk: Use separate SRTP session for RTCP with DTLS" into 13
Joshua Colp [Tue, 5 Apr 2016 10:37:09 +0000 (05:37 -0500)] 
Merge "res_rtp_asterisk: Use separate SRTP session for RTCP with DTLS" into 13

9 years agostringfields: Refactor to allow fields to be added to the end of structures 77/2477/9
George Joseph [Sat, 26 Mar 2016 04:22:34 +0000 (22:22 -0600)] 
stringfields:  Refactor to allow fields to be added to the end of structures

String fields are great, except that you can't add new ones without breaking
ABI compatibility because it shifts down everything else in the structure.
The only alternative is to add your own char * field to the end of the
structure and manage the memory yourself which isn't ideal, especially since
you then can't use the OPT_STRINGFIELD_T type.

Background:

The reason string fields had to be declared inside the
AST_DECLARE_STRING_FIELDS block was to facilitate iteration over all declared
fields for initialization, compare and copy.  Since AST_DECLARE_STRING_FIELDS
declared the pool, then the fields, then the manager, you could use the offsets
of the pool and manager and iterate over the sequential addresses in between to
access the fields. The actual pool, field allocation and field set operations
don't actually care where the field is.  It's just iteration over the fields
that was the problem.

Solution: Extended String Fields

An extended string field is one that is declared outside the
AST_DECLARE_STRING_FIELDS block but still (anywhere) inside the parent
structure.  Other than using AST_STRING_FIELD_EXTENDED instead of
AST_STRING_FIELD, it looks the same as other string fields.  It's storage comes
from the pool and it participates in string field compare and copy operations
peformed on the parent structure. It's also a valid target for the
OPT_STRINGFIELD_T aco option type.

Implementation:

To keep track of the extended fields and make sure that ABI isn't broken, the
existing embedded_pool pointer in the manager structure was repurposed to be a
pointer to a separate header structure that contains the embedded_pool pointer
plus a vector of fields.  The length of the manager structure didn't change and
the embedded_pool pointer isn't used in the macros, only the stringfields C
code.  A side benefit of this is that changing the header structure in the
future won't break ABI.

ast_string_fields_init initializes the normal string fields and appends them to
the vector, and subsequent calls to ast_string_field_init_extended initialize
and append the extended fields. Cleanup, ast_string_fields_cmp, and
ast_string_fields_copy can now work on the vector instead of sequentially
traversing the addresses between the pool and manager.

The total size of a structure using string fields didn't change, whether using
extended fields or not, nor have the offsets of any structure members, either
inside the original block or outside.  Adding an extended field to the end of a
structure is the same as adding a char *.

Details:

The stringfield C code was pulled out from utils.c and into stringfields.c.
It just made sense.

Additional work was done in ast_string_field_init and
ast_calloc_with_stringfields to handle the allocation of the new header
structure and the vector, and the associated cleanup.  In the process some
additional NULL pointer checking was added.

A lot of work was done in stringfields.h since the logic for compare and copy
is there.  Documentation was added as well as somne additional NULL checking.

The ability to call ast_calloc_with_stringfields with a number of structures
greater than 1 never really worked.  Well, the calloc worked but there was no
way to access the additional structures or clean them up.  It was agreed that
there was no use case for requesting more than 1 structure so an ast_assert
was added to prevent it and the iteration code removed.

Testing:

The stringfield unit tests were updated to test both normal and extended
fields.  Tests for ast_string_field_ptr_set_by_fields and
ast_calloc_with_stringfields were also added.

As an ABI test, 13 was compiled from git and the res_pjsip_* modules, except
res_pjsip itself, saved off.  The patch was then added and a full compile and
install was performed.  Then the older res_pjsip_* moduled were copied over the
installed versions so res_pjsip was new and the rest were old.  No issues.

contact->aor, which is a char * at the end of contact, was then changed to an
extended string field and a recompile and reinstall was performed, again
leaving stock versions of the the res_pjsip_* modules.  Again, no issues with
the res_pjsip_* modules using the old stringfield implementation and with
contact->aor as a char *, and res_pjsip itself using the new stringfield
implementation and contact->aor being an extended string field.

Finally, several existing string fields were converted to extended string
fields to test OPT_STRINGFIELD_T.  Again, no issues.

Change-Id: I235db338c5b178f5a13b7946afbaa5d4a0f91d61

9 years agoMerge "res_pjsip_mwi: Fix segv caused by 16c7d8e74a9af13f98c3c22aa9c43ce39965f6b7...
Joshua Colp [Mon, 4 Apr 2016 23:21:29 +0000 (18:21 -0500)] 
Merge "res_pjsip_mwi:  Fix segv caused by 16c7d8e74a9af13f98c3c22aa9c43ce39965f6b7" into 13

9 years agoMerge "install_prereq: Fix check_installed_debs remove subversion" into 13
Joshua Colp [Mon, 4 Apr 2016 23:21:02 +0000 (18:21 -0500)] 
Merge "install_prereq:  Fix check_installed_debs remove subversion" into 13

9 years agores_pjsip_mwi: Fix segv caused by 16c7d8e74a9af13f98c3c22aa9c43ce39965f6b7 29/2529/1
George Joseph [Mon, 4 Apr 2016 23:02:09 +0000 (17:02 -0600)] 
res_pjsip_mwi:  Fix segv caused by 16c7d8e74a9af13f98c3c22aa9c43ce39965f6b7

I forgot the new voicemail_extension wasn't a stringfield and didn't check
for NULL where I should have.

Change-Id: I029482d5c2ab72474838750461bd46b0809c90fb

9 years agoMerge "res_pjsip_mwi: Allow subscribe to vm access extension as an alias" into 13
Joshua Colp [Mon, 4 Apr 2016 19:16:44 +0000 (14:16 -0500)] 
Merge "res_pjsip_mwi:  Allow subscribe to vm access extension as an alias" into 13

9 years agoMerge "res_pjsip_mwi: Add voicemail extension and mwi_subscribe_replaces_unsolicited...
Joshua Colp [Mon, 4 Apr 2016 19:16:02 +0000 (14:16 -0500)] 
Merge "res_pjsip_mwi:  Add voicemail extension and mwi_subscribe_replaces_unsolicited" into 13

9 years agoinstall_prereq: Fix check_installed_debs remove subversion 27/2527/3
George Joseph [Sun, 3 Apr 2016 16:47:30 +0000 (10:47 -0600)] 
install_prereq:  Fix check_installed_debs remove subversion

check_installed_debs wasn't handling virtual packages like libsrtp-dev and
libresample-dev and on multiarch systems it was accidentally filtering out all
packages if any :i386 packages were found instead of just filtering out the
:i386 packages themselves.

Change-Id: Ifd68da0d1ee30cc84df14de3f9b9079d7c3cecda

9 years agoutils.c: Fix typo in handle_show_locks 23/2523/1
George Joseph [Fri, 1 Apr 2016 18:09:50 +0000 (12:09 -0600)] 
utils.c:  Fix typo in handle_show_locks

ast_cli_allow_on_shutdown(e) should have been ast_cli_allow_at_shutdown(e).

Change-Id: I4f092495c0b2bfd85c2651e0b5877bf4d05d9faf

9 years agoMerge "chan_sip: Do not send all codecs on INVITE. Do not break on Session-Timers...
zuul [Thu, 31 Mar 2016 22:03:53 +0000 (17:03 -0500)] 
Merge "chan_sip: Do not send all codecs on INVITE. Do not break on Session-Timers." into 13

9 years agoMerge "res_stasis: Add control ref to playback and recording structs." into 13
zuul [Thu, 31 Mar 2016 18:39:03 +0000 (13:39 -0500)] 
Merge "res_stasis: Add control ref to playback and recording structs." into 13

9 years agoMerge "pjproject_bundled: Fix use of LDCONFIG for shared library link creation"...
Joshua Colp [Thu, 31 Mar 2016 17:35:49 +0000 (12:35 -0500)] 
Merge "pjproject_bundled:  Fix use of LDCONFIG for shared library link creation" into 13

9 years agoMerge "res_stasis: Fix crash on a hanging up channel." into 13
Joshua Colp [Thu, 31 Mar 2016 13:16:15 +0000 (08:16 -0500)] 
Merge "res_stasis: Fix crash on a hanging up channel." into 13

9 years agoMerge "res_stasis_recording.c: Cleanup stasis_app_recording_find_by_name()." into 13
Joshua Colp [Thu, 31 Mar 2016 12:16:10 +0000 (07:16 -0500)] 
Merge "res_stasis_recording.c: Cleanup stasis_app_recording_find_by_name()." into 13

9 years agoMerge "res_rtp_asterisk: Fix placement of txcount increment" into 13
Joshua Colp [Thu, 31 Mar 2016 12:04:48 +0000 (07:04 -0500)] 
Merge "res_rtp_asterisk:  Fix placement of txcount increment" into 13

9 years agoMerge "core_unreal.c: Add clarification comment about channel ref." into 13
zuul [Thu, 31 Mar 2016 05:48:46 +0000 (00:48 -0500)] 
Merge "core_unreal.c: Add clarification comment about channel ref." into 13

9 years agoMerge "res_stasis.c: Protect channel datastore list from stasis end." into 13
zuul [Thu, 31 Mar 2016 05:48:38 +0000 (00:48 -0500)] 
Merge "res_stasis.c: Protect channel datastore list from stasis end." into 13

9 years agopjproject_bundled: Fix use of LDCONFIG for shared library link creation 16/2516/1
George Joseph [Wed, 30 Mar 2016 23:34:42 +0000 (17:34 -0600)] 
pjproject_bundled:  Fix use of LDCONFIG for shared library link creation

LDCONFIG apparently isn't set to something sane on all systems so the creation
of the shared library links fails.  Instead of just testing for non-blank,
main/Makefile now checks that LDCONFIG is actually executable and reverts to
LN if it isn't.

This applies to both libasteriskpj and libasteriskssl.

Thanks to 'abelbeck' for pointing out that the issue was LDCONFIG.

ASTERISK-25873 #close
Reported-by: Hans van Eijsden
Change-Id: I25b76379bc637726ec044b2c0e709b56b3701729

9 years agores_stasis.c: Protect channel datastore list from stasis end. 06/2506/1
Richard Mudgett [Wed, 30 Mar 2016 18:31:44 +0000 (13:31 -0500)] 
res_stasis.c: Protect channel datastore list from stasis end.

Change-Id: Ifadc469590bd4d5368e19d3763db3bd1f80fdb95

9 years agores_ari: Cannot get control also means channel is unavailable. 04/2504/1
Richard Mudgett [Tue, 29 Mar 2016 23:06:24 +0000 (18:06 -0500)] 
res_ari: Cannot get control also means channel is unavailable.

The only caller of ari_bridges_play_found() has this note:

If ari_bridges_play_found fails because the channel is unavailable for
playback, The channel will be removed from the playback list soon.  We can
keep trying to get channels from the list until we either get one that
will work or else there isn't a channel for this bridge anymore, in which
case we'll revert to ari_bridges_play_new.

Change-Id: Ib068141b367ccaa17be0dab4181c98e26c5127d6

9 years agores_stasis_recording.c: Cleanup stasis_app_recording_find_by_name(). 02/2502/1
Richard Mudgett [Tue, 29 Mar 2016 19:29:53 +0000 (14:29 -0500)] 
res_stasis_recording.c: Cleanup stasis_app_recording_find_by_name().

Change-Id: Ic7d93c402c498677a122505558859c853d4e5ac7

9 years agocore_unreal.c: Add clarification comment about channel ref. 00/2500/1
Richard Mudgett [Mon, 28 Mar 2016 19:23:59 +0000 (14:23 -0500)] 
core_unreal.c: Add clarification comment about channel ref.

Change-Id: I0be0627260cd8d6b6c3cc345949dcfdf32eff1f3

9 years agores_stasis: Add control ref to playback and recording structs. 09/2509/1
Richard Mudgett [Tue, 29 Mar 2016 18:47:08 +0000 (13:47 -0500)] 
res_stasis: Add control ref to playback and recording structs.

The stasis_app_playback and stasis_app_recording structs need to have a
struct stasis_app_control ref.  Other threads can get a reference to the
playback and recording structs from their respective global container.
These other threads can then use the control pointer they contain after
the control struct has gone.

* Add control ref to stasis_app_playback and stasis_app_recording structs.

With the refs added, the control command queue can now have a circular
control reference which will cause the control struct to never get
released if the control's command queue is not flushed when the channel
leaves the Stasis application.  Also the command queue needs better
protection from adding commands if the control->is_done flag is set.

* Flush the control command queue on exit.

ASTERISK-25882 #close

Change-Id: I3cf1fb59cbe6f50f20d9e35a2c07ac07d7f4320d

9 years agores_stasis: Fix crash on a hanging up channel. 08/2508/1
Richard Mudgett [Mon, 28 Mar 2016 23:10:40 +0000 (18:10 -0500)] 
res_stasis: Fix crash on a hanging up channel.

* Give the struct stasis_app_control ao2 object a ref to the channel held
in the object.  Now the channel will still be around if a thread needs to
post a stasis message instead of crash because the topic was destroyed.

* Moved stopping any lingering silence generator out of the struct
stasis_app_control destructor and made it a part of exiting the Stasis
application.  Who knows which thread the destructor will be called under
so it cannot affect the channel's silence generator.  Not only was the
channel unprotected when the silence generator was stopped, stasis may no
longer even control the channel.

ASTERISK-25882

Change-Id: I21728161b5fe638cef7976fa36a605043a7497e4

9 years agores_pjsip_mwi: Allow subscribe to vm access extension as an alias 97/2497/1
George Joseph [Wed, 30 Mar 2016 17:38:47 +0000 (11:38 -0600)] 
res_pjsip_mwi:  Allow subscribe to vm access extension as an alias

Background:

If your extension is 1000 and the voicemail access extension is 1571 and you
dial 1571, usually a dialplan rule calls voicemailmain with your extension and
you are placed directly in your mailbox.  Therefore most admins program the
voicemail (or other speed dial) button on their phones to the access extension.
Some phones (Snom at least) use whatever is programmed there to also subscribe
for MWI and so can't dial one number and subscribe to another.  This works fine
in chan_sip because chan_sip completely ignores the user portion of the
SUBSCRIBE message request URI.  If it can match the peer, is subscribes to the
peer's mailbox.  The user could be set to anything or nothing and you'd still
get subscribed to your mailbox.

Issue:

chan_pjsip actually uses the user portion of the URI to find an aor and its
mailboxes.  Therefore a subscribe to 1571 results in a 404.  Sure, you can
create an aor for 1571 but you certainly can't add your entire voicemail
system's mailboxes to it and everyone would get notified of every MWI.

Solution:

When an MWI subscribe comes in and an aor can't be found that matches the
resource directly, check the resource against the endpoint's aors.  If an aor
is found that has a voicemail_extension that matches the resource, use it.

ASTERISK-25865
Reported-by: Ross Beer
Change-Id: I770ea185f751f1ada888fafb4b452115f1c06e9e

9 years agores_pjsip_mwi: Add voicemail extension and mwi_subscribe_replaces_unsolicited 64/2464/10
George Joseph [Fri, 25 Mar 2016 03:55:03 +0000 (21:55 -0600)] 
res_pjsip_mwi:  Add voicemail extension and mwi_subscribe_replaces_unsolicited

res_pjsip_mwi was missing the chan_sip "vmexten" functionality which adds
the Message-Account header to the MWI NOTIFY.  Also, specifying mailboxes
on endpoints for unsolicited mwi and on aors for subscriptions required
that the admin know in advance which the client wanted.  If you specified
mailboxes on the endpoint, subscriptions were rejected even if you also
specified mailboxes on the aor.

Voicemail extension:
* Added a global default_voicemail_extension which defaults to "".
* Added voicemail_extension to both endpoint and aor.
* Added ast_sip_subscription_get_dialog for support.
* Added ast_sip_subscription_get_sip_uri for support.

When an unsolicited NOTIFY is constructed, the From header is parsed, the
voicemail extension from the endpoint is substituted for the user, and the
result placed in the Message-Account field in the body.

When a subscribed NOTIFY is constructed, the subscription dialog local uri
is parsed, the voicemail_extension from the aor (looked up from the
subscription resource name) is substituted for the user, and the result
placed in the Message-Account field in the body.

If no voicemail extension was defined, the Message-Account field is not added
to the NOTIFY body.

mwi_subscribe_replaces_unsolicited:
* Added mwi_subscribe_replaces_unsolicited to endpoint.

The previous behavior was to reject a subscribe if a previous internal
subscription for unsolicited MWI was found for the mailbox.  That remains the
default.  However, if there are mailboxes also set on the aor and the client
subscribes and mwi_subscribe_replaces_unsolicited is set, the existing internal
subscription is removed and replaced with the external subscription.  This
allows an admin to configure mailboxes on both the endpoint and aor and allows
the client to select which to use.

ASTERISK-25865 #close
Reported-by: Ross Beer
Change-Id: Ic15a9415091760539c7134a5ba3dc4a6a1217cea

9 years agoMerge "res_pjsip/pjsip_options: Fix From generation on outgoing OPTIONS" into 13
Joshua Colp [Wed, 30 Mar 2016 15:52:44 +0000 (10:52 -0500)] 
Merge "res_pjsip/pjsip_options:  Fix From generation on outgoing OPTIONS" into 13

9 years agores_rtp_asterisk: Fix placement of txcount increment 94/2494/1
George Joseph [Wed, 30 Mar 2016 14:46:32 +0000 (08:46 -0600)] 
res_rtp_asterisk:  Fix placement of txcount increment

Commit 1bce690ccb36a4744a327c07af23a9a3a0fa20cd was incrementing txcount
for rtcp packets as well as rtp packets and that was causing sender reports
to be generated instead of receiver reports in cases where no rtp was actually
being sent.

Moved the txcount increment from __rtp_sento, which handles both rtp and rtcp,
to rtp_sento which only handles rtp packets.

Discovered by the hep/rtcp-receiver test.

Change-Id: Ie442e4bb947a68847a676497021ba10ffaf376d5

9 years agochan_pjsip: Add 'pjsip show channelstats' 80/2480/2
George Joseph [Sun, 27 Mar 2016 03:33:14 +0000 (21:33 -0600)] 
chan_pjsip:  Add 'pjsip show channelstats'

Added the ability to show channel statistics to chan_pjsip (cli_functions.c)

Moved the existing 'pjsip show channel(s)' functionality from
pjsip_configuration to cli_functions.c.  The stats needed chan_pjsip's
private header so it made sense to move the existing channel commands as well.

Now using stasis_cache_dump to get the channel snapshots rather than retrieving
all endpoints, then getting each one's channel snapshots.  Much more efficient.

Change-Id: I03b114522126d27434030b285bf6d531ddd79869

9 years agoMerge "res_rtp_asterisk: Fix packet stats on bridged connection" into 13
zuul [Tue, 29 Mar 2016 19:28:36 +0000 (14:28 -0500)] 
Merge "res_rtp_asterisk:  Fix packet stats on bridged connection" into 13

9 years agores_pjsip/pjsip_options: Fix From generation on outgoing OPTIONS 73/2373/9
George Joseph [Fri, 11 Mar 2016 01:52:14 +0000 (18:52 -0700)] 
res_pjsip/pjsip_options:  Fix From generation on outgoing OPTIONS

No one seemed to notice but every time an OPTIONS goes out, it goes
out with a From of "asterisk" (or whatever the default from_user is set to),
even if you specify an endpoint.

The issue had several causes...
qualify_contact is only called with an endpoint if called from the CLI.
If the endpoint is NULL, qualify_contact only looks up the endpoint if
authenticate_qualify=yes. Even then, it never passes it on to
ast_sip_create_request where the From header is set.  Therefore From
is always "asterisk" (or whatever the default from_user is set to).
Even if ast_sip_create_request were to get an endpoint, it only sets
the From if endpoint->from_user is set.

The fix is 4 parts...

First, create_out_of_dialog_request was modified to use the endpoint id
if endpoint was specified and from_user is not set.

Second, qualify_contact was modified to always look up an endpoint if
one wasn't specified regardless of authenticate_qualify.  It then passes
the endpoint on to create_out_of_dialog_request.

Third (and most importantly), find_an_endpoint was modified to find
an endpoint by using an "aors LIKE %contact->aor%" predicate with
ast_sorcery_retrieve_by_fields.  As such, this patch will only work
if the sorcery realtime optimizations patch goes in.  Otherwise we'd
be pulling the entire endpoints database every time we send an OPTIONS.
Since we already know the contact's aor, the on_endpoint callback was also
modified to just check if the contact->aor is an exact match to one of
the endpoint's.

Finally, since we now have an endpoint for every OPTIONS request,
res_pjsip/endpt_send_request (which handles out-of-dialog reqests) was
updated to get the transport from the endpoint and set it on tdata.
Now the correct transport is used.

Change-Id: I2207e12bb435e373bd1e03ad091d82e5aba011af

9 years agoMerge "sorcery/res_pjsip: Refactor for realtime performance" into 13
Joshua Colp [Tue, 29 Mar 2016 18:16:17 +0000 (13:16 -0500)] 
Merge "sorcery/res_pjsip:  Refactor for realtime performance" into 13

9 years agoMerge "app_echo: forward and generate VIDUPDATE frames" into 13
Joshua Colp [Tue, 29 Mar 2016 17:46:38 +0000 (12:46 -0500)] 
Merge "app_echo: forward and generate VIDUPDATE frames" into 13

9 years agores_rtp_asterisk: Use separate SRTP session for RTCP with DTLS 68/2468/3
Jacek Konieczny [Fri, 25 Mar 2016 15:59:05 +0000 (16:59 +0100)] 
res_rtp_asterisk: Use separate SRTP session for RTCP with DTLS

Asterisk uses separate UDP ports for RTP and RTCP traffic and RFC 5764
explicitly states:

  There MUST be a separate DTLS-SRTP session for each distinct pair of
  source and destination ports used by a media session

This means RTP keying material cannot be used for DTLS RTCP, which was
the reason why RTCP encryption would fail.

ASTERISK-25642

Change-Id: I7e8779d8b63e371088081bb113131361b2847e3a

9 years agoMerge "res_parking: Misc fixes." into 13
zuul [Tue, 29 Mar 2016 13:53:45 +0000 (08:53 -0500)] 
Merge "res_parking: Misc fixes." into 13

9 years agoapp_echo: forward and generate VIDUPDATE frames 67/2467/3
Jacek Konieczny [Fri, 25 Mar 2016 15:42:12 +0000 (16:42 +0100)] 
app_echo: forward and generate VIDUPDATE frames

When using app_echo via WebRTC with VP8 video the video would appear
only after a few minutes, because there would be nothing to request
a full reference frame.

This fixes the problem in both ways:
- echos any VIDUPDATE frames received on the channel
- sends one such frame when first video frame is to be forwarded

This makes the echo work with Firefox and Chrome WebRTC implementation.

ASTERISK-25867 #close

Change-Id: I73bda87bf7532ee8bfb28d917045a21034908c1e

9 years agores_rtp_asterisk: Fix packet stats on bridged connection 78/2478/3
George Joseph [Sun, 27 Mar 2016 17:53:16 +0000 (11:53 -0600)] 
res_rtp_asterisk:  Fix packet stats on bridged connection

rxcount, txcount, rxoctetcount and txoctetcount weren't being calculated
for bridged streams because the calulations were being done after the
bridged short-circuit.  Actually, rxoctetcount wasn't ever being calculated.

Moved the calculations so they occur for all valid received packets and
all transmitted packets.  Also added rxoctetcount and txoctetcount to
ast_rtp_instance_stat.

Change-Id: I08fb06011a82d38c3b4068867a615068fbe59cbb

9 years agoMerge "res_parking: Fix blind transfer dynamic lots creation." into 13
Joshua Colp [Sat, 26 Mar 2016 19:25:53 +0000 (14:25 -0500)] 
Merge "res_parking: Fix blind transfer dynamic lots creation." into 13

9 years agoMerge "res_parking: Cleanup find_channel_parking_lot_name() usage." into 13
zuul [Sat, 26 Mar 2016 16:33:00 +0000 (11:33 -0500)] 
Merge "res_parking: Cleanup find_channel_parking_lot_name() usage." into 13

9 years agores_parking: Fix blind transfer dynamic lots creation. 69/2469/3
Richard Mudgett [Sat, 26 Mar 2016 04:19:22 +0000 (23:19 -0500)] 
res_parking: Fix blind transfer dynamic lots creation.

Blind transfers to a recognized parking extension need to use the parker's
channel variable values to create the dynamic parking lot.  This is
because there is always only one parker while the parkee may actually be a
multi-party bridge.  A multi-party bridge can never supply the needed
channel variables to create the dynamic parking lot.  In the multi-party
bridge blind transfer scenario, the parker's CHANNEL(parkinglot) value and
channel variables are inherited by the local channel used to park the
bridge.

* In park_common_setup(), make use the parker instead of the parkee to
supply the dynamic parking lot channel variable values.  In all but one
case, the parkee is the same as the parker.  However, in the recognized
parking extension blind transfer scenario for a two party bridge they are
different channels.  For consistency, we need to use the parker channel.

* In park_local_transfer(), pass the CHANNEL(parkinglot) value to the
local channel when blind transferring a multi-party bridge to a recognized
parking extension.

* When a local channel starts a call, the Local;2 side needs to inherit
the CHANNEL(parkinglot) value from Local;1.

The DTMF one-touch parking case wasn't even trying to create dynamic
parking lots before it aborted the attempt.

* In parking_park_call(), add missing code to create a dynamic parking
lot.

A DTMF bridge hook is documented as returning -1 to remove the hook.
Though the hook caller is really coded to accept non-zero.  See the
ast_bridge_hook_callback typedef.

* In feature_park_call(), don't remove the DTMF one-touch parking hook
because of an error.

ASTERISK-24605 #close
Reported by:  Philip Correia
Patches:
      call_park.patch (license #6672) patch uploaded by Philip Correia

Change-Id: I221d3a8fcc181877a1158d17004474d35d8016c9

9 years agosorcery/res_pjsip: Refactor for realtime performance 70/2370/15
George Joseph [Tue, 8 Mar 2016 21:55:30 +0000 (14:55 -0700)] 
sorcery/res_pjsip:  Refactor for realtime performance

There were a number of places in the res_pjsip stack that were getting
all endpoints or all aors, and then filtering them locally.

A good example is pjsip_options which, on startup, retrieves all
endpoints, then the aors for those endpoints, then tests the aors to see
if the qualify_frequency is > 0.  One issue was that it never did
anything with the endpoints other than retrieve the aors so we probably
could have skipped a step and just retrieved all aors. But nevermind.

This worked reasonably well with local config files but with a realtime
backend and thousands of objects, this was a nightmare.  The issue
really boiled down to the fact that while realtime supports predicates
that are passed to the database engine, the non-realtime sorcery
backends didn't.

They do now.

The realtime engines have a scheme for doing simple comparisons. They
take in an ast_variable (or list) for matching, and the name of each
variable can contain an operator.  For instance, a name of
"qualify_frequency >" and a value of "0" would create a SQL predicate
that looks like "where qualify_frequency > '0'".  If there's no operator
after the name, the engines add an '=' so a simple name of
"qualify_frequency" and a value of "10" would return exact matches.

The non-realtime backends decide whether to include an object in a
result set by calling ast_sorcery_changeset_create on every object in
the internal container.  However, ast_sorcery_changeset_create only does
exact string matches though so a name of "qualify_frequency >" and a
value of "0" returns nothing because the literal "qualify_frequency >"
doesn't match any name in the objset set.

So, the real task was to create a generic string matcher that can take a
left value, operator and a right value and perform the match. To that
end, strings.c has a new ast_strings_match(left, operator, right)
function.  Left and right are the strings to operate on and the operator
can be a string containing any of the following: = (or NULL or ""), !=,
>, >=, <, <=, like or regex.  If the operator is like or regex, the
right string should be a %-pattern or a regex expression.  If both left
and right can be converted to float, then a numeric comparison is
performed, otherwise a string comparison is performed.

To use this new function on ast_variables, 2 new functions were added to
config.c.  One that compares 2 ast_variables, and one that compares 2
ast_variable lists.  The former is useful when you want to compare 2
ast_variables that happen to be in a list but don't want to traverse the
list.  The latter will traverse the right list and return true if all
the variables in it match the left list.

Now, the backends' fields_cmp functions call ast_variable_lists_match
instead of ast_sorcery_changeset_create and they can now process the
same syntax as the realtime engines.  The realtime backend just passes
the variable list unaltered to the engine.  The only gotcha is that
there's no common realtime engine support for regex so that's been noted
in the api docs for ast_sorcery_retrieve_by_fields.

Only one more change to sorcery was done...  A new config flag
"allow_unqualified_fetch" was added to reg_sorcery_realtime.
"no": ignore fetches if no predicate fields were supplied.
"error": same as no but emit an error. (good for testing)
"yes": allow (the default);
"warn": allow but emit a warning. (good for testing)

Now on to res_pjsip...

pjsip_options was modified to retrieve aors with qualify_frequency > 0
rather than all endpoints then all aors.  Not only was this a big
improvement in realtime retrieval but even for config files there's an
improvement because we're not going through endpoints anymore.

res_pjsip_mwi was modified to retieve only endpoints with something in
the mailboxes field instead of all endpoints then testing mailboxes.

res_pjsip_registrar_expire was completely refactored.  It was retrieving
all contacts then setting up scheduler entries to check for expiration.
Now, it's a single thread (like keepalive) that periodically retrieves
only contacts whose expiration time is < now and deletes them.  A new
contact_expiration_check_interval was added to global with a default of
30 seconds.

Ross Beer reports that with this patch, his Asterisk startup time dropped
from around an hour to under 30 seconds.

There are still objects that can't be filtered at the database like
identifies, transports, and registrations.  These are not going to be
anywhere near as numerous as endpoints, aors, auths, contacts however.

Back to allow_unqualified_fetch.  If this is set to yes and you have a
very large number of objects in the database, the pjsip CLI commands
will attempt to retrive ALL of them if not qualified with a LIKE.
Worse, if you type "pjsip show endpoint <tab>" guess what's going to
happen? :)  Having a cache helps but all the objects will have to be
retrieved at least once to fill the cache.  Setting
allow_unqualified_fetch=no prevents the mass retrieve and should be used
on endpoints, auths, aors, and contacts.  It should NOT be used for
identifies, registrations and transports since these MUST be
retrieved in bulk.

Example sorcery.conf:

[res_pjsip]
endpoint=config,pjsip.conf,criteria=type=endpoint
endpoint=realtime,ps_endpoints,allow_unqualified_fetch=error

ASTERISK-25826 #close
Reported-by: Ross Beer
Tested-by: Ross Beer
Change-Id: Id2691e447db90892890036e663aaf907b2dc1c67

9 years agores_parking: Cleanup find_channel_parking_lot_name() usage. 75/2475/1
Richard Mudgett [Wed, 23 Mar 2016 19:24:49 +0000 (14:24 -0500)] 
res_parking: Cleanup find_channel_parking_lot_name() usage.

Change-Id: I8f7a8890aef27824301c642d4d15407ac83e6f02

9 years agores_parking: Misc fixes. 73/2473/3
Richard Mudgett [Fri, 18 Mar 2016 19:01:02 +0000 (14:01 -0500)] 
res_parking: Misc fixes.

res/parking/parking_applications.c:

* Add malloc fail checks in setup_park_common_datastore().

* Fix playing parking failed announcement to only happen on non-blind
transfers in park_app_exec().  It could never go out before because a test
was provedly always false.

res/parking/parking_bridge.c:

* Fix NULL tolerance in generate_parked_user() because
bridge_parking_push() can theoretically pass a NULL parker channel if the
parker channel went away for some reason.

* Clarify some weird code dealing with blind_transfer in
bridge_parking_push().

res/parking/parking_bridge_features.c:

* Made park_local_transfer() set BLINDTRANSFER on the Local;1 channel
which will be bulk copied to the Local;2 channel on the subsequent
ast_call().  The additional advantage is if the parker channel has the
BLINDTRANSFER and ATTENDEDTRANSFER variables set they are now guaranteed
to be overridden.

res/parking/parking_manager.c:

* Fix AMI Park action input range checking of the Timeout header in
manager_park().

* Reduced locking scope to where needed in manager_park().

res/res_parking.c:

* Fix some off nominal missing unlocks by eliminating the returns.

Change-Id: Ib64945bc285acb05a306dc12e6f16854898915ca

9 years agores_parking: Update parking documentation for dynamic parking lots. 71/2471/2
Philip Correia [Mon, 15 Dec 2014 11:23:53 +0000 (13:23 +0200)] 
res_parking: Update parking documentation for dynamic parking lots.

* Remove duplicate res_parking.conf courtesytone config option
documentation.

ASTERISK-24596 #close
Reported by:  Philip Correia

ASTERISK-24605
Reported by:  Philip Correia
Patches:
      call_park_app_doc.patch (license #6672) patch uploaded by Philip Correia

Change-Id: I90a92a891c6494dc08173e675856afcc4764c5b5

9 years agoMerge "pjproject-bundled: Cleanups for reported issues" into 13
zuul [Fri, 25 Mar 2016 23:11:37 +0000 (18:11 -0500)] 
Merge "pjproject-bundled:  Cleanups for reported issues" into 13

9 years agoMerge "progdocs: Exclude ./third-party from documentation generation" into 13
zuul [Fri, 25 Mar 2016 20:05:38 +0000 (15:05 -0500)] 
Merge "progdocs:  Exclude ./third-party from documentation generation" into 13

9 years agoMerge "core/logging: Fix broken syslog levels on older glibc." into 13
zuul [Fri, 25 Mar 2016 18:38:37 +0000 (13:38 -0500)] 
Merge "core/logging: Fix broken syslog levels on older glibc." into 13

9 years agoMerge "musiconhold: Only warn if music class is not found in memory and database...
zuul [Fri, 25 Mar 2016 02:13:57 +0000 (21:13 -0500)] 
Merge "musiconhold: Only warn if music class is not found in memory and database." into 13

9 years agoMerge "Restrict CLI/AMI commands on shutdown." into 13
zuul [Fri, 25 Mar 2016 00:55:49 +0000 (19:55 -0500)] 
Merge "Restrict CLI/AMI commands on shutdown." into 13

9 years agochan_sip: Do not send all codecs on INVITE. Do not break on Session-Timers. 59/2459/1
Alexander Traud [Thu, 24 Mar 2016 19:08:10 +0000 (20:08 +0100)] 
chan_sip: Do not send all codecs on INVITE. Do not break on Session-Timers.

Asterisk 13.7.0 included a fix for ASTERISK-24543, not to send all those
codecs, which the caller did not request/support. That fix was not complete
because on the second Session Timer all codecs were sent again. Some VoIP/SIP
clients interpreted that complete codec-list as a change in the SIP session.
Because of that, Asterisk did not send the RTP audio via NAT anymore which
created a non-audio scenario after the second Session Timer fired.

ASTERISK-24543 #close

Change-Id: I1881827816ab7fd47eb4287a95961179b34a0b66

9 years agoMerge "config: fix flags in uint option handler" into 13
zuul [Thu, 24 Mar 2016 18:28:21 +0000 (13:28 -0500)] 
Merge "config: fix flags in uint option handler" into 13

9 years agoconfig: fix flags in uint option handler 45/2445/3
Gianluca Merlo [Sat, 19 Mar 2016 12:34:26 +0000 (13:34 +0100)] 
config: fix flags in uint option handler

The configuration unsigned integer option handler sets flags for the
parser as if the option should be a signed integer (PARSE_INT32),
leading to errors on "out of range" values. Fix flags (PARSE_UINT32).

A fix to res_pjsip is also present which stops invalid flags from
being passed when registering sorcery object fields for qualify
status.

ASTERISK-25612 #close

Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e

9 years agoRestrict CLI/AMI commands on shutdown. 72/2372/6
Mark Michelson [Thu, 10 Mar 2016 22:58:49 +0000 (16:58 -0600)] 
Restrict CLI/AMI commands on shutdown.

During stress testing, we have frequently seen crashes occur because a
CLI or AMI command attempts to access information that is in the process
of being destroyed.

When addressing how to fix this issue, we initially considered fixing
individual crashes we observed. However, the changes required to fix
those problems would introduce considerable overhead to the nominal
case. This is not reasonable in order to prevent a crash from occurring
while Asterisk is already shutting down.

Instead, this change makes it so AMI and CLI commands cannot be executed
if Asterisk is being shut down. For AMI, this is absolute. For CLI,
though, certain commands can be registered so that they may be run
during Asterisk shutdown.

ASTERISK-25825 #close

Change-Id: I8887e215ac352fadf7f4c1e082da9089b1421990

9 years agomusiconhold: Only warn if music class is not found in memory and database. 56/2456/1
Walter Doekes [Thu, 24 Mar 2016 12:45:06 +0000 (13:45 +0100)] 
musiconhold: Only warn if music class is not found in memory and database.

The log message when a MusicOnHold music class was not found was changed
from debug level to WARNING level in Asterisk 11.19 and 13.5.  For those
using realtime musiconhold, this message is wrong because it warns
before checking the database.

This changeset delays the warning until after the database has been
checked.

Reported-by: Conrad de Wet
ASTERISK-25444 #close

Change-Id: I6cfb2db2f9cfbd2bb3d30566ecae361c4abf6dbf

9 years agocore/logging: Fix broken syslog levels on older glibc. 52/2452/3
Walter Doekes [Thu, 24 Mar 2016 10:38:16 +0000 (11:38 +0100)] 
core/logging: Fix broken syslog levels on older glibc.

The fix to ASTERISK-25407 introduced the usage of LOG_MAKEPRI. However
this macro is broken in older glibc (< 2.17); it would left-shift the
facility a second time, causing the resultant priority to become
invalid.

The syslog manpage mentions nothing about LOG_MAKEPRI and suggests this:

    The priority argument is formed by ORing the facility and the level
    values [...].

ASTERISK-25510 #close
Reported by: Michael Newton

Change-Id: Ia89debe7fac5ad090c7ef595c0707f31bb1e3d03

9 years agopjproject-bundled: Cleanups for reported issues 49/2449/1
George Joseph [Wed, 23 Mar 2016 13:59:12 +0000 (07:59 -0600)] 
pjproject-bundled:  Cleanups for reported issues

PortAudio should no longer be required
PJSIP_MAX_PKT_LEN is now 6000
Older autoconf issue fixed. (CentOS 6)

Change-Id: I463fa9586cbe7c6b3b603289f535bd8e361611dd

9 years agochan_sip.c: Space after port causes unnecessary resolution attempt 47/2447/1
Francesco Castellano [Fri, 20 Nov 2015 14:02:48 +0000 (15:02 +0100)] 
chan_sip.c: Space after port causes unnecessary resolution attempt

check_via() already skips leading blanks where the sent-by address (with the
optional port) should be placed.

Since RFC 3261 allows for blanks between the port ant the Via parameters:
> https://tools.ietf.org/html/rfc3261#section-20.42
(actually it allows a lot of blanks more ;-)). I just switched from
ast_skip_blanks() to ast_strip() on the local copy of the string.

ASTERISK-21301 #close

Change-Id: Ie5b8fe5a07067b7c0dc9bcdd1707e99b23b02b06

9 years agoMerge "func_aes: fix misuse of strlen on binary data" into 13
zuul [Mon, 21 Mar 2016 20:19:01 +0000 (15:19 -0500)] 
Merge "func_aes: fix misuse of strlen on binary data" into 13

9 years agoprogdocs: Exclude ./third-party from documentation generation 41/2441/1
George Joseph [Sat, 19 Mar 2016 22:49:25 +0000 (16:49 -0600)] 
progdocs:  Exclude ./third-party from documentation generation

We don't need pjproject's documentation embedded in Asterisk's.

Change-Id: Iea6f5a621c0f4e3168dda3321eaab258d9f24a17

9 years agofunc_aes: fix misuse of strlen on binary data 39/2439/1
Gianluca Merlo [Sat, 19 Mar 2016 01:32:51 +0000 (02:32 +0100)] 
func_aes: fix misuse of strlen on binary data

The encryption code for AES_ENCRYPT evaluates the length of the data to
be encoded in base64 using strlen. The data is binary, thus the length
of it can be underestimated at the first NULL character.
Reuse the write pointer offset to evaluate it, instead.

ASTERISK-25857 #close

Change-Id: If686b5d570473eb926693c73461177b35b13b186

9 years agochan_pjsip: ref leak when checking direct_media_glare 36/2436/2
Kevin Harwell [Fri, 18 Mar 2016 19:31:12 +0000 (14:31 -0500)] 
chan_pjsip: ref leak when checking direct_media_glare

Fix the reference leak introduced in the following commit:

9444ddadf8525d1ce66a1faf1db97f9f6c265ca4

ASTERISK-25849

Change-Id: I5cfefd5ee6c1c3a1715c050330aaa10e4d2a5e85

9 years agochan_pjsip: transfers with direct media reinvite has wrong address/port 19/2419/5
Kevin Harwell [Wed, 16 Mar 2016 17:37:01 +0000 (12:37 -0500)] 
chan_pjsip: transfers with direct media reinvite has wrong address/port

During a transfer involving direct media a race occurs between when the
transferer channel is swapped out, initiating rtp changes/updates, and the
subsequent reinvites.

When Alice, after speaking with Charlie (Bob is on hold), connects Bob and
Charlie invites are sent to each in order to establish the call between them.
Bob is taken off hold and Charlie is told to have his media flow through
Asterisk. However, if before those invites go out the bridge updates Bob's
and/or Charlie's rtp information with direct media data (i.e. address, port)
then the invite(s) will contain the remote data in the SDP instead of the
Asterisk data.

The race occurs in the native bridge glue code when updating the peer. The
direct_media_address can get set twice before sending out the first invite
during call connection. This can happen because the checking/setting of the
direct_media_address happened in one thread while the sending of the invite(s)
happened in another thread.

This fix removes the race condition by moving the checking/setting of the
direct_media_address to be in the same thread as the sending of the invites(s).
This serializes the checking/setting and sending so they can no longer happen
out of order.

ASTERISK-25849 #close

Change-Id: Idfea590175e74f401929a601dba0c91ca1a7f873

9 years agoMerge "install_prereq: Check if is installed aptitude otherwise to install." into 13
zuul [Thu, 17 Mar 2016 22:42:41 +0000 (17:42 -0500)] 
Merge "install_prereq: Check if is installed aptitude otherwise to install." into 13

9 years agoMerge "install_prereq: Update repositories before install on Debian systems" into 13
zuul [Thu, 17 Mar 2016 22:31:13 +0000 (17:31 -0500)] 
Merge "install_prereq: Update repositories before install on Debian systems" into 13

9 years agoinstall_prereq: Update repositories before install on Debian systems 32/2432/1
Rodrigo Ramírez Norambuena [Mon, 19 Oct 2015 12:11:55 +0000 (09:11 -0300)] 
install_prereq: Update repositories before install on Debian systems

When to install packages the indexed local is more old of the
version of software on the repository they have been upgraded by security
update then get the package will give 404 not found.

The patch prevent by update local index to repository for aptitude before
install.

ASTERISK-25495 #close

Reporte by: Rodrigo Ramírez Norambuena

Change-Id: I645959e553aac542805ced394cac2dca964051fa
(cherry picked from commit 88f3dbaec9509bfba8bc1de7799aa0dc65304bb5)

9 years agoinstall_prereq: Check if is installed aptitude otherwise to install. 31/2431/1
Rodrigo Ramírez Norambuena [Thu, 4 Jun 2015 01:12:50 +0000 (21:12 -0400)] 
install_prereq: Check if is installed aptitude otherwise to install.

If in Debian or system based, dont have aptitude installed the script do
nothing. This patch checked if aptitude  installed, if not installed.

Also, if execute script with all packages installed yet, the script not show
nothing and return exit 1 because the command 'grep' get nothing from pipe from
'awk'.

ASTERISK-25113 #close
Reported By: Rodrigo Ramírez Norambuena <decipher.hk@gmail.com>

Change-Id: Iebdff55805d3917166e5e08e0a1e2176f36ff27f
(cherry picked from commit 6737ded0581a9e1256bdfe30c1d747e7ca93f8b3)