Commit Graph

28040 Commits

Author SHA1 Message Date
Joshua Colp d733dccf81 Merge "basic-cfg: asterisk.conf: defaults of options" 2016-05-13 04:53:13 -05:00
zuul 17e38e7f92 Merge "followme: delete the right recorded name file" 2016-05-12 21:44:11 -05:00
zuul c5cb9d120f Merge "basic-cfg: asterisk.conf: remove [directories]" 2016-05-12 19:52:13 -05:00
Mark Michelson fd3f70598d Use doubles instead of floats for conversions when comparing strings.
In 13.9.0, there was an issue where PJSIP contacts added to an AOR would
be deleted at seemingly random times.

One reason this was happening was because of an operation to retrieve
the contacts whose expiration time was less than or equal to the current
time. When retrieving existing contacts, the contact's expiration time
and the current time were converted from a string to a float, and those
two floats were compared.

On some systems, including mine, this conversion was horribly off. For
instance, I could regularly see the string "1463079214" get converted
into 1463079168.000000. When switching from using a float to using a
double, the conversion was as expected.

Why was the conversion to float off? My best guess is that the
conversion to float was attempting to store the entire value in the 23
bit significand of the IEEE-754 floating point number. In particular, if
you take only the 23 most significant bits of 1463079214, you get the
messed up 1463079168 that we were seeing in the conversion. It likely
was possible to get a more precise value by composing the number using
an exponent, but the conversion did not work that way. With a double,
you have a 52 bit significand, allowing the entire value to fit there,
and thereby allowing an accurate conversion.

ASTERISK-26007 #close
Reported by Greg Siemon

Change-Id: I83ca7944aae8b7cd994b254c78ec02411d321070
2016-05-12 15:24:33 -05:00
zuul dd354009d3 Merge "res_pjsip_outbound_registration: generate correct Contact URI for TLS" 2016-05-12 14:25:43 -05:00
George Joseph 4f8cfa0220 pjsip_distributor: Add missing newline to NOTICE
There was a newline missing from the end of the "no matching endpoint" notice.

Change-Id: Idc11fe5bc0354072291663dbffe648c471e39181
2016-05-12 09:16:21 -05:00
Sebastian Damm d14d1ba826 res_pjsip_outbound_registration: generate correct Contact URI for TLS
There are two types of SIP URIs indicating a secure transport:
* sips:user@example.org
* sip:user@example.org;transport=tls

When using a sips URI, Asterisk checks incoming INVITEs and answers from
the other side for sips URIs, and rejects the packet if there are only
sip URIs. So Asterisk should only generate a sips Contact URI if the
other side supports it.

This patch makes Asterisk generate either a sip or sips Contact URI
depending on the format of the server URI.

If you want a sip URI, use:
server_uri=sip:example.org\;transport=tls

If you want a sips URI, use:
server_uri=sips:example.org

ASTERISK-25990 #close
Reported-by: Sebastian Damm

Change-Id: I5ae57d6531ce940b5fc64d5cd2673e60db0f9ba2
2016-05-12 05:34:12 -05:00
Alexei Gradinari 9f996624b0 logger: Add PID to syslog messages.
During refactoring of this support the addition of
the PID to messages was removed. This change adds it
back in.

ASTERISK-25538 #close

Change-Id: Ie2d43b0652e59b7ac319a7dba94501540d70ba36
2016-05-12 05:12:15 -05:00
Matt Jordan 5236ffed97 configure: Fix errors with AST_UNDEFINED_SANITIZER/AST_LEAK_SANITIZER
When running on a system that does not support or use AST_UNDEFINED_SANITIZER
or AST_LEAK_SANITIZER, the configure script would incorrectly set those
constants to a blank value, e.g., 'AST_UNDEFINED_SANITIZER='. This would
cause menuselect to error out, complaining that a blank value is not a
valid option. This patch corrects the issue by setting the value to 0 if
the options that those constants enable/disable is not found.

Change-Id: Ib39814aaf940f308d500c1e026edb3d70de47fba
2016-05-11 14:10:17 -05:00
Joshua Colp 1be506d811 Merge "res_pjsip_outbound_publish: state potential dropped on reloads/realtime fetches" 2016-05-11 12:57:34 -05:00
Joshua Colp 086e311a75 Merge "res_pjsip_outbound_publishing: After unloading the library won't load again" 2016-05-11 12:57:24 -05:00
Joshua Colp 0863ccee09 Merge "res_pjsip_outbound_publish: Won't unload if condition wait times out" 2016-05-11 12:57:13 -05:00
Joshua Colp 09e22d7d6c Merge "res_pjsip_outbound_publish: Ref leak in off nominal callback paths" 2016-05-11 12:57:04 -05:00
Joshua Colp ce3733d16e Merge "res_pjsip_outbound_publish: Potential crash due to off nominal path" 2016-05-11 12:56:52 -05:00
Joshua Colp 87787bb889 Merge "res_pjsip: improve realtime performance" 2016-05-11 10:58:54 -05:00
zuul 21442faf34 Merge "res_fax/t38_gateway: Peer V.21 session is created on wrong channel" 2016-05-11 10:36:34 -05:00
Tzafrir Cohen b5c471b339 followme: delete the right recorded name file
FollowMe with the option a records the name of the caller and plays it
to the callee. However it has failed to clean up that recorded file
as it tried to delete the file name without the '.sln' extension.

ASTERISK-26008 #close

