]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
9 years agoMerge "chan_sip: Prevent extra Session-Expires headers from being added" into 13
Joshua Colp [Wed, 18 May 2016 20:37:59 +0000 (15:37 -0500)] 
Merge "chan_sip:  Prevent extra Session-Expires headers from being added" into 13

9 years agochan_sip: Prevent extra Session-Expires headers from being added 52/2852/2
George Joseph [Tue, 17 May 2016 16:14:51 +0000 (10:14 -0600)] 
chan_sip:  Prevent extra Session-Expires headers from being added

When chan_sip does a re-INVITE to refresh a session and authentication
is required, the INVITE with the Authorization header containes a
second Session-Expires header without the ";refersher=" parameter.
This is causing some proxies to return a 400.  Also, when Asterisk is
the uas and the refresher, it is including the Session-Expires and
Min-SE headers in OPTIONS messages which is not allowed per RFC4028.

This patch (based on the reporter's) Checks to see if a Session-Expires
header is already in the message before adding another one.  It also
checks that the method is INVITE or UPDATE.

ASTERISK-26030 #close

Change-Id: I58a7b07bab5a3177748d8a7034fb8ad8e11ce1d9

9 years agores_pjsip_outbound_registration: Clean up state when registration is deleted 49/2849/2
George Joseph [Mon, 16 May 2016 20:29:38 +0000 (14:29 -0600)] 
res_pjsip_outbound_registration:  Clean up state when registration is deleted

Nothing was cleaning up the registration state object when ast_sorcery_delete
was called on a registration.  So, the registration was deleted from sorcery
but the state object went right on refreshing the registration (or failing
to refresh the registration) with the peer.

* Added a 'deleted' observer on registration that removes the state object.

ASTERISK-25964 #close
Reported-by Matt Jordan

Change-Id: I2db792145cdb1f72ebbf57dd9099596dbbf12c23

9 years agoMerge "configs/samples/pjsip.conf.sample: Fix typo" into 13
zuul [Mon, 16 May 2016 18:53:02 +0000 (13:53 -0500)] 
Merge "configs/samples/pjsip.conf.sample: Fix typo" into 13

9 years agores_pjsip: Set TCP_NODELAY on TCP transports 39/2839/1
George Joseph [Mon, 16 May 2016 00:05:34 +0000 (18:05 -0600)] 
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

9 years agoconfigs/samples/pjsip.conf.sample: Fix typo 36/2836/1
Matt Jordan [Sun, 15 May 2016 02:48:56 +0000 (21:48 -0500)] 
configs/samples/pjsip.conf.sample: Fix typo

A ':' is not a valid token for starting a comment.

Change-Id: I123592d93a83d1bdde3e352822881eb9da85e5ad

9 years agoMerge "logger: Add PID to syslog messages." into 13
zuul [Sun, 15 May 2016 00:50:44 +0000 (19:50 -0500)] 
Merge "logger: Add PID to syslog messages." into 13

9 years agores_ari: Correct Location headers returned by some ARI resources 34/2834/2
Sean Bright [Sat, 14 May 2016 17:29:09 +0000 (13:29 -0400)] 
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

9 years agoMerge "res_hep: Provide an option to pick the UUID type" into 13
zuul [Sat, 14 May 2016 14:47:33 +0000 (09:47 -0500)] 
Merge "res_hep: Provide an option to pick the UUID type" into 13

9 years agoMerge "config_transport: Tell pjproject to allow all SSL/TLS protocols" into 13
zuul [Fri, 13 May 2016 22:57:52 +0000 (17:57 -0500)] 
Merge "config_transport:  Tell pjproject to allow all SSL/TLS protocols" into 13

9 years agores_hep: Provide an option to pick the UUID type 14/2814/3
Matt Jordan [Thu, 12 May 2016 01:17:15 +0000 (20:17 -0500)] 
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

9 years agoMerge "pjsip_distributor: Add missing newline to NOTICE" into 13
zuul [Fri, 13 May 2016 11:21:34 +0000 (06:21 -0500)] 
Merge "pjsip_distributor:  Add missing newline to NOTICE" into 13

9 years agoMerge "basic-cfg: asterisk.conf: don't set languages" into 13
Joshua Colp [Fri, 13 May 2016 09:54:06 +0000 (04:54 -0500)] 
Merge "basic-cfg: asterisk.conf: don't set languages" into 13

9 years agoMerge "basic-cfg: asterisk.conf: defaults of options" into 13
zuul [Fri, 13 May 2016 04:18:43 +0000 (23:18 -0500)] 
Merge "basic-cfg: asterisk.conf: defaults of options" into 13

9 years agoMerge "basic-cfg: asterisk.conf: remove [directories]" into 13
zuul [Fri, 13 May 2016 04:18:41 +0000 (23:18 -0500)] 
Merge "basic-cfg: asterisk.conf: remove [directories]" into 13

9 years agoMerge "basic-cfg: asterisk.conf: debug level 5 spams" into 13
zuul [Fri, 13 May 2016 03:20:41 +0000 (22:20 -0500)] 
Merge "basic-cfg: asterisk.conf: debug level 5 spams" into 13

9 years agoMerge "followme: delete the right recorded name file" into 13
zuul [Fri, 13 May 2016 03:03:40 +0000 (22:03 -0500)] 
Merge "followme: delete the right recorded name file" into 13

9 years agoMerge "Use doubles instead of floats for conversions when comparing strings." into 13
Joshua Colp [Fri, 13 May 2016 00:20:07 +0000 (19:20 -0500)] 
Merge "Use doubles instead of floats for conversions when comparing strings." into 13

9 years agobasic-cfg: asterisk.conf: remove [directories] 28/2828/1
Tzafrir Cohen [Tue, 10 May 2016 07:56:40 +0000 (10:56 +0300)] 
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>
9 years agobasic-cfg: asterisk.conf: defaults of options 27/2827/1
Tzafrir Cohen [Tue, 10 May 2016 08:06:10 +0000 (11:06 +0300)] 
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>
9 years agobasic-cfg: asterisk.conf: debug level 5 spams 26/2826/1
Tzafrir Cohen [Tue, 10 May 2016 08:08:33 +0000 (11:08 +0300)] 
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>
9 years agobasic-cfg: asterisk.conf: don't set languages 25/2825/1
Tzafrir Cohen [Tue, 10 May 2016 08:10:55 +0000 (11:10 +0300)] 
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>
9 years agofollowme: delete the right recorded name file 24/2824/1
Tzafrir Cohen [Tue, 10 May 2016 13:17:29 +0000 (16:17 +0300)] 
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>
9 years agoMerge "res_pjsip_outbound_registration: generate correct Contact URI for TLS" into 13
zuul [Thu, 12 May 2016 20:05:42 +0000 (15:05 -0500)] 
Merge "res_pjsip_outbound_registration: generate correct Contact URI for TLS" into 13

9 years agoUse doubles instead of floats for conversions when comparing strings. 19/2819/1
Mark Michelson [Thu, 12 May 2016 19:36:25 +0000 (14:36 -0500)] 
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

9 years agopjsip_distributor: Add missing newline to NOTICE 16/2816/1
George Joseph [Thu, 12 May 2016 14:13:55 +0000 (08:13 -0600)] 
pjsip_distributor:  Add missing newline to NOTICE

There was a newline missing from the end of the "no matching endpoint" notice.

Change-Id: Idc11fe5bc0354072291663dbffe648c471e39181

9 years agores_pjsip_outbound_registration: generate correct Contact URI for TLS 02/2802/2
Sebastian Damm [Tue, 10 May 2016 15:19:48 +0000 (17:19 +0200)] 
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

9 years agologger: Add PID to syslog messages. 74/2774/2
Alexei Gradinari [Thu, 5 May 2016 21:41:21 +0000 (17:41 -0400)] 
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

9 years agoconfigure: Fix errors with AST_UNDEFINED_SANITIZER/AST_LEAK_SANITIZER 09/2809/1
Matt Jordan [Wed, 11 May 2016 19:07:17 +0000 (14:07 -0500)] 
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

9 years agoMerge "res_pjsip: improve realtime performance" into 13
zuul [Wed, 11 May 2016 17:22:10 +0000 (12:22 -0500)] 
Merge "res_pjsip: improve realtime performance" into 13

9 years agoMerge "res_fax/t38_gateway: Peer V.21 session is created on wrong channel" into 13
zuul [Wed, 11 May 2016 15:19:50 +0000 (10:19 -0500)] 
Merge "res_fax/t38_gateway: Peer V.21 session is created on wrong channel" into 13

9 years agoMerge "app_confbridge: Add a regcontext option for confbridge bridge profiles." into 13
Joshua Colp [Tue, 10 May 2016 09:48:44 +0000 (04:48 -0500)] 
Merge "app_confbridge: Add a regcontext option for confbridge bridge profiles." into 13

9 years agoMerge "res_pjsip_authenticator_digest: Don't use source port in nonce verification...
zuul [Tue, 10 May 2016 03:34:39 +0000 (22:34 -0500)] 
Merge "res_pjsip_authenticator_digest: Don't use source port in nonce verification" into 13

9 years agoMerge "pjproject_bundled: Check for python-dev and TEST_FRAMEWORK" into 13
Joshua Colp [Tue, 10 May 2016 01:11:30 +0000 (20:11 -0500)] 
Merge "pjproject_bundled:  Check for python-dev and TEST_FRAMEWORK" into 13

9 years agores_pjsip_authenticator_digest: Don't use source port in nonce verification 70/2770/2
Kevin Harwell [Thu, 5 May 2016 16:37:37 +0000 (11:37 -0500)] 
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

9 years agoconfig_transport: Tell pjproject to allow all SSL/TLS protocols 82/2782/2
George Joseph [Sat, 7 May 2016 19:39:25 +0000 (13:39 -0600)] 
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

9 years agoMerge "res_pjsip: module load priority" into 13
zuul [Mon, 9 May 2016 16:03:14 +0000 (11:03 -0500)] 
Merge "res_pjsip: module load priority" into 13

9 years agoMerge "file: Ensure nativeformats remains valid for lifetime of use." into 13
zuul [Mon, 9 May 2016 13:27:51 +0000 (08:27 -0500)] 
Merge "file: Ensure nativeformats remains valid for lifetime of use." into 13

9 years agoapp_confbridge: Add a regcontext option for confbridge bridge profiles. 69/2769/6
Jaco Kroon [Wed, 4 May 2016 07:40:55 +0000 (09:40 +0200)] 
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

9 years agoMerge "stasis_endpoints: Add new Status and Headers to ContactStatus" into 13
zuul [Mon, 9 May 2016 11:46:16 +0000 (06:46 -0500)] 
Merge "stasis_endpoints: Add new Status and Headers to ContactStatus" into 13

9 years agopjproject_bundled: Check for python-dev and TEST_FRAMEWORK 86/2786/1
George Joseph [Mon, 9 May 2016 01:19:50 +0000 (19:19 -0600)] 
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

9 years agores_pjsip: module load priority 60/2760/3
Alexei Gradinari [Wed, 4 May 2016 20:16:24 +0000 (16:16 -0400)] 
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

9 years agoconfig_options.c: Expand #ifdef to contain whole if statement. 75/2775/1
Chris Trobridge [Wed, 4 May 2016 08:17:26 +0000 (09:17 +0100)] 
config_options.c: Expand #ifdef to contain whole if statement.

ASTERISK-25956 #close

Change-Id: If6961ec54be276d5ab4f012ee7e7b420cb45de38

9 years agostasis_endpoints: Add new Status and Headers to ContactStatus 73/2773/1
Alexei Gradinari [Thu, 5 May 2016 20:16:16 +0000 (16:16 -0400)] 
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

9 years agoMerge "pjsip: Added "reg_server" to contacts (fixed alembic)" into 13
zuul [Thu, 5 May 2016 18:15:16 +0000 (13:15 -0500)] 
Merge "pjsip: Added "reg_server" to contacts (fixed alembic)" into 13

9 years agofile: Ensure nativeformats remains valid for lifetime of use. 62/2762/2
Joshua Colp [Thu, 5 May 2016 10:07:50 +0000 (07:07 -0300)] 
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

9 years agores_pjsip: improve realtime performance 22/2622/13
Alexei Gradinari [Fri, 15 Apr 2016 14:32:12 +0000 (10:32 -0400)] 
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

9 years agoMerge "res_fax: add FAXMODE variable" into 13
zuul [Thu, 5 May 2016 14:18:34 +0000 (09:18 -0500)] 
Merge "res_fax: add FAXMODE variable" into 13

9 years agopjsip: Added "reg_server" to contacts (fixed alembic) 61/2761/1
Alexei Gradinari [Wed, 4 May 2016 21:11:17 +0000 (17:11 -0400)] 
pjsip: Added "reg_server" to contacts (fixed alembic)

ASTERISK-25931

Change-Id: Icc4321a88f5c93ff809da3f372eebbf69c6a8549

9 years agoMerge "res_pjsip/AMI: add contact.updated event" into 13
zuul [Wed, 4 May 2016 02:42:12 +0000 (21:42 -0500)] 
Merge "res_pjsip/AMI: add contact.updated event" into 13

9 years agoMerge "app_voicemail: always copy dynamic struct to avoid race condition" into 13
Joshua Colp [Wed, 4 May 2016 00:14:31 +0000 (19:14 -0500)] 
Merge "app_voicemail: always copy dynamic struct to avoid race condition" into 13

9 years agoMerge "pjproject_bundled: Various fixes discovered during testing of OSes" into 13
zuul [Wed, 4 May 2016 00:11:12 +0000 (19:11 -0500)] 
Merge "pjproject_bundled:  Various fixes discovered during testing of OSes" into 13

9 years agores_pjsip/AMI: add contact.updated event 56/2556/2
Alexei Gradinari [Thu, 7 Apr 2016 21:33:49 +0000 (17:33 -0400)] 
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

9 years agores_fax: add FAXMODE variable 43/2743/2
Alexei Gradinari [Mon, 2 May 2016 21:08:06 +0000 (17:08 -0400)] 
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

9 years agores_fax/t38_gateway: Peer V.21 session is created on wrong channel 44/2744/2
Alexei Gradinari [Mon, 2 May 2016 21:52:16 +0000 (17:52 -0400)] 
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

9 years agoMerge "pjsip: Added "reg_server" to contacts." into 13
Joshua Colp [Tue, 3 May 2016 17:41:23 +0000 (12:41 -0500)] 
Merge "pjsip: Added "reg_server" to contacts." into 13

9 years agoconfigs/basic-pbx/asterisk.conf: contains incorrect path separator 49/2749/1
Diederik de Groot [Sun, 1 May 2016 07:21:33 +0000 (09:21 +0200)] 
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

9 years agopjproject_bundled: Various fixes discovered during testing of OSes 47/2747/1
George Joseph [Sat, 30 Apr 2016 22:52:47 +0000 (16:52 -0600)] 
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

9 years agoapp_voicemail: always copy dynamic struct to avoid race condition 33/2433/13
Andrew Nagy [Thu, 17 Mar 2016 19:29:38 +0000 (12:29 -0700)] 
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

9 years agopjsip: Added "reg_server" to contacts. 24/2624/6
Alexei Gradinari [Fri, 15 Apr 2016 19:26:15 +0000 (15:26 -0400)] 
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

9 years agoMerge "pjproject_bundled: Disable PJSIP_UNESCAPE_IN_PLACE" into 13
zuul [Fri, 29 Apr 2016 20:08:33 +0000 (15:08 -0500)] 
Merge "pjproject_bundled:  Disable PJSIP_UNESCAPE_IN_PLACE" into 13

9 years agoMerge "res_pjsip: Start body generator users after suppliers." into 13
Joshua Colp [Fri, 29 Apr 2016 18:11:37 +0000 (13:11 -0500)] 
Merge "res_pjsip: Start body generator users after suppliers." into 13

9 years agoMerge "res_pjsip_pubsub.c: Fix body generator registration race." into 13
zuul [Fri, 29 Apr 2016 18:06:27 +0000 (13:06 -0500)] 
Merge "res_pjsip_pubsub.c: Fix body generator registration race." into 13

9 years agoMerge "chan_sip: Make autocreated peers send PeerStatus events" into 13
zuul [Fri, 29 Apr 2016 17:13:57 +0000 (12:13 -0500)] 
Merge "chan_sip: Make autocreated peers send PeerStatus events" into 13

9 years agoMerge "res_pjsip_outbound_publish.c: Remove redundant flag check." into 13
Joshua Colp [Fri, 29 Apr 2016 09:57:32 +0000 (04:57 -0500)] 
Merge "res_pjsip_outbound_publish.c: Remove redundant flag check." into 13

9 years agoMerge "res_pjsip_pubsub.c: Add useful information to some messages." into 13
zuul [Fri, 29 Apr 2016 04:01:59 +0000 (23:01 -0500)] 
Merge "res_pjsip_pubsub.c: Add useful information to some messages." into 13

9 years agoMerge "res_pjsip_pubsub.h: Fix doxygen association." into 13
zuul [Fri, 29 Apr 2016 03:43:32 +0000 (22:43 -0500)] 
Merge "res_pjsip_pubsub.h: Fix doxygen association." into 13

9 years agoMerge "res_pjsip: Add ability to identify by Authorization username" into 13
zuul [Thu, 28 Apr 2016 22:49:56 +0000 (17:49 -0500)] 
Merge "res_pjsip:  Add ability to identify by Authorization username" into 13

9 years agores_pjsip: Start body generator users after suppliers. 31/2731/1
Richard Mudgett [Thu, 28 Apr 2016 16:35:44 +0000 (11:35 -0500)] 
res_pjsip: Start body generator users after suppliers.

Change-Id: I8f0b57841feaab56c8a4e821b5ccb4e05e5fbadb

9 years agores_pjsip_pubsub.c: Add useful information to some messages. 29/2729/1
Richard Mudgett [Thu, 28 Apr 2016 21:06:57 +0000 (16:06 -0500)] 
res_pjsip_pubsub.c: Add useful information to some messages.

Change-Id: Ia0b2e15773894c599e5c5748bbc70e99f434192a

9 years agores_pjsip_pubsub.c: Fix body generator registration race. 27/2727/1
Richard Mudgett [Tue, 26 Apr 2016 20:58:06 +0000 (15:58 -0500)] 
res_pjsip_pubsub.c: Fix body generator registration race.

Change-Id: Id8752073ef06472a2fd96080f4009fac42843e67

9 years agores_pjsip_pubsub.h: Fix doxygen association. 23/2723/1
Richard Mudgett [Tue, 26 Apr 2016 20:13:50 +0000 (15:13 -0500)] 
res_pjsip_pubsub.h: Fix doxygen association.

Change-Id: I110d3e3572598289fcd4215d966cf0c858f98632

9 years agores_pjsip_outbound_publish.c: Remove redundant flag check. 21/2721/1
Richard Mudgett [Mon, 25 Apr 2016 21:00:30 +0000 (16:00 -0500)] 
res_pjsip_outbound_publish.c: Remove redundant flag check.

Change-Id: I0da80a3c3e0eae0c52ff27e7412ba027d6f52353

9 years agopjproject_bundled: Disable PJSIP_UNESCAPE_IN_PLACE 24/2724/1
George Joseph [Thu, 28 Apr 2016 21:54:07 +0000 (15:54 -0600)] 
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

9 years agoMerge "func_odbc: Check connection status before executing queries." into 13
Joshua Colp [Thu, 28 Apr 2016 11:50:55 +0000 (06:50 -0500)] 
Merge "func_odbc: Check connection status before executing queries." into 13

9 years agores_pjsip: Add ability to identify by Authorization username 67/2367/18
George Joseph [Tue, 8 Mar 2016 00:34:31 +0000 (17:34 -0700)] 
res_pjsip:  Add ability to identify by Authorization username

A feature of chan_sip that service providers relied upon was the ability to
identify by the Authorization username.  This is most often used when customers
have a PBX that needs to register rather than identify by IP address.  From my
own experiance, this is pretty common with small businesses who otherwise
don't need a static IP.

In this scenario, a register from the customer's PBX may succeed because From
will usually contain the PBXs account id but an INVITE will contain the caller
id.  With nothing recognizable in From, the service provider's Asterisk can
never match to an endpoint and the INVITE just stays unauthorized.

The fixes:

A new value "auth_username" has been added to endpoint/identify_by that
will use the username and digest fields in the Authorization header
instead of username and domain in the the From header to match an endpoint,
or the To header to match an aor.  This code as added to
res_pjsip_endpoint_identifier_user rather than creating a new module.

Although identify_by was always a comma-separated list, there was only
1 choice so order wasn't preserved.  So to keep the order, a vector was added
to the end of ast_sip_endpoint.  This is only used by res_pjsip_registrar
to find the aor.  The res_pjsip_endpoint_identifier_* modules are called in
globals/endpoint_identifier_order.

Along the way, the logic in res_pjsip_registrar was corrected to match
most-specific to least-specific as res_pjsip_endpoint_identifier_user does.

The order is:

username@domain
username@domain_alias
username

Auth by username does present 1 problem however, the first INVITE won't have
an Authorization header so the distributor, not finding a match on anything,
sends a securty_alert.  It still sends a 401 with a challenge so the next
INVITE will have the Authorization header and presumably succeed.  As a result
though, that first security alert is actually a false alarm.

To address this, a new feature has been added to pjsip_distributor that keeps
track of unidentified requests and only sends the security alert if a
configurable number of unidentified requests come from the same IP in a
configurable amout of time.  Those configuration options have been added to
the global config object.  This feature is only used when auth_username
is enabled.

Finally, default_realm was added to the globals object to replace the hard
coded "asterisk" used when an endpoint is not yet identified.

The testsuite tests all pass but new tests are forthcoming for this new
feature.

ASTERISK-25835 #close
Reported-by: Ross Beer
Change-Id: I30ba62d208e6f63439600916fcd1c08a365ed69d

9 years agoMerge "config: Fix ast_config_text_file_save2 writability check for missing files...
Joshua Colp [Wed, 27 Apr 2016 21:20:31 +0000 (16:20 -0500)] 
Merge "config:  Fix ast_config_text_file_save2 writability check for missing files" into 13

9 years agoMerge "res_pjsip: disable multi domain to improve realtime performace" into 13
Joshua Colp [Wed, 27 Apr 2016 19:03:53 +0000 (14:03 -0500)] 
Merge "res_pjsip: disable multi domain to improve realtime performace" into 13

9 years agofunc_odbc: Check connection status before executing queries. 15/2715/1
Mark Michelson [Wed, 27 Apr 2016 18:23:37 +0000 (13:23 -0500)] 
func_odbc: Check connection status before executing queries.

A recent change to func_odbc made it so that a single connection was
maintained per DSN. The problem was that the code was optimistic about
the health of the connection after initially opening it and did nothing
to re-connect in case the connection had died.

This change adds a check before executing a query to ensure that the
connection to the database is still up and running.

ASTERISK-25963 #close
Reported by Ross Beer

Change-Id: Id33c86eb04ff48ca088bb2e3086c27b3b683491d

9 years agores_pjsip: disable multi domain to improve realtime performace 23/2623/3
Alexei Gradinari [Fri, 15 Apr 2016 16:59:42 +0000 (12:59 -0400)] 
res_pjsip: disable multi domain to improve realtime performace

This patch added new global pjsip option 'disable_multi_domain'.
Disabling Multi Domain can improve Realtime performance by reducing
number of database requests.

ASTERISK-25930 #close

Change-Id: I2e7160f3aae68475d52742107949a799aa2c7dc7

9 years agoMerge "res_pjsip: Add serialized scheduler (res_pjsip/pjsip_scheduler.c)" into 13
Joshua Colp [Wed, 27 Apr 2016 15:12:31 +0000 (10:12 -0500)] 
Merge "res_pjsip:  Add serialized scheduler (res_pjsip/pjsip_scheduler.c)" into 13

9 years agoMerge "chan_sip: Give more time for TCP/TLS threads to stop." into 13
zuul [Wed, 27 Apr 2016 13:50:35 +0000 (08:50 -0500)] 
Merge "chan_sip: Give more time for TCP/TLS threads to stop." into 13

9 years agochan_sip: Give more time for TCP/TLS threads to stop. 01/2701/4
Joshua Colp [Tue, 26 Apr 2016 16:13:14 +0000 (13:13 -0300)] 
chan_sip: Give more time for TCP/TLS threads to stop.

The unload process currently tells each TCP/TLS to terminate but
does not wait for them to do so. This introduces a race condition
where the container holding the threads may be destroyed before
the threads are able to remove themselves from it. When they
finally do the container is invalid and can't be used causing a
crash.

A previous change existed which waited a bit to wait for any
stranglers to finish. This change extends this and waits longer.

ASTERISK-25961 #close

Change-Id: Idc6262b670ca49ede32061159e323b7b63c6f3c6

9 years agoapp_queue: Fix crash when unloading module. 04/2704/2
Joshua Colp [Tue, 26 Apr 2016 10:48:40 +0000 (07:48 -0300)] 
app_queue: Fix crash when unloading module.

When unloading the app_queue module the members in each queue are
destroyed and as part of this they are removed from the pending
members container. Unfortunately a crash would occur as the container
was destroyed before the members were removed.

This change tweaks ordering so the container destruction occurs
after the members are destroyed.

ASTERISK-16115

Change-Id: I48c728668c55aee3d05b751a5d450fb57e87f44b

9 years agoMerge changes from topic 'system_stress_patches' into 13
Joshua Colp [Tue, 26 Apr 2016 09:57:07 +0000 (04:57 -0500)] 
Merge changes from topic 'system_stress_patches' into 13

* changes:
  test_message.c: Wait longer in case dialplan also processes the test message.
  Manager: Short circuit AMI message processing.
  manager.c: Eliminate most RAII_VAR usage.
  manager_channels.c: Fix allocation failure crash.

9 years agoMerge changes from topic 'system_stress_patches' into 13
Joshua Colp [Tue, 26 Apr 2016 09:56:36 +0000 (04:56 -0500)] 
Merge changes from topic 'system_stress_patches' into 13

* changes:
  Bridge system: Fix memory leaks and double frees on impart failure.
  bridge_softmix.c: Fix crash if channel fails to join mixing tech.

9 years agoconfig: Fix ast_config_text_file_save2 writability check for missing files 91/2691/4
George Joseph [Mon, 25 Apr 2016 03:51:16 +0000 (21:51 -0600)] 
config:  Fix ast_config_text_file_save2 writability check for missing files

A patch I did back in 2014 modified ast_config_text_file_save2 to check the
writability of the main file and include files before truncating and re-writing
them.  An unintended side-effect of this was that if a file doesn't exist,
the check fails and the write is aborted.

This patch causes ast_config_text_file_save2 to check the writability of the
parent directory of missing files instead of checking the file itself.  This
allows missing files to be created again.  A unit test was also added to
test_config to test saving of config files.

The regression was discovered when app_voicemail's passwordlocation=spooldir
feature stopped working.

ASTERISK-25917 #close
Reported-by: Jonathan Rose
Change-Id: Ic4dbe58c277a47b674679e49daed5fc6de349f80

9 years agoMerge "app_queue: queue members can receive multiple calls" into 13
Joshua Colp [Mon, 25 Apr 2016 22:47:02 +0000 (17:47 -0500)] 
Merge "app_queue: queue members can receive multiple calls" into 13

9 years agochan_sip: Make autocreated peers send PeerStatus events 03/2703/1
kkm [Fri, 22 Apr 2016 04:53:46 +0000 (21:53 -0700)] 
chan_sip: Make autocreated peers send PeerStatus events

Since Stasis has been introduced, an attempt to send AMI messages by an
autocreated peer caused a crash, and all events from autocreated peers were
semi-inadvertently disabled altogether in 0b83761. This change restores the
disabled functionality.

ASTERISK-25950

Change-Id: Iecc350f23db603fadb2f302064643ebe9664e974

9 years agoMerge "Fix case sensitive actions in AMI QueueSummary and QueueStatus" into 13
zuul [Mon, 25 Apr 2016 19:18:09 +0000 (14:18 -0500)] 
Merge "Fix case sensitive actions in AMI QueueSummary and QueueStatus" into 13

9 years agoapp_queue: queue members can receive multiple calls 77/2677/2
Kevin Harwell [Thu, 21 Apr 2016 19:23:21 +0000 (14:23 -0500)] 
app_queue: queue members can receive multiple calls

It was possible for a queue member that is a member of at least 2 or more
queues to receive mulitiple calls at the same time. This happened because
of a race between when a member was being rung and when the device state
notified the other queue(s) member object of the state change.

This patch makes it so when a queue member is being rung it gets added to
a global pool of queue members. If that same member is tried again, e.g.
from another queue, and it is found to already exist in the pending member
container then it will not ring that member.

ASTERISK-16115 #close

Change-Id: I546dd474776d158c2b6be44205353dee5bac7e48

9 years agoMerge "res_agi: Prevent run_agi from eating frames it shouldn't" into 13
zuul [Mon, 25 Apr 2016 16:49:18 +0000 (11:49 -0500)] 
Merge "res_agi:  Prevent run_agi from eating frames it shouldn't" into 13

9 years agoFix case sensitive actions in AMI QueueSummary and QueueStatus 96/2696/2
DarkS [Mon, 25 Apr 2016 13:11:31 +0000 (15:11 +0200)] 
Fix case sensitive actions in AMI QueueSummary and QueueStatus

ASTERISK-25954 #close
Reported by: Javier Acosta

Change-Id: I00be83d45cc7e8385de2523012bd196aafeeb256

9 years agores_agi: Prevent run_agi from eating frames it shouldn't 87/2687/3
George Joseph [Fri, 22 Apr 2016 22:53:23 +0000 (16:53 -0600)] 
res_agi:  Prevent run_agi from eating frames it shouldn't

The run_agi function is eating control frames when it shouldn't be. This is
causing issues when an AGI is run from CONNECTED_LINE_SEND_SUB in a blond
transfer.

Alice calls Bob. Bob attended transfers to Charlie but hangs up before Charlie
answers.

Alice gets the COLP UPDATE indicating Charlie but Charlie never gets an UPDATE
and is left thinking he's connected to Bob.

In this case, when CONNECTED_LINE_SEND_SUB runs on Alice's channel and it calls
an AGI, the extra eaten frames prevent CONNECTED_LINE_SEND_SUB from running on
Charlie's channel.

The fix was to accumulate deferrable frames in the "forever" loop instead of
dropping them, and re-queue them just before running the actual agi command
or exiting.

ASTERISK-25951 #close

Change-Id: I0f4bbfd72fc1126c2aaba41da3233a33d0433645

9 years agoMerge "func_odbc: Use one connection per DSN." into 13
zuul [Mon, 25 Apr 2016 01:14:32 +0000 (20:14 -0500)] 
Merge "func_odbc: Use one connection per DSN." into 13

9 years agoMerge "Remove reference to non-existent sip.conf option" into 13
zuul [Fri, 22 Apr 2016 23:55:42 +0000 (18:55 -0500)] 
Merge "Remove reference to non-existent sip.conf option" into 13

9 years agoMerge "res_stasis: Handle re-enter stasis bridge with swap channel." into 13
zuul [Fri, 22 Apr 2016 23:55:41 +0000 (18:55 -0500)] 
Merge "res_stasis: Handle re-enter stasis bridge with swap channel." into 13

9 years agoMerge "bridge: Hold off more than one imparting channel at a time." into 13
zuul [Fri, 22 Apr 2016 23:29:19 +0000 (18:29 -0500)] 
Merge "bridge: Hold off more than one imparting channel at a time." into 13

9 years agotest_message.c: Wait longer in case dialplan also processes the test message. 85/2685/1
Richard Mudgett [Fri, 22 Apr 2016 20:25:29 +0000 (15:25 -0500)] 
test_message.c: Wait longer in case dialplan also processes the test message.

Bumped the wait from 1 second to 5 seconds.  The test message was hitting my
default call handler and failing the test because it took longer.

Change-Id: I3a03737f25e92983de00548fcc7bbc50dd7544ba

9 years agoManager: Short circuit AMI message processing. 87/2587/2
Richard Mudgett [Tue, 12 Apr 2016 20:29:52 +0000 (15:29 -0500)] 
Manager: Short circuit AMI message processing.

Improve AMI message processing performance if there are no consumers
listening for the messages.  We now skip creating the AMI event message
text strings.

Change-Id: I7b22fc5ec4e500d00635c1a467aa8ea68a1bb2b3