Commit Graph

27604 Commits

Author SHA1 Message Date
zuul
bcb133ce93 Merge "configs/samples/pjsip.conf.sample: Fix typo" into 13 2016-05-16 13:53:02 -05:00
George Joseph
b6f9392a12 res_pjsip: Set TCP_NODELAY on TCP transports
Although it's perfectly legal to place multiple SIP messages in the same packet,
it can cause problems because the Linux default is to enable Path MTU Discovery
which sets the Don't Fragment bit on the packets. If adding a second message to
the packet causes the MTU to be exceeded, and the destination isn't equipped to
send a FRAGMENTATION NEEDED response to a large packet, the packet will just be
dropped.

We can't specifically tell the stack to send only 1 message per packet, but we
can turn on TCP_NODELAY when we create the transport. This will at least tell
the stack to send packets as soon as possible.

ASTERISK-26005 #close
Reported-by: Ross Beer

Change-Id: I820f23227183f2416ca5e393bec510e8fe1c8fbd
2016-05-15 18:05:34 -06:00
Matt Jordan
361a16f316 configs/samples/pjsip.conf.sample: Fix typo
A ':' is not a valid token for starting a comment.

Change-Id: I123592d93a83d1bdde3e352822881eb9da85e5ad
2016-05-14 21:48:56 -05:00
zuul
12db14b9b1 Merge "logger: Add PID to syslog messages." into 13 2016-05-14 19:50:44 -05:00
Sean Bright
9de5cd209e res_ari: Correct Location headers returned by some ARI resources
The Location headers returned by:

 * /bridges/{bridgeId}/play
 * /bridges/{bridgeId}/record
 * /channels/{channelId}/play
 * /channels/{channelId}/record

Did not have the '/ari' prefix, and in the case of the 'play' resources, were
using 'playback' instead of 'playbacks.'

Change-Id: I957c58a3a1471bf477dae7c67faa1b74fcd9241c
2016-05-14 13:46:56 -04:00
zuul
e6a946400f Merge "res_hep: Provide an option to pick the UUID type" into 13 2016-05-14 09:47:33 -05:00
zuul
c735ce1a05 Merge "config_transport: Tell pjproject to allow all SSL/TLS protocols" into 13 2016-05-13 17:57:52 -05:00
Matt Jordan
89ae4466ea res_hep: Provide an option to pick the UUID type
At one point in time, it seemed like a good idea to use the Asterisk
channel name as the HEP correlation UUID. In particular, it felt like
this would be a useful identifier to tie PJSIP messages and RTCP
messages together, along with whatever other data we may eventually send
to Homer. This also had the benefit of keeping the correlation UUID
channel technology agnostic.

In practice, it isn't as useful as hoped, for two reasons:
1) The first INVITE request received doesn't have a channel. As a
   result, there is always an 'odd message out', leading it to be
   potentially uncorrelated in Homer.
2) Other systems sending capture packets (Kamailio) use the SIP Call-ID.
   This causes RTCP information to be uncorrelated to the SIP message
   traffic seen by those capture nodes.

In order to support both (in case someone is trying to use res_hep_rtcp
with a non-PJSIP channel), this patch adds a new option, uuid_type, with
two valid values - 'call-id' and 'channel'. The uuid_type option is used
by a module to determine the preferred UUID type. When available, that
source of a correlation UUID is used; when not, the more readily available
source is used.

For res_hep_pjsip:
 - uuid_type = call-id: the module uses the SIP Call-ID header value
 - uuid_type = channel: the module uses the channel name if available,
                        falling back to SIP Call-ID if not
For res_hep_rtcp:
 - uuid_type = call-id: the module uses the SIP Call-ID header if the
                        channel type is PJSIP and we have a channel,
                        falling back to the Stasis event provided
                        channel name if not
 - uuid_type = channel: the module uses the channel name

ASTERISK-25352 #close