Change-Id: I79d7b1be7d5cde57bf076d9389e2a8a4422776ec
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-10 16:26:11 +03:00
Joshua Colp b4e10e7c90 Merge "app_confbridge: Add a regcontext option for confbridge bridge profiles." 2016-05-10 04:48:35 -05:00
Tzafrir Cohen ec85ea3c21 basic-cfg: asterisk.conf: don't set languages
* No need to set language in a miniml configuration. 'en' will do just
  fine.
* It would be useful to have an example of setting it to a different
  language.
* Setting the documentation language explicitly is likewise not
  required. Setting it to a different value is not common. At least
  until there is a set of translated documentation.

Change-Id: I94d91ea34e129925f25af81ef8dc0906fb568cb7
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-10 11:10:55 +03:00
Tzafrir Cohen 1b0a9bb2c4 basic-cfg: asterisk.conf: debug level 5 spams
Don't suggest users to use debug level 5, which spews (usually
non-useful) debug information. Reduce the suggestion to (an
arbitrarily-selected) level 2.

Change-Id: Ib53195f78945970956ff59ef13fa89b90e0fcd60
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-10 11:08:33 +03:00
Tzafrir Cohen d0ba3e8196 basic-cfg: asterisk.conf: defaults of options
Note the default of remmed-out options. To clarify that those values are
not the defaults.

Change-Id: I849c29b7a710f0abc37355fcb5bfee335ae30738
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-10 11:06:57 +03:00
Tzafrir Cohen f943a1fd84 basic-cfg: asterisk.conf: remove [directories]
A minimal configuration does not need to explicitly spell out the
directories. The built-in defaults will do just fine. In many cases
they are wrong.

Change-Id: Id1a671e5c5e9923765a4156b57f9f7e263fdd26c
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-10 11:04:46 +03: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
George Joseph dfefbf8731 config_transport: Tell pjproject to allow all SSL/TLS protocols
The default tls settings for pjproject only allow TLS 1, TLS 1.1 and TLS 1.2.
SSL is not allowed.   So, even if you specify "sslv3" for a transport method,
it's silently ignored and one of the TLS protocols is used.  This was a new
behavior of pjsip_tls_setting_default() in 2.4 (when tls.proto was added) that
we never caught.

Now we need to set tls.proto = 0 after we call pjsip_tls_setting_default().
This tells pjproject to set the socket protocol to match the method.

ASTERISK-26004 #close

Change-Id: Icfb55c1ebe921298dedb4b1a1d3bdc3ca41dd078
2016-05-09 11:29:41 -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
Kevin Harwell 64e058f75a res_pjsip_outbound_publish: state potential dropped on reloads/realtime fetches
When reloading, or fetching realtime data, if the "apply" failed for any
numerous reasons the current state object would not be maintained. This
potentially resulted in publishes being stopped for some states/clients when
they should not have been.

This patch makes it so the current state object is kept upon any type of reload/
fetch failures.

Change-Id: Iab6020c116d628ed2ae81183e987e2eaa3c90b30
2016-05-05 16:41:50 -05:00
Kevin Harwell adc82a2260 res_pjsip_outbound_publishing: After unloading the library won't load again
The same thing was happening in res_pjsip_publish_asterisk. When the library
was unloaded it did not unregister the object type from sorcery. Subsequent
loads resulted in a failed load due to the sorcery type already existing.

Change-Id: Ifdc25e94e4cd40bc5a19eb4d0a00b86c2e9fedc9
2016-05-05 16:41:50 -05:00
Kevin Harwell 3b0ce5169d res_pjsip_outbound_publish: Won't unload if condition wait times out
When res_pjsip_outbound_publish unloads it has to wait for all current
publishing objects to get done. However if the wait condition times out
then it does not fail the unload. This sometimes results in an infinite
loop check while unloading. This patch now fails the unload operation if
the condition times out.

Change-Id: Id57b8cbed9d61222690fcba1e4f18e259df4c7ec
2016-05-05 16:41:50 -05:00
Kevin Harwell 41fccbfeb1 res_pjsip_outbound_publish: Ref leak in off nominal callback paths
There were a few spots where the client object's reference was being leaked in
sip_outbound_publish_callback. This patch cleans up those leaks.

Change-Id: I485d0bc9335090f373026f77c548042e258461df
2016-05-05 16:41:50 -05:00
Kevin Harwell dfbb03cc8e res_pjsip_outbound_publish: Potential crash due to off nominal path
It was possible for the explicit publish destroy function to be called without
the pjsip client ever being initialized. This fix checks to make sure there is
a client to destroy before attempting.

Change-Id: I8eea1bfa3bd472149bfc255310be2a6248688f5c
2016-05-05 16:41:50 -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 cc4c5f5693 res_pjsip: improve realtime performance
This patch modified pjsip_options to retrieve only
permament contacts for aor if the qualify_frequency is > 0
and persisted contacts if the qualify_frequency is > 0.

This patch also fixed a bug in res_sorcery_astdb.
res_sorcery_astdb doesn't save object data retrived from astdb.

ASTERISK-25826

Change-Id: I1831fa46c4578eae5a3e574ee3362fddf08a1f05
2016-05-05 10:45:49 -05:00
Alexei Gradinari 92f85fe766 res_fax/t38_gateway: Peer V.21 session is created on wrong channel
The channel and peer V.21 sessions are created on the same channel now.
The peer V.21 session should be created only on peer channel
when one of channel can handle T.38.

Also this patch enable debug for T.38 gateway session
if global fax debug enabled.

ASTERISK-25982

Change-Id: I78387156ea521a77eb0faf170179ddd37a50430e
2016-05-05 10:23:13 -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