Commit Graph

27861 Commits

Author SHA1 Message Date
Joshua Colp b4e10e7c90 Merge "app_confbridge: Add a regcontext option for confbridge bridge profiles." 2016-05-10 04:48:35 -05:00
zuul f60b1f35a0 Merge "res_pjsip_authenticator_digest: Don't use source port in nonce verification" 2016-05-09 22:56:53 -05:00
Joshua Colp 2da358a3cb Merge "pjproject_bundled: Check for python-dev and TEST_FRAMEWORK" 2016-05-09 18:49:42 -05:00
Joshua Colp 3699beea38 Merge "res_pjsip_pubsub: Use common datastores container API." 2016-05-09 18:27:35 -05:00
zuul 53e965a572 Merge "datastore: Add common container based datastores API." 2016-05-09 18:23:44 -05:00
Kevin Harwell 1e876d6915 res_pjsip_authenticator_digest: Don't use source port in nonce verification
From the issue reporter:
"res_pjsip_outbound_authenticator_digest builds a nonce that is a hash of
the timestamp, the source address, the source port, a server UUID that is
calculated at startup, and the authentication realm.

Rather than caching nonces that we create, we instead attempt to re-calculate
the nonce when receiving an incoming request with authentication. We then
compare the re-calculated nonce to the incoming nonce, and if they don't match,
then authentication has failed early.

The problem is that it is possible, especially when using TCP, to receive two
requests from the same endpoint but have differing source ports for those
requests. Asterisk itself commonly will use different source ports for
outbound TCP requests."

This patch removes the source port dependency when building the nonce.

ASTERISK-25978 #close

Change-Id: I871b5f4adce102df1c4988066283095ec509dffe
2016-05-09 14:17:43 -05:00
Joshua Colp 5b15ec966d Merge "res_pjsip: module load priority" 2016-05-09 10:06:10 -05:00
Joshua Colp d03e170ae7 res_pjsip_pubsub: Use common datastores container API.
This migrates res_pjsip_pubsub over to using the newly
introduce common datastores management API instead of using
its own implementations for both subscriptions and
publications.

As well the extension state data now provides a generic
datastores container instead of a subscription. This allows
the dialog-info+xml body generator to work for both
subscriptions and publications.

ASTERISK-25999 #close

Change-Id: I773f9e4f35092da0f653566736a8647e8cfebef1
2016-05-09 10:40:36 -03:00
Joshua Colp 94cd351ec4 datastore: Add common container based datastores API.
This change introduces a common container based datastores
management API. This has been done in a few places across
the tree but this consolidates all of the logic into one
place in a generic fashion.

ASTERISK-25999

Change-Id: I72eb15941dcdbc2a37bb00a33ce00f8755bd336a
2016-05-09 10:40:28 -03:00
Joshua Colp bf957e1bf7 Merge "file: Ensure nativeformats remains valid for lifetime of use." 2016-05-09 08:28:16 -05:00
Jaco Kroon 8923c9ac96 app_confbridge: Add a regcontext option for confbridge bridge profiles.
This patch allows for having app_confbridge register the name of the
conference as an extension into a specific context, similar to
regcontext for chan_sip.  This variant is not quite as involved as the
one in chan_sip and doesn't allow for multiple contexts or custom
extensions, you can only specify the context and the conference name
will always be used as the extension to register.

ASTERISK-25989 #close

Change-Id: Icacf94d9f2b5dfd31ef36f6cb702392619a7902f
2016-05-09 08:18:56 -05:00
George Joseph facce6f632 pjproject_bundled: Check for python-dev and TEST_FRAMEWORK
The pjsua and pjsystest apps are now built only if TEST_FRAMEWORK is set.
The python bindings are now built only if TEST_FRAMEWORK is set and a
python development package is installed.

libresample was also disabled.

ASTERISK-25993 #close
Reported-by: Joshua Colp

Change-Id: If4e91c503a02f113d5b71bc8b972081fa3ff6f03
2016-05-08 20:34:42 -05:00
Alexei Gradinari 322c3b4262 res_pjsip: module load priority
The res_pjsip_authenticator_digest, res_pjsip_endpoint_identifier_*
and res_pjsip_registrar modules should load ASAP
to avoid "No matching endpoint found" for legitimate endpoint.