Change-Id: Ide67e59a52d9c806e3cc0a797ea1a4b88a00122c
2016-05-13 07:44:20 -05:00
zuul
1705c5d2ba Merge "pjsip_distributor: Add missing newline to NOTICE" into 13 2016-05-13 06:21:34 -05:00
Joshua Colp
dd9900849b Merge "basic-cfg: asterisk.conf: don't set languages" into 13 2016-05-13 04:54:06 -05:00
zuul
8143a00c69 Merge "basic-cfg: asterisk.conf: defaults of options" into 13 2016-05-12 23:18:43 -05:00
zuul
515f49747c Merge "basic-cfg: asterisk.conf: remove [directories]" into 13 2016-05-12 23:18:41 -05:00
zuul
bf3c7a891a Merge "basic-cfg: asterisk.conf: debug level 5 spams" into 13 2016-05-12 22:20:41 -05:00
zuul
25db2a8bf5 Merge "followme: delete the right recorded name file" into 13 2016-05-12 22:03:40 -05:00
Joshua Colp
a83bf5dabd Merge "Use doubles instead of floats for conversions when comparing strings." into 13 2016-05-12 19:20:07 -05:00
Tzafrir Cohen
a73d79c22f 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-12 16:53:23 -05:00
Tzafrir Cohen
1c56de9453 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-12 16:53:14 -05:00
Tzafrir Cohen
d7af591c59 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-12 16:53:06 -05:00
Tzafrir Cohen
9b7db18fc1 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-12 16:52:59 -05:00
Tzafrir Cohen
eec539a46e 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-12 16:52:50 -05:00
zuul
95285c6d23 Merge "res_pjsip_outbound_registration: generate correct Contact URI for TLS" into 13 2016-05-12 15:05:42 -05:00
Mark Michelson
02d30e171e 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 14:36:25 -05:00
George Joseph
e2df15bae9 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 08:15:24 -06:00
Sebastian Damm
a94a12bbf7 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:24 -05:00
Alexei Gradinari
36d66a23e0 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:05 -05:00
Matt Jordan
37214b0bdf 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:07:17 -05:00
zuul
a01ce2b889 Merge "res_pjsip: improve realtime performance" into 13 2016-05-11 12:22:10 -05:00
zuul
81773ceb9c Merge "res_fax/t38_gateway: Peer V.21 session is created on wrong channel" into 13 2016-05-11 10:19:50 -05:00
Joshua Colp
2d4c818ac1 Merge "app_confbridge: Add a regcontext option for confbridge bridge profiles." into 13 2016-05-10 04:48:44 -05:00
zuul
577d65b701 Merge "res_pjsip_authenticator_digest: Don't use source port in nonce verification" into 13 2016-05-09 22:34:39 -05:00
Joshua Colp
7561ffa64a Merge "pjproject_bundled: Check for python-dev and TEST_FRAMEWORK" into 13 2016-05-09 20:11:30 -05:00
Kevin Harwell
4d063814ba 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:15:26 -05:00
George Joseph
fb6227a372 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:13 -05:00
zuul
0f54a5ee98 Merge "res_pjsip: module load priority" into 13 2016-05-09 11:03:14 -05:00
zuul
5261151286 Merge "file: Ensure nativeformats remains valid for lifetime of use." into 13 2016-05-09 08:27:51 -05:00
Jaco Kroon
2db17a793c 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:17:59 -05:00
zuul
60cc53ecb3 Merge "stasis_endpoints: Add new Status and Headers to ContactStatus" into 13 2016-05-09 06:46:16 -05:00
George Joseph
2a7130b8b0 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 19:32:23 -06:00
Alexei Gradinari
72eb7c8301 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 09:27:39 -04:00
Chris Trobridge
dd00c71aae config_options.c: Expand #ifdef to contain whole if statement.
ASTERISK-25956 #close

Change-Id: If6961ec54be276d5ab4f012ee7e7b420cb45de38
2016-05-06 04:28:58 -05:00
Alexei Gradinari
e6eb17efd9 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-05 16:30:44 -04:00
zuul
3fd8113386 Merge "pjsip: Added "reg_server" to contacts (fixed alembic)" into 13 2016-05-05 13:15:16 -05:00
Joshua Colp
fa11f4c920 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 13:01:12 -03:00
Alexei Gradinari
9c2032240e 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:28 -05:00
zuul
168a7b3dd8 Merge "res_fax: add FAXMODE variable" into 13 2016-05-05 09:18:34 -05:00
Alexei Gradinari
fe38d21c2a pjsip: Added "reg_server" to contacts (fixed alembic)
ASTERISK-25931

Change-Id: Icc4321a88f5c93ff809da3f372eebbf69c6a8549
2016-05-04 17:11:17 -04:00
zuul
8aef2c4156 Merge "res_pjsip/AMI: add contact.updated event" into 13 2016-05-03 21:42:12 -05:00
Joshua Colp
3fa70be0f5 Merge "app_voicemail: always copy dynamic struct to avoid race condition" into 13 2016-05-03 19:14:31 -05:00
zuul
2970f72dff Merge "pjproject_bundled: Various fixes discovered during testing of OSes" into 13 2016-05-03 19:11:12 -05:00
Alexei Gradinari
7a14e669f0 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 17:35:27 -04:00