ASTERISK-25994

Change-Id: Iac95d95ad031e0be104189d29e923a2ad7c24a1b
2016-05-06 12:56:07 -04:00
Alexei Gradinari 516f49f316 stasis_endpoints: Add new Status and Headers to ContactStatus
ASTERISK-25903 added a new headers to AMI Event ContactStatusDetail.
ASTERISK-25904 added a new Status to AMI Event ContactStatusDetail.
These additions should be also in stasis_endpoints
to include in command "manager show event ContactStatus"

Change-Id: I7610ad02a998e1f26c20caa27aa50279d0164f6a
2016-05-06 08:23:34 -05:00
zuul 52fbb6389a Merge "config_options.c: Expand #ifdef to contain whole if statement." 2016-05-06 06:14:40 -05:00
Joshua Colp 17b6ba49ef file: Ensure nativeformats remains valid for lifetime of use.
It is possible for the nativeformats of a channel to change
throughout its lifetime. As a result a user of it needs to either
ensure the channel is locked when accessing the formats or keep
a reference to the nativeformats themselves.

This change fixes the file playback support so it keeps a
reference to the nativeformats when accessing things.

ASTERISK-25998 #close

Change-Id: Ie45b65475e1481ddf05b874ee48f63e39fff8915
2016-05-05 11:02:48 -05:00
Alexei Gradinari 4df48581f1 pjsip: Added "reg_server" to contacts (fixed alembic)
ASTERISK-25931

Change-Id: Icc4321a88f5c93ff809da3f372eebbf69c6a8549
2016-05-05 10:21:53 -05:00
Chris Trobridge 02f4ca1079 config_options.c: Expand #ifdef to contain whole if statement.
ASTERISK-25956 #close

Change-Id: If6961ec54be276d5ab4f012ee7e7b420cb45de38
2016-05-04 22:19:57 -05:00
Alexei Gradinari 380ac201ac res_fax: add FAXMODE variable
The app_fax set FAXMODE variable, but res_fax missing this feature.
This patch add FAXMODE variable which is set to either "audio" or "T38".

ASTERISK-25980

Change-Id: Ie3dcbfb72cc681e9e267a60202f7fb8723a51b6b
2016-05-04 09:37:15 -05:00
Joshua Colp 122895f864 Merge "app_chanspy: fix audiohook options in non read-only mode" 2016-05-04 04:49:29 -05:00
Joshua Colp b5223a8cfc Merge "app_voicemail: always copy dynamic struct to avoid race condition" 2016-05-04 04:49:19 -05:00
zuul 716411234c Merge "res_pjsip/AMI: add contact.updated event" 2016-05-03 22:06:34 -05:00
zuul d9ed4e3153 Merge "pjproject_bundled: Various fixes discovered during testing of OSes" 2016-05-03 19:11:18 -05:00
Jean Aunis 0c9faaee47 app_chanspy: fix audiohook options in non read-only mode
When option 'o' was not set, ChanSpy created its audiohook with the flag
AST_AUDIOHOOK_MUTE_WRITE, which caused ChanSpy to listen audio from one
direction only.

ASTERISK-25866 #close

Change-Id: I5c745855eea29a3fbc4e4aed0b0c0f53580535e0
2016-05-03 17:17:48 -05:00
Alexei Gradinari a4cfcda036 res_pjsip/AMI: add contact.updated event
With the old SIP module AMI sends PeerStatus event on every
successfully REGISTER requests, ie, on start registration,
update registration and stop registration.

With PJSIP AMI sends ContactStatus only when status is changed.
Regarding registration:
on start registration - Created
on stop registration - Removed
but on update registration nothing

This patch added contact.updated event.

ASTERISK-25904

Change-Id: I8fad8aae9305481469c38d2146e1ba3a56d3108f
2016-05-03 16:38:30 -05:00
zuul c339d4c6ed Merge "pjsip: Added "reg_server" to contacts." 2016-05-03 14:05:45 -05:00
Joshua Colp 96de883676 Merge "configs/basic-pbx/asterisk.conf: contains incorrect path separator" 2016-05-03 12:11:21 -05:00
George Joseph e61716b774 pjproject_bundled: Various fixes discovered during testing of OSes
For all OSes:
* Disabled third-party codecs in pjproject and added
  '--disable-speex-codec --disable-speex-aec --disable-gsm-codec' to the
  configure options since we don't use the pjsip codec capability.

FreeBSD:
* Added FreeBSD support to install_prereq.
* Changed pjproject/configure.m4 to use $GNU_MAKE instead of hardcoding "make".
* Added __progname and environ to asterisk.exports.in.
* Reverted the use of ldconfig to create shared library symlinks to ln.
* Only enable epoll in pjproject if `uname -s` is Linux.
* Added a patch to pjproject to take the name of the 'make' command from
  an environment variable if supplied.  This is needed for the python bindings.
  (merged by Teluu into pjproject trunk 5/3/2016)
FreeBSD support isn't complete.  Still some general issues regarding
make/gmake having nothing to do with pjproject.  With some handholding it DOES
build successfully.

CentOS:
Added 'patch' and 'bzip2' to install_prereq PACKAGES_RH.
CentOS 6/7 32/64 build and run the pjsip testsuite successfully.

Ubuntu:
No changes required.
Ubuntu 15/16 32/64 build and run the pjsip testsuite successfully.

Debian:
No changes required.
Debian 6/7/8 32/64 build and run the pjsip testsuite successfully.

There will utimately be a follow-up patch to create an install_prereq for
the testsuite as I've discovered a few missing requirements.

ASTERISK-25968 #close

Change-Id: I5756a07facfc63798115a5e73a8709382fe9259c
2016-05-03 07:56:18 -05:00
zuul 9c4c4a7d0d Merge "res_pjsip_exten_state: Create PUBLISH messages." 2016-05-03 06:10:52 -05:00
Andrew Nagy 080c6216b6 app_voicemail: always copy dynamic struct to avoid race condition
Voicemail email addresses can be corrupt or voicemail
emails can end up being sent to the wrong email address if asterisk is
reading voicemail.conf during a reload and processing an email at the
same time. This patch always copies the struct that would otherwise only
be copied once.

ASTERISK-24463 #close
Reported by: John Campbell
Tested by: Etienne Lessard
Tested by: Andrew Nagy
Change-Id: I3a0643813116da84e2617291903d0d489b7425fb
2016-05-03 05:25:28 -05:00
Alexei Gradinari 2b1edee772 pjsip: Added "reg_server" to contacts.
If the Asterisk system name is set in asterisk.conf, it will be stored
into the "reg_server" field in the ps_contacts table to facilitate
multi-server setups.

ASTERISK-25931

Change-Id: Ia8f6bd2267809c78753b52bcf21835b9b59f4cb8
2016-05-02 10:01:40 -03:00
Diederik de Groot bf13b59062 configs/basic-pbx/asterisk.conf: contains incorrect path separator
Note: When packagers use these files (as an example) the paths are never
really used when they are split using '='.

Note: Thirdparty applications will also have trouble parsing the file when
expecting '=>'.

Change-Id: I0ada647f588e81f023fb1333ca15a1a333fd6004
2016-05-01 09:25:00 +02:00
Joshua Colp adf32d1191 Merge "pjproject_bundled: Disable PJSIP_UNESCAPE_IN_PLACE" 2016-04-29 14:57:19 -05:00
Richard Mudgett 2c46063d54 res_pjsip_exten_state: Create PUBLISH messages.
Create PUBLISH messages to update a third party when an extension state
changes because of either a device or presence state change.

A configuration example:

[exten-state-publisher]
type=outbound-publish
server_uri=sip:instance1@172.16.10.2
event=presence
; Optional regex for context filtering, if specified only extension state
; for contexts matching the regex will cause a PUBLISH to be sent.
@context=^users
; Optional regex for extension filtering, if specified only extension
; state for extensions matching the regex will cause a PUBLISH to be sent.
@exten=^[0-9]*
; Required body type for the PUBLISH message.
;
; Supported values are:
; application/pidf+xml
; application/xpidf+xml
; application/cpim-pidf+xml
; application/dialog-info+xml (Planned support but not yet)
@body=application/pidf+xml

The '@' extended variables are used because the implementation can't
extend the outbound publish type as it is provided by the outbound publish
module.  That means you either have to use extended variables, or
implement some sort of custom extended variable thing in the outbound
publish module.  Another option would be to refactor that stuff to have an
option which specifies the use of an alternate implementation's
configuration and then have that passed to the implementation.  JColp
opted for the extended variables method originally.

ASTERISK-25972 #close

Change-Id: Ic0dab4022f5cf59302129483ed38398764ee3cca
2016-04-29 14:53:40 -05:00
Joshua Colp bc19d9a2b0 Merge "res_pjsip_exten_state: Check if body generator is available." 2016-04-29 14:33:01 -05:00
Joshua Colp d57847a7c7 Merge "res_pjsip_pubsub.c: Fix body generator registration race." 2016-04-29 13:33:43 -05:00
zuul ce3687011f Merge "res_pjsip: Start body generator users after suppliers." 2016-04-29 13:01:06 -05:00
Joshua Colp 1e41d14822 Merge "chan_sip: Make autocreated peers send PeerStatus events" 2016-04-29 11:44:11 -05:00
zuul e4b086939d Merge "res_pjsip_pubsub.c: Add useful information to some messages." 2016-04-28 22:55:04 -05:00
zuul 9692f8543e Merge "res_pjsip_pubsub.h: Fix doxygen association." 2016-04-28 22:43:29 -05:00
zuul c8f53bc4e9 Merge "res_pjsip_outbound_publish.c: Remove redundant flag check." 2016-04-28 21:02:05 -05:00
zuul 980b772265 Merge "res_pjsip: Add ability to identify by Authorization username" 2016-04-28 18:02:41 -05:00
zuul d53d494f0b Merge "app_chanspy: reduce audio loss on the spying channel." 2016-04-28 17:45:57 -05:00
Richard Mudgett 0b5292525c res_pjsip_exten_state: Check if body generator is available.
When starting the extension state publishers, check if the requested
message body generator is available.  If not available give error message
and skip starting that publisher.

* res_pjsip_pubsub.c: Create new API if type/subtype generator
registered.

* res_pjsip_exten_state.c: Use new body generator API for validation.

ASTERISK-25922

Change-Id: I4ad69200666e3cc909d4619e3c81042d7f9db25c
2016-04-28 17:14:44 -05:00
Richard Mudgett 369182d084 res_pjsip: Start body generator users after suppliers.
Change-Id: I8f0b57841feaab56c8a4e821b5ccb4e05e5fbadb
2016-04-28 17:07:22 -05:00
Richard Mudgett 3af83ea2fb res_pjsip_pubsub.c: Add useful information to some messages.
Change-Id: Ia0b2e15773894c599e5c5748bbc70e99f434192a
2016-04-28 17:05:20 -05:00
Richard Mudgett 8e1b663b87 res_pjsip_pubsub.c: Fix body generator registration race.
Change-Id: Id8752073ef06472a2fd96080f4009fac42843e67
2016-04-28 17:02:08 -05:00
George Joseph 30415944a8 pjproject_bundled: Disable PJSIP_UNESCAPE_IN_PLACE
When pjsip_parse_uri is called with PJSIP_UNESCAPE_IN_PLACE enabled,
the input uri string will become corrupted if it contains escape sequences.
It's not possible to automatically strdup or strdupa the input string because
the output uri pj_str_t's will have pointers to chunks of the input string.
Getting around this would require more memory management code and wouldn't
be worth the savings of doing the unescape in place.

ASTERISK-25970 #close
Reported-by: Dmitriy Serov

Change-Id: I28dc0e599b5108f7959b9c46dc8278371b372f88
2016-04-28 17:01:32 -05:00
Richard Mudgett 906ea2c43f res_pjsip_pubsub.h: Fix doxygen association.
Change-Id: I110d3e3572598289fcd4215d966cf0c858f98632
2016-04-28 17:00:09 -05:00
Richard Mudgett 76ea4cfaae res_pjsip_outbound_publish.c: Remove redundant flag check.
Change-Id: I0da80a3c3e0eae0c52ff27e7412ba027d6f52353
2016-04-28 16:57:20 -05:00