Commit Graph

2129 Commits

Author SHA1 Message Date
Sean Bright 04d3785a79 dtls: Add support for ephemeral DTLS certificates.
This mimics the behavior of Chrome and Firefox and creates an ephemeral
X.509 certificate for each DTLS session.

Currently, the only supported key type is ECDSA because of its faster
generation time, but other key types can be added in the future as
necessary.

ASTERISK-27395

Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4
2017-11-06 08:11:48 -05:00
Joshua Colp 9e1fbab382 res_pjsip: Add 'ip' as a valid option to 'identify_by' on endpoint.
When the identify_by option on an endpoint is set to ip it will
only be identified using the res_pjsip_endpoint_identifier_ip module.
This ensures that it is not mistakenly matched using the username of
the From header. To ensure behavior has not changed the default has
been changed to "username,ip" for the identify_by option.

ASTERISK-27206

Change-Id: I2170b86a7f7e221b4f00bf14aa1ef1ac5b050bbd
2017-10-25 18:14:03 +00:00
Nir Simionovich 4559cd0e28 This patch adds a beanstalk CDR backend.
Beanstalkd is a simple to use job queue. It provides a means to
create multiple job queues called "tubes". Each tube can store
multiple jobs, with varying priorities with the queue. Queue
processing is available via a simple TCP socket or via well defined
libraries, avaialble at
https://github.com/kr/beanstalkd/wiki/client-libraries

This module is based upon the beanstalk-client library, available
for download at: https://github.com/deepfryed/beanstalk-client

Change-Id: I5fe4089a34ab3b39230786d9bbfddafa56715f48
2017-10-20 10:08:05 -04:00
Jenkins2 1505c1bb09 Merge "res_pjsip_registrar.c: Update remove_existing AOR contact handling." 2017-10-11 06:49:54 -05:00
Richard Mudgett fb19799b62 res_pjsip_registrar.c: Update remove_existing AOR contact handling.
When "rewrite_contact" is enabled, the "max_contacts" count option can
block re-registrations because the source port from the endpoint can be
random.  When the re-registration is blocked, the endpoint may give up
re-registering and require manual intervention.

* The "remove_existing" option now allows a registration to succeed by
displacing any existing contacts that now exceed the "max_contacts" count.
Any removed contacts are the next to expire.  The behaviour change is
beneficial when "rewrite_contact" is enabled and "max_contacts" is greater
than one.  The removed contact is likely the old contact created by
"rewrite_contact" that the device is refreshing.

ASTERISK-27192

Change-Id: I64c107a10b70db1697d17136051ae6bf22b5314b
2017-10-09 12:52:30 -05:00
Sean Bright ad38a55a2d res_config_sqlite: Don't enable SQLite CDRs when running 'make samples'
Change-Id: I65a5190b2732b2246d67472db70dd37db64ddad4
2017-10-09 08:16:44 -05:00
George Joseph d178f497d2 res_pjsip: Filter out non SIP(S) requests
Incoming requests with non sip(s) URIs in the Request, To, From
or Contact URIs are now rejected with
PJSIP_SC_UNSUPPORTED_URI_SCHEME (416).  This is performed in
pjsip_message_filter (formerly pjsip_message_ip_updater) and is
done at pjproject's "TRANSPORT" layer before a request can even
reach the distributor.

URIs read by res_pjsip_outbound_publish from pjsip.conf are now
also checked for both length and sip(s) scheme.  Those URIs read
by outbound registration and aor were already being checked for
scheme but their error messages needed to be updated to include
scheme failure as well as length failure.

Change-Id: Ibb2f9f1d2dc7549da562af4cbd9156c44ffdd460
2017-09-14 14:18:42 -05:00
George Joseph 446d48fd49 res_pjsip: Add handling for incoming unsolicited MWI NOTIFY
A new endpoint parameter "incoming_mwi_mailbox" allows Asterisk to
receive unsolicited MWI NOTIFY requests and make them available to
other modules via the stasis message bus.

res_pjsip_pubsub has a new handler "pubsub_on_rx_mwi_notify_request"
that parses a simple-message-summary body and, if
endpoint->incoming_mwi_account is set, calls ast_publish_mwi_state
with the voice-message counts from the message.

Change-Id: I08bae3d16e77af48fcccc2c936acce8fc0ef0f3c
2017-09-13 09:24:28 -05:00
Corey Farrell 1bf3dfffd7 AST-2017-006: Fix app_minivm application MinivmNotify command injection
An admin can configure app_minivm with an externnotify program to be run
when a voicemail is received.  The app_minivm application MinivmNotify
uses ast_safe_system() for this purpose which is vulnerable to command
injection since the Caller-ID name and number values given to externnotify
can come from an external untrusted source.

* Add ast_safe_execvp() function.  This gives modules the ability to run
external commands with greater safety compared to ast_safe_system().
Specifically when some parameters are filled by untrusted sources the new
function does not allow malicious input to break argument encoding.  This
may be of particular concern where CALLERID(name) or CALLERID(num) may be
used as a parameter to a script run by ast_safe_system() which could
potentially allow arbitrary command execution.

* Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp()
instead of ast_safe_system() to avoid command injection.

* Document code injection potential from untrusted data sources for other
shell commands that are under user control.

ASTERISK-27103

Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
2017-08-30 18:43:38 +00:00
Richard Mudgett 5bbf7b2aad app_confbridge: Document sfu video_mode value.
Change-Id: I26e17df2c93f3933b23f78070603adbcc84ba204
2017-08-22 11:23:45 -05:00
Andrey Egorov 15fbcc74d8 res_xmpp: Google OAuth 2.0 protocol support for XMPP / Motif
Add ability to use tokens instead of passwords according to Google OAuth 2.0
protocol.

ASTERISK-27169
Reported by: Andrey Egorov
Tested by: Andrey Egorov

Change-Id: I07f7052a502457ab55010a4d3686653b60f4c8db
2017-08-15 06:09:52 -05:00
Sean Bright 3f98488279 app_queue: Add announce-position-only-up option
Setting this option will cause the Queue application to only announce
the caller's position if it has improved since the last time that we
announced it.

Change-Id: I173a124121422209485b043e2bf784f54242fce6
2017-08-01 15:42:37 -06:00
Joshua Colp b610295b62 Merge "bridge_softmix / res_rtp_asterisk: Fix packet loss and renegotiation issues." 2017-07-26 08:31:13 -05:00
Jenkins2 62c381afdb Merge "core: Add PARSE_TIMELEN support to ast_parse_arg and ACO." 2017-07-19 09:25:59 -05:00
Joshua Colp 680c491a62 bridge_softmix / res_rtp_asterisk: Fix packet loss and renegotiation issues.
This change does a few things to improve packet loss and renegotiation:

1. On outgoing RTP streams we will now properly reflect out of order
packets and packet loss in the sequence number. This allows the
remote jitterbuffer to better reorder things.

2. Video updates can now be discarded for a period of time
after one has been sent to prevent flooding of clients.

3. For declined and removed streams we will now release any
media session resources associated with them. This was not
previously done and caused an issue where old state was being
used for a new stream.

4. RTP bundling was not actually removing bundled RTP instances
from the parent. This has been resolved by removing based on
the RTP instance itself and not the SSRC.

5. The code did not properly handle explicitly unbundling an
RTP instance from its parent. This now works as expected.

ASTERISK-27143

Change-Id: Ibd91362f0e4990b6129638e712bc8adf0899fd45
2017-07-19 13:23:26 +00:00
Kevin Harwell 7da6ddda30 res_pjsip: Add "webrtc" configuration option
This patch creates a new configuration option called "webrtc". When enabled it
defaults and enables the following options that are needed in order for webrtc
to work in Asterisk:

  rtcp-mux, use_avpf, ice_support, and use_received_transport=enabled
  media_encryption=dtls
  dtls_verify=fingerprint
  dtls_setup=actpass

When "webrtc" is enabled, this patch also parses the "msid" media level
attribute from an SDP. It will also appropriately add it onto the outgoing
session when applicable.

Lastly, when "webrtc" is enabled h264 RTCP FIR feedback frames are now sent.

ASTERISK-27119 #close

Change-Id: I5ec02e07c5d5b9ad86a34fdf31bf2f9da9aac6fd
2017-07-13 18:19:35 -05:00
Corey Farrell 78a50b0343 core: Add PARSE_TIMELEN support to ast_parse_arg and ACO.
This adds support for parsing timelen values from config files.  This
includes support for all flags which apply to PARSE_INT32.  Support for
this parser is added to ACO via the OPT_TIMELEN_T option type.

Fixes an issue where extra characters provided to ast_app_parse_timelen
were ignored, they now cause an error.

Testing is included.

ASTERISK-27117 #close

Change-Id: I6b333feca7e3f83b4ef5bf2636fc0fd613742554
2017-07-13 11:44:14 -04:00
Sean Bright e83b9d141a basic-pbx: Remove res_pjsip_multihomed from sample config
ASTERISK-27127 #close
Reported by: HZMI8gkCvPpom0tM

Change-Id: I2b0c54570d58156e37166ac536728af3b6c01789
2017-07-12 15:08:41 -05:00
George Joseph b7a875778a res_musiconhold: Add kill_escalation_delay, kill_method to class
By default, when res_musiconhold reloads or unloads, it sends a HUP
signal to custom applications (and all descendants), waits 100ms,
then sends a TERM signal, waits 100ms, then finally sends a KILL
signal.  An application which is interacting with an external
device and/or spawns children of its own may not be able to exit
cleanly in the default times, expecially if sent a KILL signal, or
if it's children are getting signals directly from
res_musiconhoild.

* To allow extra time, the 'kill_escalation_delay'
  class option can be used to set the number of milliseconds
  res_musiconhold waits before escalating kill signals, with the
  default being the current 100ms.

* To control to whom the signals are sent, the "kill_method" class
  option can be set to "process_group" (the default, existing
  behavior), which sends signals to the application and its
  descendants directly, or "process" which sends signals only to the
  application itself.

Change-Id: Iff70a1a9405685a9021a68416830c0db5158603b
2017-07-11 14:43:41 -06:00
George Joseph c0c99c7618 chan_pjsip: Fix ability to send UPDATE on COLP
When connected_line_method is "invite", we're supposed to determine
if the client can support UPDATE and if it can, send UPDATE instead
of INVITE to avoid the SDP renegotiation.  Not only was pjproject
not setting the PJSIP_INV_SUPPORT_UPDATE flag, we were testing
that invite_tsx wasn't NULL which isn't always the case.

* Updated chan_pjsip/update_connected_line_information to drop the
  requirement that invite_tsx isn't NULL.
* Submitted patch to pjproject sip_inv.c that sets the
  PJSIP_INV_SUPPORT_UPDATE flag correctly.
* Updated pjsip.conf.sample to clarify what happens when "invite"
  is specified.

ASTERISK-27095

Change-Id: Ic2381b3567b8052c616d96fbe79564c530e81560
2017-06-29 15:45:58 -05:00
Jenkins2 366971827a Merge "app_voicemail: IMAP connection control" 2017-06-29 09:51:54 -05:00
Mark Michelson 45df25a579 chan_pjsip: Add support for multiple streams of the same type.
The stream topology (list of streams and order) is now stored with the
configured PJSIP endpoints and used during the negotiation process.

Media negotiation state information has been changed to be stored
in a separate object. Two of these objects exist at any one time
on a session. The active media state information is what was previously
negotiated and the pending media state information is what the
media state will become if negotiation succeeds. Streams and other
state information is stored in this object using the index (or
position) of each individual stream for easy lookup.

The ability for a media type handler to specify a callback for
writing has been added as well as the ability to add file
descriptors with a callback which is invoked when data is available
to be read on them. This allows media logic to live outside of
the chan_pjsip module.

Direct media has been changed so that only the first audio and
video stream are directly connected. In the future once the RTP
engine glue API has been updated to know about streams each individual
stream can be directly connected as appropriate.

Media negotiation itself will currently answer all the provided streams
on an offer within configured limits and on an offer will use the
topology created as a result of the disallow/allow codec lines.

If a stream has been removed or declined we will now mark it as such
within the resulting SDP.

Applications can now also request that the stream topology change.
If we are told to do so we will limit any provided formats to the ones
configured on the endpoint and send a re-invite with the new topology.

Two new configuration options have also been added to PJSIP endpoints:

max_audio_streams: determines the maximum number of audio streams to
offer/accept from an endpoint. Defaults to 1.

max_video_streams: determines the maximum number of video streams to
offer/accept from an endpoint. Defaults to 1.

ASTERISK-27076

Change-Id: I8afd8dd2eb538806a39b887af0abd046266e14c7
2017-06-28 18:36:29 +00:00
Alexei Gradinari 0cef7b9d4e app_voicemail: IMAP connection control
A new global option "imap_poll_logout" was added to specify whether need to
disconnect from the IMAP server after polling of mailboxes.

ASTERISK-27068 #close

Closing IMAP connection after loading mailbox from voicemail.conf

ASTERISK-24052 #close

Change-Id: Ib7558ba04516240a32b65f42e9be64372a0ae12a
2017-06-22 12:23:27 -05:00
Jenkins2 0c0d69d4f3 Merge "cdr: fix mistake spelling of a word for Unanswered." 2017-06-20 09:25:17 -05:00
Rodrigo Ramírez Norambuena a7488f8a70 cdr: fix mistake spelling of a word for Unanswered.
Change-Id: I7a610bef369924523a445c7e849ee88cc45dc5df
2017-06-19 12:28:18 -04:00
Alexei Gradinari 7a46309d3d res_pjsip: New endpoint option "notify_early_inuse_ringing"
This option was added to control whether to notify dialog-info state
'early' or 'confirmed' on Ringing when already INUSE.
The value "yes" is useful for some SIP phones (Cisco SPA)
to be able to indicate and pick up ringing devices.

ASTERISK-26919 #close

Change-Id: Ie050bc30023543c7dfb4365c5be3ce58c738c711
2017-06-16 11:25:07 -05:00
Sean Bright 847087a4ff codecs.conf.sample: Fix max_bandwidth speling error
Reported by Sylvain Boily via asterisk-dev mailing list.

Change-Id: Idc7623f335aea3e144dd369ba383b9a757480a9d
2017-06-11 12:08:05 -05:00
Jenkins2 48d047ad5a Merge "res_pjsip: New endpoint option "refer_blind_progress"" 2017-06-01 10:05:53 -05:00
Jenkins2 77f7c1b98f Merge "Sqlite3: make busy_timeout configurable." 2017-06-01 09:31:24 -05:00
Martin Tomec 44c5a144ce Sqlite3: make busy_timeout configurable.
Enables runtime configuration of busy_timeout for sqlite databases.
Default timeout remains 1000ms.

ASTERISK-27014 #close

Change-Id: I8921a3aac3c335843be4cb17d2dd0a5c157a36da
2017-05-25 10:02:42 +02:00
Joshua Colp 2e7866ebb7 Merge "app_queue: Add QUEUE_RAISE_PENALTY feature" 2017-05-24 13:04:16 -05:00
Steve Davies be4beff3e4 app_queue: Add QUEUE_RAISE_PENALTY feature
Additional variable to work alongside QUEUE_MAX_PENALTY and QUEUE_MIN_PENALTY,
including an extra parameter in queuerules.conf. This value causes lower
Agent penalty values to "raise up" so that they can join higher penalty agents
and be treated equally after a period of time.

ASTERISK-26995 #close

Change-Id: If1c6421a983667a5ac4c359f6dac25b212b4c459
2017-05-22 09:20:02 -03:00
Joshua Colp aa4c800060 Merge "Fix spelling queues.conf.sample file" 2017-05-17 10:40:11 -05:00
Rodrigo Ramírez Norambuena 6e7b78414f Fix spelling queues.conf.sample file
Change-Id: Ie1c2d83af66f27a449da09a68d987e0992627fee
2017-05-14 01:37:09 -04:00
Jenkins2 57217e4cc2 Merge "res_hep_rtcp: Provide chan_sip Call-ID for RTCP messages." 2017-05-11 16:39:54 -05:00
Alexei Gradinari 808f299808 res_pjsip: New endpoint option "refer_blind_progress"
This option was added to turn off notifying the progress details
on Blind Transfer. If this option is not set then the chan_pjsip
will send NOTIFY "200 OK" immediately after "202 Accepted".

Some SIP phones like Mitel/Aastra or Snom keep the line busy until
receive "200 OK".

ASTERISK-26333 #close

Change-Id: Id606fbff2e02e967c02138457badc399144720f2
2017-05-11 10:50:35 -05:00
Joshua Colp 3c36c29c81 res_hep_rtcp: Provide chan_sip Call-ID for RTCP messages.
This change adds the required logic to allow the SIP
Call-ID to be placed into the HEP RTCP traffic if the
chan_sip module is used. In cases where the option is
enabled but the channel is not either SIP or PJSIP then
the code will fallback to the channel name as done
previously.

Based on the change on Nir's branch at:
team/nirs/hep-chan-sip-support

ASTERISK-26427

Change-Id: I09ffa5f6e2fdfd99ee999650ba4e0a7aad6dc40d
2017-05-09 05:38:59 -05:00
George Joseph 201346fb7d logger: Added logger_queue_limit to the configuration options.
All log messages go to a queue serviced by a single thread
which does all the IO.  This setting controls how big that
queue can get (and therefore how much memory is allocated)
before new messages are discarded. The default is 1000.
Should something go bezerk and log tons of messages in a tight
loop, this will prevent memory escalation.

When the limit is reached, a WARNING is logged to that effect
and messages are discarded until the queue is empty again.  At
that time another WARNING will be logged with the count of
discarded messages.  There's no "low water mark" for this queue
because the logger thread empties the entire queue and processes it
in 1 batch before going back and waiting on the queue again.
Implementing a low water mark would mean additional locking as
the thread processes each message and it's not worth it.

A "test" was added to test_logger.c but since the outcome is
non-deterministic, it's really just a cli command, not a unit
test.

Change-Id: Ib4520c95e1ca5325dbf584c7989ce391649836d1
2017-05-08 16:49:13 -05:00
Richard Mudgett 7312cbe803 res_rtp_asterisk.c: Add stun_blacklist option
Added the stun_blacklist option to rtp.conf.  Some multihomed servers have
IP interfaces that cannot reach the STUN server specified by stunaddr.
Blacklist those interface subnets from trying to send a STUN packet to
find the external IP address.  Attempting to send the STUN packet
needlessly delays processing incoming and outgoing SIP INVITEs because we
will wait for a response that can never come until we give up on the
response.  Multiple subnets may be listed.

ASTERISK-26890 #close

Change-Id: I3ff4f729e787f00c3e6e670fe6435acce38be342
2017-04-11 12:58:35 -05:00
Walter Doekes 2b8dbc9e00 samples: Undo removal of include from canonicalize-app-names commit.
This include was accidentally removed in changeset
Ia79aea64de89531362e993e34230c2044a70aa93. My bad.

Change-Id: I1d716c7f9590b4e97909fb8bca1f2ed9bd0e4082
2017-04-08 03:16:26 -05:00
zuul 6ac1c686ca Merge "pjsip: Add Alembic for PUBLISH support." 2017-04-07 15:26:01 -05:00
Joshua Colp 270b485f04 pjsip: Add Alembic for PUBLISH support.
This change adds database tables for the PUBLISH support so it
can be configured using realtime. A minor fix to the
res_pjsip_publish_asterisk module was done so that it read the
sorcery configuration from the correct section. Finally the
sample configuration files have been updated.

ASTERISK-26928

Change-Id: I81991ae5c75af98d247f7eacd1c0b0a763675952
2017-04-07 08:44:49 -05:00
Walter Doekes e6ae3651b8 samples: Canonicalize app names in extensions.conf.sample.
This takes care of warnings by ossobv/asterisklint.

Change-Id: Ia79aea64de89531362e993e34230c2044a70aa93
2017-04-06 15:57:17 -05:00
George Joseph 40e9d5e8b7 sample_config: Add samples for pubsub to pjsip.conf.sample
Added:
 * outbound-publish
 * resource_list
 * inbound-publication
 * asterisk-publication

Change-Id: I65043a896c35483f30a92d30b5b118359af7ba5a
2017-04-05 14:53:20 -05:00
George Joseph 2fe52174de res_pjsip_config_wizard: Add 2 new parameters to help with proxy config
Two new parameters have been added to the pjsip config wizard.

 * Setting 'sends_line_with_registrations' to true will cause the wizard
   to skip the creation of an identify object to match incoming request
   to the endpoint and instead add the line and endpoint parameters to
   the outbound registration object.

 * Setting 'outbound_proxy' is a shortcut for adding individual
   endpoint/outbound_proxy, aor/outbound_proxy and
   registration/outbound_proxy parameters.

Change-Id: I678e5f80765734c056620528a6d40d82736ceeb0
(cherry picked from commit a827892ff7)
(cherry picked from commit 27344675be)
2017-03-28 15:51:21 -06:00
Sean Bright fd204d5c65 res_musiconhold: Document the 'format' option
ASTERISK-26086 #close
Reported by: Jens Bürger

Change-Id: I6aab666c0bf01fd0c64d7a5bcb22fa7f5d41335e
2017-03-27 08:36:32 -06:00
zuul 90634cc184 Merge "rtp_engine: allocate RTP dynamic payloads per session" 2017-03-24 16:22:55 -05:00
Kevin Harwell 9b103e7bea rtp_engine: allocate RTP dynamic payloads per session
Dynamic payload types were statically defined in Asterisk. This unfortunately
limited the number of dynamic payloads that could be registered. With this patch
dynamic payload type numbers are now assigned dynamically and per RTP instance.
However, in order to limit any issues where some clients expect the old
statically defined value this patch makes it so the value Asterisk used to pre-
designate is used for the dynamic assignment if available.

An option, "rtp_use_dynamic", has also been added (can be set in asterisk.conf)
that turns the new dynamic behavior on or off. When off it reverts back to using
statically defined payload values. This option defaults to "yes" in Asterisk 15.

ASTERISK-26515 #close
patches:
  ASTERISK-26515.diff submitted by jcolp (license 5000

Change-Id: I7653465c5ebeaf968f1a1cc8f3f4f5c4321da7fc
2017-03-22 15:43:33 -05:00
Richard Begg 6b7697ed48 res_pjsip_session: Enable RFC3578 overlap dialing support.
Support for RFC3578 overlap dialling (i.e. 484 Response to partially matched
destinations) as currently provided by chan_sip is missing from res_pjsip.
This patch adds a new endpoint attribute (allow_overlap) [defaults to yes]
which when set to yes enables 484 responses to partial destination
matches rather than the current 404.

ASTERISK-26864

Change-Id: Iea444da3ee7c7d4f1fde1d01d138a3d7b0fe40f6
2017-03-22 11:26:48 +00:00
Sean Bright 15aa3c0a23 chan_sip: Add rtcp-mux support
ASTERISK-26846 #close

Change-Id: I541a1602ff55ab73684e9f8002edb9e0e745d639
2017-03-17 07:36:06 -06:00
George Joseph 5013d8f5d3 res_pjsip: Symmetric transports
A new transport parameter 'symmetric_transport' has been added.

When a request from a dynamic contact comes in on a transport with
this option set to 'yes', the transport name will be saved and used
for subsequent outgoing requests like OPTIONS, NOTIFY and INVITE.
It's saved as a contact uri parameter named 'x-ast-txp' and will
display with the contact uri in CLI, AMI, and ARI output.  On the
outgoing request, if a transport wasn't explicitly set on the
endpoint AND the request URI is not a hostname, the saved transport
will be used and the 'x-ast-txp' parameter stripped from the
outgoing packet.

* config_transport was modified to accept and store the new parameter.

* config_transport/transport_apply was updated to store the transport
  name in the pjsip_transport->info field using the pjsip_transport->pool
  on UDP transports.

* A 'multihomed_on_rx_message' function was added to
  pjsip_message_ip_updater that, for incoming requests, retrieves the
  transport name from pjsip_transport->info and retrieves the transport.
  If transport->symmetric_transport is set, an 'x-ast-txp' uri parameter
  containing the transport name is added to the incoming Contact header.

* An 'ast_sip_get_transport_name' function was added to res_pjsip.
  It takes an ast_sip_endpoint and a pjsip_sip_uri and returns a
  transport name if endpoint->transport is set or if there's an
  'x-ast-txp' parameter on the uri and the uri host is an ipv4 or
  ipv6 address.  Otherwise it returns NULL.

* An 'ast_sip_dlg_set_transport' function was added to res_pjsip
  which takes an ast_sip_endpoint, a pjsip_dialog, and an optional
  pjsip_tpselector.  It calls ast_sip_get_transport_name() and if
  a non-NULL is returned, sets the selector and sets the transport
  on the dialog.  If a selector was passed in, it's updated.

* res_pjsip/ast_sip_create_dialog_uac and ast_sip_create_dialog_uas
  were modified to call ast_sip_dlg_set_transport() instead of their
  original logic.

* res_pjsip/create_out_of_dialog_request was modified to call
  ast_sip_get_transport_name() and pjsip_tx_data_set_transport()
  instead of its original logic.

* Existing transport logic was removed from endpt_send_request
  since that can only be called after a create_out_of_dialog_request.

* res_pjsip/ast_sip_create_rdata was converted to a wrapper around
  a new 'ast_sip_create_rdata_with_contact' function which allows
  a contact_uri to be specified in addition to the existing
  parameters.  (See below)

* res_pjsip_pubsub/internal_pjsip_evsub_send_request was eliminated
  since all it did was transport selection and that is now done in
  ast_sip_create_dialog_uac and ast_sip_create_dialog_uas.

* 'contact_uri' was added to subscription_persistence.  This was
  necessary because although the parsed rdata contact header has the
  x-ast-txp parameter added (if appropriate),
  subscription_persistence_update stores the raw packet which
  doesn't have it.  subscription_persistence_recreate was then
  updated to call ast_sip_create_rdata_with_contact with the
  persisted contact_uri so the recreated subscription has the
  correct transport info to send the NOTIFYs.

* res_pjsip_session/internal_pjsip_inv_send_msg was eliminated since
  all it did was transport selection and that is now done in
  ast_sip_create_dialog_uac.

* pjsip_message_ip_updater/multihomed_on_tx_message was updated
  to remove all traces of the x-ast-txp parameter from the
  outgoing headers.

NOTE:  This change does NOT modify the behavior of permanent
contacts specified on an aor.  To do so would require that the
permanent contact's contact uri be updated with the x-ast-txp
parameter and the aor sorcery object updated.  If we need to
persue this, we need to think about cloning permanent contacts into
the same store as the dynamic ones on an aor load so they can be
updated without disturbing the originally configured value.

You CAN add the x-ast-txp parameter to a permanent contact's uri
but it would be much simpler to just set endpoint->transport.

Change-Id: I4ee1f51473da32ca54b877cd158523efcef9655f
2017-03-16 09:49:07 -06:00
Matt Jordan 05713c36ea configs/samples/hep.conf.sample: Clarify how the HEP stack works
This patch updates the documenation in hep.conf.sample to better specify
how the various HEP modules interact.

ASTERISK-26717 #close

Change-Id: I337fb742a89e3ec5edc7fc7a7a0295218d841124
2017-03-14 09:52:59 -06:00
Daniel Journo 60998371e3 app_voicemail: Cannot set fromstring on a per-mailbox basis
* apps/app_voicemail.c fromstring field added to mailbox which will
override the global fromstring if set.

ASTERISK-24562 #close

Change-Id: I5e90e3a1ec2b2d5340b49a0db825e4bbb158b2fe
2017-03-08 13:25:49 -06:00
Joshua Colp 0986998f2f Merge "config: Improve documentation and behavior of outbound_proxy option." 2017-02-28 14:44:29 -06:00
Tzafrir Cohen 6ebdcfe27d pjsip.conf.sample: user_agent: not a specific version
Use the description of useragent from sip.conf here.

ASTERISK-26825 #close

Change-Id: I5b33a4aaa0ae1d793289d05e3bc09521affbf755
2017-02-28 13:41:18 +02:00
frahaase 5b1796f59d Binaural synthesis (confbridge): DTMF conference management.
DTMF configuration options for the binaural softmix bridge:
toggle binaural rendering (per channel).

ASTERISK-26292

Change-Id: Ibfe708b9fe26097c1798fcbfcc4dc461267d8af8
2017-02-24 15:13:56 -06:00
Joshua Colp 2046743938 config: Improve documentation and behavior of outbound_proxy option.
This change updates the documentation for the outbound_proxy option
to ensure it is consistently stated that a full SIP URI must be
provided for the option.

The res_pjsip_outbound_registration module has also been changed so
that the provided outbound_proxy value is checked to ensure it is a
URI and if not an error is output stating so.

ASTERISK-26782

Change-Id: I6c239a32274846fd44e65b44ad9bf6373479b593
2017-02-24 14:05:17 -06:00
Richard Mudgett 0b660c9989 res_pjsip: Update authentication realm documentation.
Using the same auth section for inbound and outbound authentication is not
recommended.  There is a difference in meaning for an empty realm setting
between inbound and outbound authentication uses.

An empty inbound auth realm represents the global section's default_realm
value when the authentication object is used to challenge an incoming
request.  An empty outgoing auth realm is treated as a don't care wildcard
when the authentication object is used to respond to an incoming
authentication challenge.

ASTERISK-26799

Change-Id: Id3952f7cfa1b6683b9954f2c5d2352d2f11059ce
2017-02-20 22:24:31 -06:00
Sean Bright 275f469a4d app_voicemail: Allow 'Comedian Mail' branding to be overriden
Original patch by John Covert, slight modifications by me.

ASTERISK-17428 #close
Reported by: John Covert
Patches:
	app_voicemail.c.patch (license #5512) patch uploaded by
        John Covert

Change-Id: Ic3361b0782e5a5397a19ab18eb8550923a9bd6a6
2017-02-14 16:15:26 -05:00
George Joseph 648d181d2f configs/samples: Fix placement of 'identify' entry in sorcery.conf
The entry for 'identify' was incorrectly placed in the
res_pjsip section when it should be in
res_pjsip_endpoint_identifier_ip.

ASTERISK-26785 #close

Change-Id: Ia1372b12a952bfe2df6b1b1e0e725ca306a5d41a
2017-02-10 09:48:44 -06:00
Sean Bright 4c51ad158d res_odbc: Remove deprecated settings from sample configuration file
ASTERISK-26704 #close
Reported by: Anthony Messina

Change-Id: I976a1f94cf79c5f31e76174c61f5c6a65fd6354f
2017-02-02 11:28:05 -06:00
George Joseph 6f645a6d4e Merge "media: Add experimental support for RTCP feedback." 2017-01-27 07:04:52 -06:00
Lorenzo Miniero 1061539b75 media: Add experimental support for RTCP feedback.
This change adds experimental support for providing RTCP
feedback information to codec modules so they can dynamically
change themselves based on conditions.

ASTERISK-26584

Change-Id: Ifd6aa77fb4a7ff546c6025900fc2baf332c31857
2017-01-23 13:25:31 +01:00
George Joseph d16b3a9917 debug_utilities: Create ast_loggrabber
ast_loggrabber gathers log files from customizable search patterns,
optionally converts POSIX timestamps to a readable format and
tarballs the results.

Also a few tweaks were made to ast_coredumper.

Change-Id: I8bfe1468ada24c1344ce4abab7b002a59a659495
(cherry picked from commit c709152878)
2017-01-20 11:20:22 -06:00
George Joseph 0d53c91fba debug_utilities: Create the ast_coredumper utility
This utility allows easy manipulation of asterisk coredumps.

* Configurable search paths and patterns for existing coredumps
* Can generate a consistent coredump from the running instance
* Can dump the lock_infos table from a coredump
* Dumps backtraces to separate files...
  - thread apply 1 bt full -> <coredump>.thread1.txt
  - thread apply all bt -> <coredump>.brief.txt
  - thread apply all bt full -> <coredump>.full.txt
  - lock_infos table -> <coredump>.locks.txt
* Can tarball corefiles and optionally delete them after processing
* Can tarball results files and optionally delete them after processing
* Converts ':' in coredump and results file names '-' to facilitate
  uploading.  Jira for instance, won't accept file names with colons
  in them.

Tested on Fedora24+, Ubuntu14+, Debian6+, CentOS6+ and FreeBSD9+[1].

[1] For *BSDs, the "devel/gdb" package might have to be installed to
get a recent gdb.  The utility will check all instances of gdb
it finds in $PATH and if one isn't found that can run python, it
prints a friendly error.

Change-Id: I935d37ab9db85ef923f32b05579897f0893d33cd
(cherry picked from commit cb47b45560)
2017-01-11 12:11:45 -06:00
Sebastian Gutierrez 740ca862e4 app_queue: add new Service Level calculation
Adds a new formula for SL2 and documentation

ASTERISK-26559

Change-Id: I0970c620460507cd9d45b0d43600779c8915e770
2017-01-04 14:11:13 -06:00
Richard Mudgett 1dfa11b65c PJPROJECT logging: Made easier to get available logging levels.
Use of the new logging is as simple as issuing the new CLI command or
setting the new pjproject.conf option.

Other options that can affect the logging are how you have the pjproject
log levels mapped to Asterisk log types in pjproject.conf and if you have
configured Asterisk to log the DEBUG type messages.  Altering the
pjproject.conf level mapping shouldn't be necessary for most installations
as the default mapping is sensible.  Configuring Asterisk to log the DEBUG
message type is standard practice for collecting debug information.

* Added CLI "pjproject set log level" command to dynamically adjust the
maximum pjproject log message level.

* Added CLI "pjproject show log level" command to see the currently set
maximum pjproject log message level.

* Added pjproject.conf startup section "log_level" option to set the
initial maximum pjproject log message level so all messages could be
captured from initialization.

* Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into
bundled pjproject.  Pjproject will use the currently set run time log
level to determine if a log message is generated just like Asterisk
verbose and debug logging levels.

* In log_forwarder(), made always log enabled and mapped pjproject log
messages.  DEBUG mapped log messages are no longer gated by the current
Asterisk debug logging level.

* Removed RAII_VAR() from res_pjproject.c:get_log_level().

ASTERISK-26630 #close

Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
2016-11-30 13:11:48 -06:00
Sebastien Duthil c6d755de11 res_ari: Add support for channel variables in ARI events.
This works the same as for AMI manager variables. Set
"channelvars=foo,bar" in your ari.conf general section, and then the
channel variables "foo" and "bar" (along with their values), will
appear in every Stasis websocket channel event.

ASTERISK-26492 #close
patches:
  ari_vars.diff submitted by Mark Michelson

Change-Id: I5609ba239259577c0948645df776d7f3bc864229
2016-11-14 13:51:56 -05:00
zuul 0cc14597b2 Merge "rtp_engine: Allow more than 32 dynamic payload types." 2016-11-07 06:48:38 -06:00
zuul 673964d330 Merge "chan_dahdi: remove by_name support" 2016-11-02 10:51:59 -05:00
Alexander Traud 9ac53877f6 rtp_engine: Allow more than 32 dynamic payload types.
Since adding all remaining rates of Signed Linear (ASTERISK-24274), SILK
(Gerrit 3136) and Codec 2 (ASTERISK-26217), no RTP Payload Type is left in the
dynamic range (96-127). RFC 3551 section 3 allows to reassign other ranges.
Consequently, when the dynamic range is exhausted, this change utilizes payload
types in the range between 35 and 63 giving room for another 29 payload types.

ASTERISK-26311 #close

Change-Id: I7bc96ab764bc30098a178b841cbf7146f9d64964
2016-11-02 08:44:26 -05:00
Kevin Harwell 8060cd1ec1 codecs.conf.sample: Add sample and option descriptions for codec_opus
codecs.conf.sample was missing codec opus's configuration options, descriptions,
and examples. This patch adds the configuration options and examples to
codecs.conf.sample that can be used with codec_opus.

ASTERISK-26538 #close

Change-Id: I1d89bb5e01d3e3b5bd78951b8dd0ff077a83dc8b
2016-11-01 11:02:49 -05:00
Rusty Newton badd38f031 SAC documentation: don't specify transports for endpoints and registrations
Removing explicit transport definition for endpoints and registrations. It
isn't necessary and isn't generally advised.

ASTERISK-26514 #close

Change-Id: Ifdec5e631962438a4683600968dfa4bfd15909fb
2016-10-28 09:50:32 -05:00
Tzafrir Cohen 0646b48ece chan_dahdi: remove by_name support
Support for referring to DAHDI channels by logical names was added in
(FIXME: when? Asterisk 11? 1.8?) and was intended to be part of support
of refering to channels by name.

While technically usable, it has never been properly supported in
dahdi-tools, as using it would require many changes at the Asterisk
level. Instead logical mapping was added at the kernel level.

Thus it seems that refering to DAHDI channels by name is not really used
by anyone, and therefore should probably be removed.

Change-Id: I7d50bbfd9d957586f5cd06570244ef87bd54b485
2016-10-27 23:46:00 +03:00
Joshua Colp aed6c219a3 pjsip: Fix a few media bugs with reinvites and asymmetric payloads.
When channel format changes occurred as a result of an RTP
re-negotiation the bridge was not informed this had happened.
As a result the bridge technology was not re-evaluated and the
channel may have been in a bridge technology that was incompatible
with its formats. The bridge is now unbridged and the technology
re-evaluated when this occurs.

The chan_pjsip module also allowed asymmetric codecs for sending
and receiving. This did not work with all devices and caused one
way audio problems. The default has been changed to NOT do this
but to match the sending codec to the receiving codec. For users
who want asymmetric codecs an option has been added, asymmetric_rtp_codec,
which will return chan_pjsip to the previous behavior.

The codecs returned by the chan_pjsip module when queried by
the bridge_native_rtp module were also not reflective of the
actual negotiated codecs. The nativeformats are now returned as
they reflect the actual negotiated codecs.

ASTERISK-26423 #close

Change-Id: I6ec88c6e3912f52c334f1a26983ccb8f267020dc
2016-10-26 12:48:57 +00:00
Joshua Colp 403c4f5833 pjsip: Support dual stack automatically.
This change adds support for dual stack automatically. No
configuration is required and the IP address and version
in the SIP messages and SDP will be automatically changed
based on the transport over which the message is being
sent. RTP usage has also been changed to listen on both
IPv4 and IPv6 simultaneously to allow media to flow, and
to allow ICE support on both simultaneously. This also
allows failover between IPv6 and IPv4 to work as expected.

ASTERISK-26309 #close

Change-Id: I235a421d8f9a326606d861b449fa6fe3a030572d
2016-10-23 13:53:55 +00:00
Michael Walton 3e96d491d0 res_rtp_asterisk: Add ice_blacklist option
Introduces ice_blacklist configuration in rtp.conf. Subnets listed in the
form ice_blacklist = <subnet spec>, e.g. ice_blacklist =
192.168.1.0/255.255.255.0, are excluded from ICE host, srflx and relay
discovery. This is useful for optimizing the ICE process where a system
has multiple host address ranges and/or physical interfaces and certain
of them are not expected to be used for RTP. Multiple ice_blacklist
configuration lines may be used. If left unconfigured, all discovered
host addresses are used, as per previous behavior.

Documention in rtp.conf.sample.

ASTERISK-26418 #close

Change-Id: Ibee88f80d7693874fda1cceaef94a03bd86012c9
2016-10-19 07:15:20 -05:00
Ludovic Gasc (GMLudo) 9f62feca60 res_calendar: Add support for fetching calendars when reloading
We use a lot res_calendar, we are very happy with that, especially
because you use libical, the almost alone opensource library that
supports really ical format with all types of recurrency.

Nevertheless, some features are missed for our business use cases.

This first patch adds a new option in calendar.conf:
fetch_again_at_reload. Be my guest for a better name.

If it's true, when you'll launch "module reload res_calendar.so",
Asterisk will download again the calendar.

The business use case is that we have a WebUI with a scheduler planner,
we know when the calendars are modified.

For now, we need to define 1 minute of timeout to have a chance that
our user doesn't wait too long between the modification and the real
test.  But it generates a lot of useless HTTP traffic.


ASTERISK-26422 #close

Change-Id: I384b02ebfa42b142bbbd5b7221458c7f4dee7077
2016-10-10 10:43:53 -05:00
Joshua Colp 8966c8ec5a Merge "cdr_mysql: fix UTC support" 2016-09-22 06:55:15 -05:00
Joshua Colp 78b6190a11 odbc: Remove options that are no longer applicable.
The pooling, shared_connection, limit, and idlecheck options
are no longer used in res_odbc.

ASTERISK-26389

Change-Id: I2fde7b467d01f9d1c82cc0a339bb4f7e1dd6bbe6
2016-09-21 08:47:46 -05:00
Tzafrir Cohen d3ddf4b0fd cdr_mysql: fix UTC support
* Make 'cdrzone=UTC' work properly.
* Fix the documentation of cdr_mysql.conf: it's cdrzone and not timezone

ASTERISK-26359 #close

Change-Id: I2a6f67b71bbbe77cac31a34d0bbfb1d67c933778
2016-09-15 13:16:04 +03:00
Richard Mudgett ba362822f3 res_pjsip: Add ignore_uri_user_options option.
This implements the chan_sip legacy_useroption_parsing option but with a
better name.

* Made the caller-id number and redirecting number strings obtained from
incoming SIP URI user fields always truncated at the first semicolon.
People don't care about anything after the semicolon showing up on their
displays even though the RFC allows the semicolon.

ASTERISK-26316 #close
Reported by: Kevin Harwell

Change-Id: Ib42b0e940dd34d84c7b14bc2e90d1ba392624f62
2016-09-09 17:13:02 -05:00
zuul 9d54dd04bb Merge "res/res_pjsip: Add preferred_codec_only config to pjsip endpoint." 2016-09-09 13:56:16 -05:00
Aaron An 2a50c29101 res/res_pjsip: Add preferred_codec_only config to pjsip endpoint.
This patch add config to pjsip by endpoint.
;preferred_codec_only=yes
; Respond to a SIP invite with the single most preferred codec
; rather than advertising all joint codec capabilities. This
; limits the other side's codec choice to exactly what we prefer.

ASTERISK-26317 #close
Reported by: AaronAn
Tested by: AaronAn

Change-Id: Iad04dc55055403bbf5ec050997aee2dadc4f0762
2016-09-09 05:36:19 -05:00
Richard Mudgett 4aaa27e532 Sample configs: Eliminate false multiline comment block starts.
Change-Id: Ie627def9604ae30abd80754f9e6f09874825aec6
2016-09-02 13:01:13 -05:00
zuul 1c64616373 Merge "sip.conf: tlsclientmethod is using sslv23 as default." 2016-08-19 14:38:24 -05:00
Alexander Traud 1a9555f036 sip.conf: tlsclientmethod is using sslv23 as default.
When 'tlsclientmethod' is not specified in sip.conf, chan_sip uses the OpenSSL
SSLv23_method. This was documented incorrectly in the file sip.conf.sample.

SSLv23_method got its name in the 90s. Today, with OpenSSL 1.0.2, this method
enables (just) the secure TLSv1.0 and TLSv1.2. Or stated differently, that
function should have been called 'secure_method' or 'automatic_method' back in
the 90s.

Consequently please, specify 'tlsclientmethod=tlsv1' in your sip.conf only if
you face a server which has problems like not falling back to TLSv1.0
automatically.

ASTERISK-24425

Change-Id: I502ce6146b4504cadfd3973af8d6ec3994f54fa3
2016-08-19 09:48:46 +02:00
George Joseph 534063fd67 res_pjsip: Add contact_user to endpoint
contact_user, when specified on an endpoint, will override the user
portion of the Contact header on outgoing requests.

Change-Id: Icd4ebfda2f2e44d3ac749d0b4066630e988407d4
2016-08-17 16:21:19 -05:00
zuul 9fc83f8ffd Merge "core: Entity ID is not set or invalid" 2016-08-16 10:03:20 -05:00
Alexei Gradinari e85adbd947 core: Entity ID is not set or invalid
The Exchanging Device and Mailbox States could not working
if the Entity ID (EID) is not set manually and can't be obtained
from ethernet interface.

This patch replaces debug message to warning
and addes missing description about option 'entityid' to
asterisk.conf.sample.

With this patch the asterisk also:
(1) decline loading the modules which won't work without EID:
    res_corosync and res_pjsip_publish_asterisk.
(2) warn if EID is empty on loading next modules:
    pbx_dundi, res_xmpp

Starting with v197 systemd/udev will automatically assign "predictable"
names for all local Ethernet interfaces.
This patch also addes some new ethernet prefixes "eno" and "ens".

ASTERISK-26164 #close

Change-Id: I72d712f1ad5b6f64571bb179c5cb12461e7c58c6
2016-08-15 13:35:59 -05:00
Joshua Colp 922b74169f manager: Clarify that dialplan manipulation actions are under system class.
ASTERISK-26246 #close

Change-Id: Id673b9786389f9d2a87f638ce1a25161f5f31657
2016-08-15 07:34:29 -05:00
George Joseph 36b2a40533 autohints: Update CHANGES and extensions.conf.sample
Make it clear that we're talking about device state hints and add
an entry to the sample config.

Change-Id: Iaef58ffb960191a21b713e8e0b51ce1fcd47e433
2016-08-11 12:03:29 -05:00
Alexei Gradinari 403b63571c res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack
The PJSIP taskprocessors could be overflowed on startup
if there are many (thousands) realtime endpoints
configured with unsolicited mwi.
The PJSIP stack could be totally unresponsive for a few minutes
after boot completed.

This patch creates a separate PJSIP serializers pool for mwi
and makes unsolicited mwi use serializers from this pool.
This patch also adds 2 new global options to tune taskprocessor
alert levels: 'mwi_tps_queue_high' and 'mwi_tps_queue_low'.

This patch also adds new global option 'mwi_disable_initial_unsolicited'
to disable sending unsolicited mwi to all endpoints on startup.
If disabled then unsolicited mwi will start processing
on next endpoint's contact update.

ASTERISK-26230 #close

Change-Id: I4c8ecb82c249eb887930980a800c9f87f28f861a
2016-08-08 13:57:58 -05:00
Alexei Gradinari 9042ad40f2 app_voicemail: Add taskprocessor alert level options.
On heavy loaded system with IMAP or DB storage,
'app_voicemail' taskprocessor queue could reach 500 scheduled tasks.
It could happen when the IMAP or DB server dies or is unreachable.
It could happen on startup when there are many (thousands)
realtime endpoints configured with unsolicited mwi.
If the taskprocessor queue reaches the high water level
then the alert is triggered and pjsip stops processing new requests
until the queue reaches the low water level to clear the alert.

This patch adds 2 new 'general' configuration options
to tune taskprocessor alert levels:
'tps_queue_high' - Taskprocessor high water alert trigger level.
'tps_queue_low' - Taskprocessor low water clear alert level

ASTERISK-26229 #close

Change-Id: I766294fbffedf64053c0d9ac0bedd3109f043ee8
2016-08-05 16:47:07 -04:00
Richard Mudgett 327136088e dsp.c: Correct DTMF twist dsp.conf documentation.
Change-Id: Idf97e3a72f1edc5fca58f2fa7b20785922be0cae
2016-07-26 17:46:25 -05:00
Richard Mudgett 4286a369a1 res_pjsip: Whitespace and comment cleanup.
Change-Id: I11139a4a95df34e223ba622aa6227e33ab8f6c38
2016-07-21 23:28:17 -05:00
Richard Mudgett 0d1744e132 chan_dahdi: Add faxdetect_timeout option.
The new option allows the channel driver's faxdetect option to timeout on
a call after the specified number of seconds into a call.  The new feature
is disabled if the timeout is set to zero.  The option is disabled by
default.

* Don't clear dsp_features after passing them to the dsp code in
my_pri_ss7_open_media().  We should still remember them especially for the
new faxdetect_timeout option.

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Ieffd3fe788788d56282844774365546dce8ac810
2016-07-19 10:33:45 -05:00
Richard Mudgett e739888d99 res_pjsip: Add fax_detect_timeout endpoint option.
The new endpoint option allows the PJSIP channel driver's fax_detect
endpoint option to timeout on a call after the specified number of
seconds into a call.  The new feature is disabled if the timeout is set
to zero.  The option is disabled by default.

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Id5a87375fb2c4f9dc1d4b44c78ec8735ba65453d
2016-07-19 10:33:45 -05:00
Matt Jordan dab2a6b689 hep.conf.sample: Default 'enabled' to 'no'
Following the principle of least surprise, we should not be sending
massive numbers of PJSIP and RTCP HEP packets out into the ether to some
only-slightly-random IP address. Having 'enabled' set to 'no' in the
sample configuration file should prevent this from happening for those
who run 'make samples'.

ASTERISK-26159 #close

Change-Id: I1753a64ca83a3442a6ebdc31061f8185c062d9b1
2016-06-29 16:18:53 -05:00
Matt Jordan 83f2c2573b configs/basic-pbx/modules.conf: Remove 'bad' modules
This patch removes the following modules:
 - pbx_functions: It never existed.
 - res_pjsip_log_forwarder: It no longer exists.
 - res_hep_pjsip: The base HEP module wasn't loaded, and most basic PBXs
                  aren't going to be installing HOMER
 - res_pjsip_phoneprov_provider: The basic res_phoneprov module isn't
                  loaded, and we aren't configured to make use of the
                  module

Change-Id: Id91f68cae7c9c8c3d370029fe1268cb51e4ff5a5
2016-06-28 10:36:05 -05:00
zuul 88dfcd21b2 Merge "chan_sip: Support auth username for callbackextension feature" 2016-06-09 21:35:42 -05:00
Joshua Colp 31a5c28339 res_odbc: Implement a connection pool.
Testing has shown that our usage of UnixODBC is problematic
due to bugs within UnixODBC itself as well as the heavy weight
cost of connecting and disconnecting database connections, even
when pooling is enabled.

For users of UnixODBC 2.3.1 and earlier crashes would occur due
to insufficient protection of the disconnect operation. This was
fixed in UnixODBC 2.3.2 and above.

For users of UnixODBC 2.3.3 and higher a slow-down would occur
under heavy database use due to repeated connection establishment.
A regression is present where on each connection the database
configuration is cached again, with the cache growing out of
control.

The connection pool implementation present in this change helps
to mitigate these issues by reducing how much we connect and
disconnect database connections. We also solve the issue of
crashes under UnixODBC 2.3.1 by defaulting the maximum number of
connections to 1, returning us to the previous working behavior.
For users who may have a fixed version the maximum concurrent
connection limit can be increased helping with performance.

The connection pool works by keeping a list of active connections.
If the connection limit has not been reached a new connection is
established. If the connection limit has been reached then the
request waits until a connection becomes available before
continuing.

ASTERISK-26074 #close
ASTERISK-26054 #close

Change-Id: I6774bf4bac49a0b30242c76a09c403d2e856ecff
2016-06-07 11:59:05 -03:00
Timo Teräs 538c6415c6 chan_sip: Support auth username for callbackextension feature
ASTERISK-20527 #close

Change-Id: I659cf7f00836a09d09d146ad226a40477d731239
2016-06-03 09:35:53 +03:00
Tzafrir Cohen 1d60bfcdf1 followme: allow disabling callee prompt
Add the option 'enable_callee_prompt' to followme.conf. Enabled by
default. If disabled, a callee is not prompted to accept or reject
the forwarded call.

ASTERISK-26064 #close

Change-Id: I0a8b19d4cf95c86a07c992813babb9e4a4acfff5
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-26 08:00:09 +03:00
Joshua Colp 56f24345f7 Merge "func_odbc: single database connection should be optional" 2016-05-24 09:28:03 -05:00
Alexei Gradinari c378b00a83 func_odbc: single database connection should be optional
func_odbc was changed in Asterisk 13.9.0
to make func_odbc use a single database connection per DSN
because of reported bug ASTERISK-25938
with MySQL/MariaDB LAST_INSERT_ID().

This is drawback in performance when func_odbc is used
very often in dialplan.

Single database connection should be optional.

ASTERISK-26010

Change-Id: I7091783a7150252de8eeb455115bd00514dfe843
2016-05-20 13:46:03 -04:00
Joshua Colp b57032c364 Merge "res_hep: Provide an option to pick the UUID type" 2016-05-19 05:26:57 -05:00
Matt Jordan a1803cb5f4 configs/samples/pjsip.conf.sample: Fix typo
A ':' is not a valid token for starting a comment.

Change-Id: I123592d93a83d1bdde3e352822881eb9da85e5ad
2016-05-14 21:49:42 -05:00
Matt Jordan e06a23681c 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-14 09:42:20 -05:00
Joshua Colp 1bfe8602a5 Merge "basic-cfg: asterisk.conf: don't set languages" 2016-05-13 04:53:39 -05:00
Joshua Colp da2506b2dc Merge "basic-cfg: asterisk.conf: debug level 5 spams" 2016-05-13 04:53:27 -05:00
Joshua Colp d733dccf81 Merge "basic-cfg: asterisk.conf: defaults of options" 2016-05-13 04:53:13 -05:00
zuul c5cb9d120f Merge "basic-cfg: asterisk.conf: remove [directories]" 2016-05-12 19:52:13 -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
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
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
George Joseph 4ebf9a938d 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
2016-04-27 16:33:51 -05:00
Alexei Gradinari 860b135c88 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
2016-04-27 10:58:43 -05:00
Leif Madsen 6ede210c98 Remove reference to non-existent sip.conf option
Option was removed in commit 7f883ef495

ASTERISK-25927 #close

Change-Id: I92f9b0196d9fc41d1d58354c07340c465ef1fcf8
2016-04-22 13:12:29 -05:00
George Joseph e2524fcee3 res_pjsip_mwi: Add voicemail extension and mwi_subscribe_replaces_unsolicited
res_pjsip_mwi was missing the chan_sip "vmexten" functionality which adds
the Message-Account header to the MWI NOTIFY.  Also, specifying mailboxes
on endpoints for unsolicited mwi and on aors for subscriptions required
that the admin know in advance which the client wanted.  If you specified
mailboxes on the endpoint, subscriptions were rejected even if you also
specified mailboxes on the aor.

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

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

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

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

mwi_subscribe_replaces_unsolicited:
* Added mwi_subscribe_replaces_unsolicited to endpoint.

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

ASTERISK-25865 #close
Reported-by: Ross Beer

Change-Id: Ic15a9415091760539c7134a5ba3dc4a6a1217cea
2016-03-30 13:23:54 -05:00
George Joseph c948ce9651 sorcery/res_pjsip: Refactor for realtime performance
There were a number of places in the res_pjsip stack that were getting
all endpoints or all aors, and then filtering them locally.

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

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

They do now.

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

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

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

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

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

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

Now on to res_pjsip...

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

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

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

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

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

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

Example sorcery.conf:

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

ASTERISK-25826 #close
Reported-by: Ross Beer
Tested-by: Ross Beer

Change-Id: Id2691e447db90892890036e663aaf907b2dc1c67
2016-03-27 22:43:27 -05:00
Philip Correia e2853ae337 res_parking: Update parking documentation for dynamic parking lots.
* Remove duplicate res_parking.conf courtesytone config option
documentation.

ASTERISK-24596 #close
Reported by:  Philip Correia

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

Change-Id: I90a92a891c6494dc08173e675856afcc4764c5b5
2016-03-25 18:25:47 -05:00
Joshua Colp 62d98b5a7f Merge "res_pjsip/config_transport: Allow reloading transports." 2016-02-27 10:18:26 -06:00
zuul 170941990b Merge "chan_sip: Optionally supply fromuser/fromdomain in SIP dial string." 2016-02-25 17:56:42 -06:00
George Joseph ba8adb4ce3 res_pjsip/config_transport: Allow reloading transports.
The 'reload' mechanism actually involves closing the underlying
socket and calling the appropriate udp, tcp or tls start functions
again.  Only outbound_registration, pubsub and session needed work
to reset the transport before sending requests to insure that the
pjsip transport didn't get pulled out from under them.

In my testing, no calls were dropped when a transport was changed
for any of the 3 transport types even if ip addresses or ports were
changed. To be on the safe side however, a new transport option was
added (allow_reload) which defaults to 'no'.  Unless it's explicitly
set to 'yes' for a transport, changes to that transport will be ignored
on a reload of res_pjsip.  This should preserve the current behavior.

Change-Id: I5e759850e25958117d4c02f62ceb7244d7ec9edf
2016-02-19 18:57:55 -06:00
Walter Doekes c00082329e chan_sip: Optionally supply fromuser/fromdomain in SIP dial string.
Previously you could add [!dnid] to the SIP dial string to alter the To:
header. This change allows you to alter the From header as well.

SIP dial string extra options now look like this:

    [![touser[@todomain]][![fromuser][@fromdomain]]]

INCOMPATIBLE CHANGE: If you were using an exclamation mark in your To:
header, that is no longer possible.

ASTERISK-25803 #close

Change-Id: I2457e9ba7a89eb1da22084bab5a4d4328e189db7
2016-02-19 11:30:15 +01:00
George Joseph f8767a8804 res_pjproject: Add ability to map pjproject log levels to Asterisk log levels
Warnings and errors in the pjproject libraries are generally handled by
Asterisk.  In many cases, Asterisk wouldn't even consider them to be warnings
or errors so the messages emitted by pjproject directly are either superfluous
or misleading.  A good exampe of this are the level-0 errors pjproject emits
when it can't open a TCP/TLS socket to a client to send an OPTIONS.  We don't
consider a failure to qualify a UDP client an "ERROR", why should a TCP/TLS
client be treated any differently?

A config file for res_pjproject has bene added (pjproject.conf) and a new
log_mappings object allows mapping pjproject levels to Asterisk levels
(or nothing).  The defaults if no pjproject.conf file is found are the same
as those that were hard-coded into res_pjproject initially: 0,1 = LOG_ERROR,
2 = LOG_WARNING, 3,4,5 = LOG_DEBUG<level>

Change-Id: Iba7bb349c70397586889b8f45b8c3d6c6c8c3898
2016-02-18 16:30:29 -06:00
Joshua Colp fc0527eb4f Merge "pjsip/alembic: Add missing columns to system and registration" 2016-02-05 11:50:35 -06:00
Joshua Colp e541d9cf34 Merge topic 'ASTERISK-20987'
* changes:
  app_confbridge: Add ability to get the muted conference state.
  app_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation.
  app_confbridge: Make non-admin users join a muted conference muted.
2016-02-05 11:49:15 -06:00
George Joseph 9b13ab6a63 pjsip/alembic: Add missing columns to system and registration
ps_systems needed disable_tcp_switch
ps_registrations needed line and endpoint

ASTERISK-25737 #close

Change-Id: Iaf9c2d69e62243d9fa53104c28c5339c47d4ac19
2016-02-04 14:23:45 -06:00
Sean Bright d83dba7099 res_rtp_asterisk: Allow ICE host candidates to be overriden
During ICE negotiation the IPs of the local interfaces are sent to the remote
peer as host candidates. In many cases Asterisk is behind a static one-to-one
NAT, so these host addresses will be internal IP addresses.

To help in hiding the topology of the internal network, this patch adds the
ability to override the host candidates by matching them against a
user-defined list of replacements.

Change-Id: I1c9541af97b83a4c690c8150d19bf7202c8bff1f
2016-02-03 17:06:20 -06:00
Joshua Colp 0de74fad55 AST-2016-001 http: Provide greater control of TLS and set modern defaults.
This change exposes the configuration of various aspects of the TLS
support and sets the default to the modern standards.

The TLS cipher is now set to the best values according to the
Mozilla OpSec team, different TLS versions can now be disabled, and
the cipher order can be forced to be that of the server instead of
the client.

ASTERISK-24972 #close

Change-Id: I0a10f2883f7559af5e48dee0901251dbf30d45b8
2016-02-03 15:10:16 -06:00
Richard Mudgett 12c93e8f81 app_confbridge: Make non-admin users join a muted conference muted.
ASTERISK-20987 #close
Reported by: hristo

Change-Id: Ic61a2b524ab3a4cfadf227fc6b3506527bc03f38
2016-01-27 16:46:20 -06:00
George Joseph f19bf7a321 res_pjsip: Add res_pjproject dependency to samples
Since res_pjsip now depends on res_pjproject, this has been added to
basic-pbx modules.conf.

Change-Id: I42826597d5e10f08e518208860c44c96e52f1b2d
2016-01-27 13:23:10 -06:00
Mark Michelson 53570e2c6f Merge "chan_sip: option 'notifyringing' change and doc fix" 2016-01-21 15:22:53 -06:00
Daniel Journo eaf2b5052e Update version number in features.conf.sample
Update the version number in the comments from Asterisk 12 to Asterisk 12+

Change-Id: Ie692ac8cda3c993c3bf10f27f51a1cca3317ec7b
2016-01-16 20:02:43 +00:00
Daniel Journo 8182146e85 pjsip: Add option global/regcontext
Added new global option (regcontext) to pjsip. When set, Asterisk will
dynamically create and destroy a NoOp priority 1 extension
for a given endpoint who registers or unregisters with us.

ASTERISK-25670 #close
Reported-by: Daniel Journo

Change-Id: Ib1530c5b45340625805c057f8ff1fb240a43ea62
2016-01-13 11:42:20 -06:00
George Joseph a41aab477a pjsip_sdp_rtp: Add option endpoint/bind_rtp_to_media_address
On a system with multiple ip addresses in the same subnet, if a
transport is bound to a specific ip address and endpoint/media_address
 is set, the SIP/SDP will have the correct address in all fields but
the rtp stream MAY still originate from one of the other ip addresses,
most probably the "primary" ip address.  This happens because
 res_pjsip_sdp_rtp/create_rtp always calls ast_instance_new with
the "all" ip address (0.0.0.0 or ::).

The new option causes res_pjsip_sdp_rtp/create_rtp to call
ast_rtp_instance_new with the endpoint's media_address (if specified)
instead of the "all" address.  This causes the packets to originate from
the specified address.

ASTERISK-25632
ASTERISK-25637
Reported-by: Olivier Krief
Reported-by: Dan Journo

Change-Id: I3dfaa079e54ba7fb7c4fd1f5f7bd9509bbf8bd88
2016-01-11 18:41:31 -06:00
Ward van Wanrooij d4b10cfb3e chan_sip: option 'notifyringing' change and doc fix
In the sample sip.conf this is written with regard to notifyringing:
;notifyringing = no ; Control whether subscriptions already INUSE get sent
RINGING when another call is sent (default: yes)

However, this setting changes whether or not any RINGING indications are sent
to subscriptions. There is no separate configurable setting that allows
to control whether INUSE subscriptions also get sent RINGING. This is however
a useful option, to see (using BLF) if somebody else is able to handle an
incoming call or if everybody is busy.

This patch corrects the documentation for notifyringing (so the documentation
matches the functionality) and make notifyringing a tri-state option, by adding
the value 'notinuse' (in addition to 'yes' and 'no'). When notifyringing =
notinuse, only subscriptions that are not INUSE are sent the RINGING signal.

The default setting for notifyringing remains set to yes, so the default
behaviour is not affected.

ASTERISK-25558

Change-Id: I88f7036ee084bb3f43b74f15612695c6708f74aa
2015-12-26 16:24:09 +01:00
Dade Brandon ca394161cf app_amd: Correct maximum_number_of_words functionality & documentation
- The maximum_number_of_words was previously documented as being
the number of words that when exceeded, would result in the AMD
application returning that the audio represents a machine.

This was inconsistent with its actual functionality - it was
a number of words that when REACHED, would result in determination
as a machine.

This update corrects the functionality to match the previously
documented functionality.  This is a backwards incompatible change
in configuration file, and has been added to UPGRADE.txt as a result.

The sample configuration file and application defaults have been updated
so that the default value is now 2, which reflects the same default
functionality as previous versions.

- Update documentation for silence_threshold, which previously implied
that it was measuring time, rather than noise averages in the sample.

- Update the comments in amd.conf.sample.

ASTERISK-25639 #close
Change-Id: I4b1451e5dc9cb3cb06d59b6ab872f5275ba79093
2015-12-21 16:02:09 -08:00
Mark Michelson ed13732188 Confbridge: Add a user timeout option
This option adds the ability to specify a timeout, in seconds, for a
participant in a ConfBridge. When the user's timeout has been reached,
the user is ejected from the conference with the CONFBRIDGE_RESULT
channel variable set to "TIMEOUT".

The rationale for this change is that there have been times where we
have seen channels get "stuck" in ConfBridge because a network issue
results in a SIP BYE not being received by Asterisk. While these
channels can be hung up manually via CLI/AMI/ARI, adding some sort of
automatic cleanup of the channels is a nice feature to have.

ASTERISK-25549 #close
Reported by Mark Michelson

Change-Id: I2996b6c5e16a3dda27595f8352abad0bda9c2d98
2015-11-16 14:13:13 -06:00
Corey Farrell 40574a2ea3 chan_sip: Allow websockets to be disabled.
This patch adds a new setting "websockets_enabled" to sip.conf.
Setting this to false allows chan_sip to be used without causing
conflicts with res_pjsip_transport_websocket.

ASTERISK-24106 #close
Reported by: Andrew Nagy

Change-Id: I04fe8c4f2d57b2d7375e0e25826c91a72e93bea7
2015-11-03 08:53:00 -05:00
Kevin Harwell 691c0e0b31 res_pjsip_outbound_registration: registration stops due to fatal 4xx response
During outbound registration it is possible to receive a fatal (any permanent/
non-temporary 4xx, 5xx, 6xx) response from the registrar that is simply due
to a problem with the registrar itself. Upon receiving the failure response
Asterisk terminates outbound registration for the given endpoint.

This patch adds an option, 'fatal_retry_interval', that when set continues
outbound registration at the given interval up to 'max_retries' upon receiving
a fatal response.

ASTERISK-25485 #close

Change-Id: Ibc2c7b47164ac89cc803433c0bbe7063bfa143a2
2015-10-23 09:42:46 -05:00
Matt Jordan 2d7a4a3357 main/logger: Add log formatters and JSON structured logs
When Asterisk is part of a larger distributed system, log files are often
gathered using tools (such as logstash) that prefer to consume information
and have it rendered using other tools (such as Kibana) that prefer a
structured format, e.g., JSON. This patch adds support for JSON formatted
logs by adding support for an optional log format specifier in Asterisk's
logging subsystem. By adding a format specifier of '[json]':

full => [json]debug,verbose,notice,warning,error

Log messages will be output to the 'full' channel in the following
format:

{
  "hostname": Hostname or name specified in asterisk.conf
  "timestamp": Date/Time
  "identifiers": {
    "lwp": Thread ID,
    "callid": Call Identifier
  }
  "logmsg": {
    "location": {
      "filename": Name of the file that generated the log statement
      "function": Function that generated the log statement
      "line": Line number that called the logging function
    }
    "level": Log level, e.g., DEBUG, VERBOSE, etc.
    "message": Actual text of the log message
  }
}

ASTERISK-25425 #close

Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
2015-09-29 07:28:01 -05:00
Joshua Colp 309dd2a409 pjsip: Add rtp_timeout and rtp_timeout_hold endpoint options.
This change adds support for the 'rtp_timeout' and 'rtp_timeout_hold'
endpoint options. These allow the channel to be hung up if RTP
is not received from the remote endpoint for a specified number of
seconds.

ASTERISK-25259 #close

Change-Id: I3f39daaa7da2596b5022737b77799d16204175b9
2015-07-24 12:43:43 -03:00
Mark Michelson a0c31c7a05 res_pjsip: Add rtp_keepalive to sample config file.
Change-Id: I5f62d0c5684f8b2335f9f8ac2d79ee04fbdafb19
2015-07-24 09:48:58 -05:00
Rusty Newton d02196448b Documentation: A couple of trivial fixes in sip.conf.sample and func_cdr.c
* In sip.conf.sample fix sentence where we said that WS or WSS are supported
   transports for use in an outbound register definition. They are not
   supported in that case.
 * In func_cdr.c made it clear that the Disable option for CDR_PROP can be used
   to enable CDR on a channel.

ASTERISK-24867 #close
Reported by: Rusty Newton

ASTERISK-24853 #close
Reported by: PSDK

Change-Id: I3d698bc6302b9d00a0a995b5c4ad9a42d69b48ca
2015-07-20 12:39:48 -05:00
Kevin Harwell 93ac45d3bd res_pjsip: Add option to force G.726 to be treated as AAL2 packed.
Some phones send g.726 audio packed for AAL2, which differs from what is
recommended by RFC 3351. If Asterisk receives audio formatted as such when
negotiating g.726 then it sounds a bit distorted. Added an option to
res_pjsip_endpoint that allows g.726 negotiated audio to be treated as g.726
AAL2 packed.

ASTERISK-25158 #close
Reported by: Steve Pitts

Change-Id: Ie7e21f75493d7fe53e75e12c971e72f5afa33615
2015-06-15 12:40:03 -05:00
Joshua Colp 87470f7d81 Merge "tcptls: Enable multiple TLS certificate chains (RSA+ECC+DSA) for server socket." 2015-05-15 09:38:57 -05:00
Alexander Traud 8f3f414d8c tcptls: Enable multiple TLS certificate chains (RSA+ECC+DSA) for server socket.
When a client connects to a server via SSL/TLS, the server commonly utilizes an
RSA key-pair. However, other such algorithms exist (i.e. DSA and ECDSA), and if
the server socket is configured with a certificate for either one of those, it
would lose its compatibility with RSA-only clients.

Now, the server socket can be configured with up to one RSA, ECDSA and DSA key
each. For example, if a client is not compatible with SHA-2 hashed certificates
like Nokia mobile phones, the server socket still can use RSA/SHA-1 for legacy
clients and ECDSA/SHA-2 for everyone else.

ASTERISK-24815 #close
Reported by: Alexander Traud
patches:
  tls_rsa_ecc_dsa.patch uploaded by Alexander Traud (License 6520)

Change-Id: Iada5e00d326db5ef86e0af7069b4dfa1b979da9a
2015-05-15 10:01:04 +02:00
Joshua Colp 2bbfcfc647 Merge "cdr_adaptive_odbc: Add ability to set character for quoted identifiers." 2015-05-14 05:28:16 -05:00
Joshua Colp 4e482bf901 Merge "cel_pgsql: Add support for setting schema" 2015-05-13 15:17:19 -05:00
Rusty Newton 5e361e1476 configs/basic-pbx: Modified main IVR to play new Allison prompt.
The main IVR was playing demo-congrats. I've switched it over to the
basic-pbx-ivr-main file that we added in core sounds 1.4.27. This prompt
has Allison prompting the user with the actual IVR menu.

ASTERISK-24892 #close

Change-Id: Ifb749616ff8e156a1031ddaddfcc9244767a095d
2015-05-08 14:47:51 -05:00
Richard Mudgett 7103b374ef chan_dahdi: Improve force_restart_unavailable_chans option description.
ASTERISK-25034
Reported by: Richard Mudgett

Change-Id: I1ff8f02124d2f4abd632a050da52c64285bb7f30
2015-05-06 16:12:00 -05:00
Rodrigo Ramírez Norambuena cb79b8ab80 cel_pgsql: Add support for setting schema
Add feature to set optional schema parameter on configuration file via
'schema' setting.

Fix query to get columns from table while considering schema. If in
the database there exists two tables with same name in distinct schemas
it will return an error when inserting record.

ASTERISK-24967 #close

Change-Id: I691fd2cbc277fcba10e615f5884f8de5d8152f2c
2015-05-05 07:59:12 -04:00
Rodrigo Ramírez Norambuena a24ce38e5e cdr_adaptive_odbc: Add ability to set character for quoted identifiers.
Added the ability to set the character to quote identifiers. This
allows adding the character at the start and end of table and column
names. This setting is configurable for cdr_adaptive_odbc via the
quoted_identifiers in configuration file cdr_adaptive_odbc.conf.

ASTERISK-25006

Change-Id: I0b9a56b79ca13a727a803d88ed3b8643e37632b8
2015-05-05 04:38:33 -04:00
Joshua Colp ddf9dcaad7 Merge "cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8" 2015-05-03 11:37:36 -05:00
Rodrigo Ramírez Norambuena 8886b724ae cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8
This patch adds a new option to cdr.conf, 'newcdrcolumns', that will handle CDR
columns added in Asterisk 1.8. The columns are:
 * peeraccount
 * linkedid
 * sequence
When enabled, the columns in the database entry will be populated with the data
from the CDR.

ASTERISK-24976 #close

Change-Id: I51a57063f4ae5e194a9d933a8df45dc8a4534f0b
2015-05-03 09:50:25 -05:00
Corey Farrell 6b208d8c3b Sample Configs: Fix syntax error in pjsip.conf
The sample pjsip.conf has a few comment lines that are missing the
semicolons at the start of the comment, causing the config to fail
load.

Change-Id: I776a38c916a7df7ee3e072fd0b21dbf4cc457352
2015-04-30 15:59:36 -05:00
Richard Mudgett 03c51cf525 chan_dahdi: Add the chan_dahdi.conf force_restart_unavailable_chans option.
Some telco switches occasionally ignore ISDN RESTART requests.  The fix
for ASTERISK-19608 added an escape clause for B channels in the restarting
state if the telco ignores a RESTART request.  If the telco fails to
acknowledge the RESTART then Asterisk will assume the telco acknowledged
the RESTART on the second call attempt requesting the B channel by the
telco.  The escape clause is good for dealing with RESTART requests in
general but it does cause the next call for the restarting B channel to be
rejected if the telco insists the call must go on that B channel.

chan_dahdi doesn't really need to issue a RESTART request in response to
receiving a cause 44 (Requested channel not available) code.  Sending the
RESTART in such a situation is not required (nor prohibited) by the
standards.  I think chan_dahdi does this for historical reasons to deal
with buggy peers to get channels unstuck in a similar fashion as the
chan_dahdi.conf resetinterval option.

* Add the chan_dahdi.conf force_restart_unavailable_chans compatability
option that when disabled will prevent chan_dahdi from trying to RESTART
the channel in response to a cause 44 code.

ASTERISK-25034 #close
Reported by: Richard Mudgett

Change-Id: Ib8b17a438799920f4a2038826ff99a1884042f65
2015-04-30 10:24:57 -05:00
Corey Farrell 55a780d211 Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE.
This switches files used to generate other sources to use the new
ASTERISK_REGISTER_FILE macro.

ASTERISK-25026 #close
Reported by: Corey Farrell

Change-Id: Ieb2537b83421cad07c8955e5f90c405ccf079740
2015-04-29 01:02:10 -04:00
Joshua Colp b2153f1f49 Merge "cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version" 2015-04-28 06:55:30 -05:00
Corey Farrell 5c1d07baf0 Astobj2: Allow reference debugging to be enabled/disabled by config.
* The REF_DEBUG compiler flag no longer has any effect on code that uses
  Astobj2.  It is used to determine if reference debugging is enabled by
  default.  Reference debugging can be enabled or disabled in asterisk.conf.
* Caller information is provided in logger errors for ao2 bad magic numbers.
* Optimizes AO2 by merging internal functions with the public counterpart.
  This was possible now that we no longer require a dual ABI.

ASTERISK-24974 #close
Reported by: Corey Farrell

Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
2015-04-27 18:37:26 -04:00
Rodrigo Ramírez Norambuena 358080e86e cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version
Add new column to INSERT new columns added in cdr 1.8 version. The columns are:
 * peeraccount
 * linkedid
 * sequence
This feature is configurable in cdr_odbc.conf using a new configuration
option, 'newcdrcolumns'.

ASTERISK-24976 #close

Change-Id: Ibe0c7540a88305c6012786f438a0813ad8b19127
2015-04-27 09:38:15 -05:00
George Joseph c6ed681638 res_pjsip: Add global option to limit the maximum time for initial qualifies
Currently when Asterisk starts initial qualifies of contacts are spread out
randomly between 0 and qualify_timeout to prevent network and system overload.
If a contact's qualify_frequency is 5 minutes however, that contact may be
unavailable to accept calls for the entire 5 minutes after startup.  So while
staggering the initial qualifies is a good idea, basing the time on
qualify_timeout could leave contacts unavailable for too long.

This patch adds a new global parameter "max_initial_qualify_time" that sets the
maximum time for the initial qualifies.  This way you could make sure that all
your contacts are initialy, randomly qualified within say 30 seconds but still
have the contact's ongoing qualifies at a 5 minute interval.

If max_initial_qualify_time is > 0, the formula is initial_interval =
min(max_initial_interval, qualify_timeout * random().  If not set,
qualify_timeout is used.

The default is "0" (disabled).

ASTERISK-24863 #close

Change-Id: Ib80498aa1ea9923277bef51d6a9015c9c79740f4
Tested-by: George Joseph <george.joseph@fairview5.com>
2015-04-16 16:44:45 -05:00
George Joseph 51886c68dc pjsip_options: Add qualify_timeout processing and eventing
This is the second follow-on to https://reviewboard.asterisk.org/r/4572/ and the
discussion at
http://lists.digium.com/pipermail/asterisk-dev/2015-March/073921.html

The basic issues are that changes in contact status don't cause events to be
emitted for the associated endpoint.  Only dynamic contact add/delete actions
update the endpoint.  Also, the qualify timeout is fixed by pjsip at 32 seconds
which is a long time.

This patch makes use of the new transaction timeout feature in r4585 and
provides the following capabilities...

1.  A new aor/contact variable 'qualify_timeout' has been added that allows the
user to specify the maximum time in milliseconds to wait for a response to an
OPTIONS message.  The default is 3000ms.  When the timer expires, the contact is
marked unavailable.

2.  Contact status changes are now propagated up to the endpoint as follows...
When any contact is 'Available', the endpoint is marked as 'Reachable'.  When
all contacts are 'Unavailable', the endpoint is marked as 'Unreachable'.  The
existing endpoint events are generated appropriately.

ASTERISK-24863 #close

Change-Id: Id0ce0528e58014da1324856ea537e7765466044a
Tested-by: Dmitriy Serov
Tested-by: George Joseph <george.joseph@fairview5.com>
2015-04-16 09:34:56 -05:00
Kevin Harwell 66f3fd0028 chan_sip: make progressinband default to no
After the "progressinband" value setting of "never" was updated to never send a
183 this separated its use from the "no" value. Since "never" was the default,
but most users probably expect "no" this patch updates the default for the
"progressinband" setting to "no."

ASTERISK-24835 #close
Reported by: Andrew Nagy
Review: https://reviewboard.asterisk.org/r/4606/
........

Merged revisions 434654 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-10 21:06:23 +00:00
Matthew Jordan b3d01f1fbf channels/chan_iax2: Add a configuration parameter for call token expiration
This patch adds a new configuration parameter, 'calltokenexpiration', that
controls how long before an authentication call token is expired. The default
maintains the RFC specified 10 seconds. Setting it to a higher value may be
useful in lossy networks.

Review: https://reviewboard.asterisk.org/r/4588

ASTERISK-24939 #close
Reported by: Y Ateya
patches:
  ctoken_configuration.diff submitted by Y Ateya (License 6693)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-10 12:23:42 +00:00
Matthew Jordan 016fba12e2 cel_pgsl: Add support for GMT timestamps
This patch adds a new option to cel_pgsl, "usegmtime", which causes timestamps
to be logged in GMT.

Review: https://reviewboard.asterisk.org/r/4571/

ASTERISK-23186 #close
Reported by: Rodrigo Ramirez Norambuena
patches:
  cel_pgsql.c_add_usegmtime2.patch submitted by Rodrigo Ramirez Norambuena (License 6577)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 11:35:53 +00:00
Jonathan Rose b56592e3ae SAC: Add conferencing extensions and configuration
Review: https://reviewboard.asterisk.org/r/4504/
........

Merged revisions 433656 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-27 22:26:30 +00:00
Rusty Newton c21e2e45a8 configs/basic-pbx - Super Awesome Company example configs Phase 1, Patch 2
Example configuration files for a "basic PBX" deployment for the fictitious
Super Awesome Company. Details at https://reviewboard.asterisk.org/r/4488/
and https://wiki.asterisk.org/wiki/display/AST/Super+Awesome+Company

Patch 4488 includes all functionality needed for SAC's outside connectivity
and some externally accessed features, as well as outbound dialing.

Reported by: Malcolm Davenport
Tested by: Rusty Newton

Review: https://reviewboard.asterisk.org/r/4488/
........

Merged revisions 433624 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-27 21:21:05 +00:00
Joshua Colp abf3e40902 dns: Add core DNS API + unit tests and res_resolver_unbound module + unit tests.
This change adds an abstracted core DNS API which resembles the API described
here[1]. The API provides a pluggable mechanism for resolvers and also a
consistent view for records. Both synchronous and asynchronous queries are
supported.

This change also adds a res_resolver_unbound module which uses the libunbound
library to provide resolution.

Unit tests have also been written for all of the above to confirm the API and
functionality.

ASTERISK-24834 #close
Reported by: Matt Jordan

ASTERISK-24836 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/4474/
Review: https://reviewboard.asterisk.org/r/4512/

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+DNS+API


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-25 12:32:26 +00:00
Richard Mudgett 4c2fc5b811 chan_pjsip: Add "rpid_immediate" option to prevent unnecessary "180 Ringing" messages.
Incoming PJSIP call legs that have not been answered yet send unnecessary
"180 Ringing" or "183 Progress" messages every time a connected line
update happens.  If the outgoing channel is also PJSIP then the incoming
channel will always send a "180 Ringing" or "183 Progress" message when
the outgoing channel sends the INVITE.

Consequences of these unnecessary messages:

* The caller can start hearing ringback before the far end even gets the
call.

* Many phones tend to grab the first connected line information and refuse
to update the display if it changes.  The first information is not likely
to be correct if the call goes to an endpoint not under the control of the
first Asterisk box.

When connected line first went into Asterisk in v1.8, chan_sip received an
undocumented option "rpid_immediate" that defaults to disabled.  When
enabled, the option immediately passes connected line update information
to the caller in "180 Ringing" or "183 Progress" messages as described
above.

* Added "rpid_immediate" option to prevent unnecessary "180 Ringing" or
"183 Progress" messages.  The default is "no" to disable sending the
unnecessary messages.

ASTERISK-24781 #close
Reported by: Richard Mudgett

Review: https://reviewboard.asterisk.org/r/4473/
........

Merged revisions 433338 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-24 19:41:36 +00:00
Kevin Harwell aef7278af6 res_pjsip: Allow configuration of endpoint identifier query order
This patch fixes previously reverted code that caused binary incompatibility
problems with some modules. And like the original patch it makes sure that
no matter what order the endpoint identifier modules were loaded, priority is
given based on the ones specified in the new global 'endpoint_identifier_order'
option.

ASTERISK-24840
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4489/
........

Merged revisions 433028 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-17 18:22:20 +00:00
Matthew Jordan dc752f515b apps/app_amd: Document maximum_word_length option; fix AMDCAUSE documentation
This patch corrects the documentation for the AMD application. Specifically:
* It documents the maximum_word_length option, which limits the maximum allowed
  length of a single utterance.
* It clarifies the AMDCAUSE values MAXWORDS and MAXWORDLENGTH. MAXWORDLENGTH
  was documented as MAXWORDS, while MAXWORDS was undocumented.

Thanks to the issue reporter, Frank DiGennaro, for pointing out the issues.

ASTERISK-19470 #close
Reported by: Frank DiGennaro
........

Merged revisions 432918 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 432920 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-14 00:24:52 +00:00
Kevin Harwell d42c6adb1a Revert - res_pjsip: Allow configuration of endpoint identifier query order
Due to a break in binary compatibility with some other modules these changes
are being reverted until the issue can be resolved.

ASTERISK-24840
Reported by: Mark Michelson
........

Merged revisions 432868 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-13 14:55:44 +00:00
Kevin Harwell 1ce529d30e res_pjsip: allow configuration of endpoint identifier query order
It's possible to have a scenario that will create a conflict between endpoint
identifiers. For instance an incoming call could be identified by two different
endpoint identifiers and the one chosen depended upon which identifier module
loaded first. This of course causes problems when, for example, the incoming
call is expected to be identified by username, but instead is identified by ip.
This patch adds a new 'global' option to res_pjsip called
'endpoint_identifier_order'. It is a comma separated list of endpoint
identifier names that specifies the order by which identifiers are processed
and checked.

ASTERISK-24840 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4455/
........

Merged revisions 432638 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-09 16:13:40 +00:00
Rusty Newton e484140aed configs/basic-pbx - Super Awesome Company example configs Phase 1, Patch 1
Example configuration files for a "basic PBX" deployment for the fictitious
Super Awesome Company. Details at https://reviewboard.asterisk.org/r/4379/
and https://wiki.asterisk.org/wiki/display/AST/Super+Awesome+Company

Reported by: Malcolm Davenport
Tested by: Rusty Newton

Review: https://reviewboard.asterisk.org/r/4379/
........

Merged revisions 432301 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-25 23:49:21 +00:00
Joshua Colp 55eb8fc068 pjsip: Remove "contact" type from pjsip.conf.sample
The "contact" object is not meant to be configured from the pjsip.conf
configuration file. It is meant to be created as a result of a registration
and stored elsewhere.

ASTERISK-24085 #close
Reported by: Rusty Newton
........

Merged revisions 431860 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-15 19:01:44 +00:00
George Joseph 49161d8df8 res_pjsip_config_wizard: Add ability to auto-create hints.
Looking at the Super Awesome Company sample reminded me that creating hints is 
just plain gruntwork.  So you can now have the pjsip conifg wizard auto-create 
them for you.

Specifying 'hint_exten' in the wizard will create 
'exten => <hint_exten>,hint/PJSIP/<wizard_id>'
in whatever is specified for 'hint_context'.

Specifying 'hint_application' in the wizard will create
'exten => <hint_exten>,1,<hint_application>'
in whatever is specified for 'hint_context'.

The default for 'hint_context' is the endpoint's context.
There's no default for 'hint_application'.  If not specified, no app is added.
There's no default for 'hint_exten'.  If not specified, neither the hint itself 
nor the application will be created.

Some may think this is the slippery slope to users.conf but hints are a basic 
necessity for phones unlike voicemail, manager, etc that users.conf creates.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4383/
........

Merged revisions 431643 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-10 23:17:17 +00:00
Ashley Sanders 6a76740b83 HTTP: For httpd server, need option to define server name for security purposes
Added a new config property [servername] to the http.conf file; updated the http server to use the new property when sending responses, for showing http status through the CLI and when reporting status through the 'httpstatus' webpage. In this version, [servername] is uncommented by default.

ASTERISK-24316 #close
Reported By: Andrew Nagy
Review: https://reviewboard.asterisk.org/r/4374/
........

Merged revisions 431471 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-30 17:21:50 +00:00
Richard Mudgett e4738a59eb CHANNEL(peer), chan_iax2, res_fax, SNMP agent: Fix deadlock from reaching across a bridge.
Calling ast_channel_bridge_peer() cannot be done while holding any channel
locks.  The reported issue hit the deadlock in chan_iax2, but an audit of
the ast_channel_bridge_peer() calls found three more locations where the
same deadlock can occur.

* Made CHANNEL(peer), res_fax, and the SNMP agent not call
ast_channel_bridge_peer() with any channel locked.  For CHANNEL(peer) I
had to rework the logic to not hold the channel lock.

* Made chan_iax2 no longer call ast_channel_bridge_peer().  It was done
for legacy reasons that no longer apply.

* Removed the iax.conf forcejitterbuffer option.  It is now always enabled
when the jitterbuffer option is enabled.  If you put a jitter buffer on a
channel it will be on the channel.

ASTERISK-24600 #close
Reported by: Jeff Collell

Review: https://reviewboard.asterisk.org/r/4342/
........

Merged revisions 430817 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-20 16:59:30 +00:00
Mark Michelson 023fa0f9e8 Add support for the ca_list_path option for PJSIP transports.
This allows for a path to be specified that has a collection of CA
certificates in it.

ASTERISK-24575 #close
Reported by cloos
Patches:
	pj-ca-path-trunk.diff uploaded by cloos (License #5956)

Review: https://reviewboard.asterisk.org/r/4344
........

Merged revisions 430709 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-16 21:46:09 +00:00
Matthew Jordan aa7e06f797 configs/samples/features.conf.sample: Document attended transfer DTMF options
The sample config was missing the configuration options for DTMF attended
transfer completion scenarios. The configuration options 'atxferabort',
'atxfercomplete', 'atxferthreeway', and 'atxferswap' are now documented in the
appropriate configuration file.

ASTERISK-24678 #close
Reported by: Niklas Larsson
patches:
  features.conf.sample.diff uploaded by Niklas Larsson (License 5068)
........

Merged revisions 430526 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 18:28:50 +00:00
Kinsey Moore 77ee23210d res_fax: Add T.38 negotiation timeout option
This change makes the T.38 negotiation timeout configurable via
't38timeout' in res_fax.conf or FAXOPT(t38timeout). It was previously
hard coded to be 5000 milliseconds.

This change also handles T.38 switch failures by aborting the fax since
in the case where this can happen, both sides have agreed to switch to
T.38 and Asterisk is unable to do so.

Review: https://reviewboard.asterisk.org/r/4320/
........

Merged revisions 430415 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 430416 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 14:53:09 +00:00
Kevin Harwell 91becf952a app_queue: Update sample conf documenation
Updated the queues.conf.sample file to explicitly state which channel queue
variables are propagated to.

ASTERISK-24267
Reported by: Mitch Claborn
........

Merged revisions 430126 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 430127 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-24 21:28:14 +00:00
Matthew Jordan b79a4a464f app_confbridge: Add the ability to pass options/command to MixMonitor
This patch adds the ability to pass options and a command to MixMontor when
recording a conference using ConfBridge.

New options are -

* record_options: Options to MixMontor, eg: m(), W() etc.
* record_command: The command to execute when recording is over.
* record_file_timestamp: Append the start time to the file name.

These options can also be used with the CONFBRIDGE function, e.g.,
Set(CONFBRIDGE(bridge,record_command)=/path/to/command ^{MIXMONITOR_FILENAME}))

Review: https://reviewboard.asterisk.org/r/4023

ASTERISK-24351 #close
Reported by: Gareth Palmer
patches:
  record_command-428838.patch uploaded by Gareth Palmer (License 5169)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 02:35:05 +00:00
George Joseph 39b54a21dc res_pjsip_config_wizard: Allow streamlined config of common pjsip scenarios
res_pjsip_config_wizard
------------------
 * This is a new module that adds streamlined configuration capability for
   chan_pjsip.  It's targetted at users who have lots of basic configuration
   scenarios like 'phone' or 'agent' or 'trunk'.  Additional information
   can be found in the sample configuration file at
   config/samples/pjsip_wizard.conf.sample.

Tested-by: George Joseph

Review: https://reviewboard.asterisk.org/r/4190/
........

Merged revisions 429592 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-15 17:08:24 +00:00
Matthew Jordan 1106e8fd0f main/stasis: Allow subscriptions to use a threadpool for message delivery
Prior to this patch, all Stasis subscriptions would receive a dedicated
thread for servicing published messages. In contrast, prior to r400178
(see review https://reviewboard.asterisk.org/r/2881/), the subscriptions
shared a thread pool. It was discovered during some initial work on Stasis
that, for a low subscription count with high message throughput, the
threadpool was not as performant as simply having a dedicated thread per
subscriber.

For situations where a subscriber receives a substantial number of messages
and is always present, the model of having a dedicated thread per subscriber
makes sense. While we still have plenty of subscriptions that would follow
this model, e.g., AMI, CDRs, CEL, etc., there are plenty that also fall into
the following two categories:
* Large number of subscriptions, specifically those tied to endpoints/peers.
* Low number of messages. Some subscriptions exist specifically to coordinate
  a single message - the subscription is created, a message is published, the
  delivery is synchronized, and the subscription is destroyed.
In both of the latter two cases, creating a dedicated thread is wasteful (and
in the case of a large number of peers/endpoints, harmful). In those cases,
having shared delivery threads is far more performant.

This patch adds the ability of a subscriber to Stasis to choose whether or not
their messages are dispatched on a dedicated thread or on a threadpool. The
threadpool is configurable through stasis.conf.

Review: https://reviewboard.asterisk.org/r/4193

ASTERISK-24533 #close
Reported by: xrobau
Tested by: xrobau
........

Merged revisions 428681 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 428687 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01 17:59:21 +00:00
Olle Johansson d663e045f5 sip.conf.sample - note that media_address does not change listen address, just the SDP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-21 13:59:45 +00:00
Joshua Colp 7f8b7ace72 res_pjsip_sdp_rtp: Add support for optimistic SRTP.
Optimistic SRTP is the ability to enable SRTP but not have it be
a fatal requirement. If SRTP can be used it will be, if not it won't be.
This gives you a better chance of using it without having your sessions
fail when it can't be.

Encrypt all the things!

Review: https://reviewboard.asterisk.org/r/3992/
........

Merged revisions 428222 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-19 12:50:47 +00:00
Mark Michelson 2e750db120 Allow for transferer to retry when dialing an invalid extension.
This allows for a configurable number of attempts for a transferer
to dial an extension to transfer the call to. For Asterisk 13, the
default values are such that upgrading between versions will not
cause a behaivour change. For trunk, though, the defaults will be
changed to be more user-friendly.

Review: https://reviewboard.asterisk.org/r/4167
........

Merged revisions 428145 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-17 16:58:52 +00:00
Joshua Colp d0523b4b3c chan_sip: Add support for setting DTLS configuration in the general section.
Configuration of DTLS in the general section will be applied to any users
or peers. If configuration exists at their level it overrides the general
section values.

ASTERISK-24128 #close
Reported by: Michael K.
patches:
  dtls_default_settings.patch submitted by Michael K. (license 6621)

Review: https://reviewboard.asterisk.org/r/3867/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-15 16:31:24 +00:00
Jonathan Rose df2090b931 Documentation: Revise explanation of cdr.conf option 'Unanswered'
ASTERISK-24279 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4109/
........

Merged revisions 427901 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427902 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-14 18:12:05 +00:00
Mark Michelson 69f29e627f Make the disable_tcp_switch PJSIP system object enabled by default.
Testing has shown repeatedly that PJSIP's default behavior of switching
automatically to TCP for large messages can cause issues. The most common
issues are that devices that we are communicating with do not handle the
switch to TCP gracefully, thus causing situations such as broken calls or
broken subscriptions. Now, in order to have this behavior happen, you must
opt into it. The sample file has been updated to warn that enabling the
TCP switch behavior may cause issues for you, so use at your own risk.
........

Merged revisions 427334 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-05 19:53:29 +00:00
Joshua Colp d159885e50 res_pjsip_outbound_registration: Add virtual line support.
Virtual line support establishes a relationship between messages
related to an outbound registration and a local endpoint. This is
accomplished by attaching a parameter to the Contact of the outbound
registration and looking for it on any received requests. If the
parameter exists and can be matched to an outbound registration
the configured endpoint is associated with the request.

Review: https://reviewboard.asterisk.org/r/2964/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 12:03:35 +00:00
Richard Mudgett 33f0251b6c res_pjsip: Add disable_tcp_switch option.
When a packet exceeds the MTU, pjproject will switch from UDP to TCP.  In
some circumstances (on some networks), this can cause some issues with
messages not getting sent to the correct destination - and can also cause
connections to get dropped due to quirks in pjproject deciding to
terminate TCP connections with no messages.

While fixing the routing/messaging issues is important, having a
configuration option in Asterisk that tells pjproject to not switch over
to TCP would be useful.  That way, if some glitch is discovered on some
other network/site, we can at least disable the behavior until a fix is
put into place.

AFS-197 #close

Review: https://reviewboard.asterisk.org/r/4137/
........

Merged revisions 427129 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427130 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 18:22:59 +00:00
Joshua Colp ac091d4184 chan_pjsip: Add support for passing hold and unhold requests through.
This change adds an option, moh_passthrough, that when enabled will pass
hold and unhold requests through using a SIP re-invite. When placing on
hold a re-invite with sendonly will be sent and when taking off hold a
re-invite with sendrecv will be sent. This allows remote servers to handle
the musiconhold instead of the local Asterisk instance being responsible.

Review: https://reviewboard.asterisk.org/r/4103/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 14:45:01 +00:00
Scott Griepentrog 28173ddf05 pjsip: clarify tls cert and key file usage
A question arose as to whether a .pem file
could be provided in place of the .crt and
.key files in a PJSIP TLS configuration. I
tested this and discovered that although a
cert will be read from the pem file, a key
will not, and thus the priv_key_file entry
is still required. This update to the fine
documentation clarifies the option usage.

AST-1448 #close
Review: https://reviewboard.asterisk.org/r/4129/
Reported by: John Bigelow
........

Merged revisions 426928 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426930 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-31 16:41:06 +00:00
Malcolm Davenport 1fe22c411d ASTERISK-23512, correct inaccurate comment in manager.conf.sample
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28 18:09:32 +00:00
Malcolm Davenport 684b8762a9 ASTERISK-24419, fix incorrect syntax for setting language in extensions.conf.sample
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28 13:13:16 +00:00
Jonathan Rose b8f687f27c Sample Configurations: make 'pjsip reload' reload all reloadable pjsip modules
AST-1432 #close
Reported by: John Bigelow
........

Merged revisions 425905 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-17 22:45:27 +00:00
Joshua Colp 0d0e38a0e1 res_pjsip_keepalive: Add runtime configurable keepalive module for connection-oriented transports.
This change adds a module which is configurable using the keep_alive_interval setting in the
global section that will send a CRLF keep alive to all active connection-oriented transports at
the provided interval. This is useful because it can help keep connections open through NATs.
This functionality also exists within PJSIP but can not be controlled at runtime and requires
recompiling it.

Review: https://reviewboard.asterisk.org/r/4084/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-17 13:17:58 +00:00
George Joseph c6837c236f res_pjsip_phoneprov_provider: Provides pjsip integration with res_phoneprov
This module allows res_pjsip to integrate with res_phoneprov.  It handles
the pjsip 'phoneprov' object type.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/3976/
........

Merged revisions 425007 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 425008 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-09 20:55:50 +00:00
George Joseph cc595f7353 res_phoneprov: Refactor phoneprov to allow pluggable config providers
This patch makes res_phoneprov more modular so other modules (like pjsip)
can provide configuration information instead of res_phoneprov relying solely
on users.conf and sip.conf.  To accomplish this a new ast_phoneprov public API
is now exposed which allows config providers to register themselves, set
defaults (server profile, etc) and add user extensions.

* ast_phoneprov_provider_register registers the provider and provides callbacks
  for loading default settings and loading users.
* ast_phoneprov_provider_unregister clears the defaults and users.
* ast_phoneprov_add_extension should be called once for each user/extension
  by the provider's load_users callback to add them.
* ast_phoneprov_delete_extension deletes one extension.
* ast_phoneprov_delete_extensions deletes all extensions for the provider.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/3970/
........

Merged revisions 424963 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424964 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-09 17:46:23 +00:00
Kinsey Moore b1f8eba178 PJSIP: Restore functional default for callerid_privacy
The pjsip config option default fixups from r424263 altered the
functional default from "allowed_not_screened" to "allowed". This
change restores the functional default value when none is provided.
........

Merged revisions 424426 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424427 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 13:59:09 +00:00
Richard Mudgett 2b0777c017 res_pjsip: Make transport cipher option accept a comma separated list of cipher names.
Improvements to the res_pjsip transport cipher option.

* Made the cipher option accept a comma separated list of OpenSSL cipher
names.  Users of realtime will be glad if they have more than one name to
list.

* Added the CLI command 'pjsip list ciphers' so a user can know what
OpenSSL names are available for the cipher option.

* Updated the cipher option online XML documentation to specify what is
expected for the value.

* Updated pjsip.conf.sample to not indicate that ALL is acceptable since
ALL does not imply a preference order for the ciphers and PJSIP does not
simply pass the string to OpenSSL for interpretation.

ASTERISK-24199 #close
Reported by: Joshua Colp

Review: https://reviewboard.asterisk.org/r/4018/
........

Merged revisions 424393 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424394 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-02 21:55:37 +00:00
Scott Griepentrog aa5458d6ab res_pjsip: document use of rewrite_contact in sample conf
Without setting rewrite_contact, an invite to an endpoint
behind NAT will not reach it - unless the endpoint itself
uses STUN or TURN to discover it's public URI.  Thus, the
use of this should be in the sample documentation.

Review: https://reviewboard.asterisk.org/r/4036/
........

Merged revisions 424337 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424338 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-02 13:36:01 +00:00
Joshua Colp adba2a8d7f res_pjsip: Add 'dtls_fingerprint' option to configure DTLS fingerprint hash.
During the latest update to DTLS-SRTP support the ability to configure
the hash used for fingerprints was added. This gave us two supported ones:
SHA-1 and SHA-256. The default was accordingly updated to SHA-256.
Unfortunately this configuration ability was not exposed within res_pjsip.
This change adds a dtls_fingerprint option that controls it.

#SIPit31
........

Merged revisions 424290 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424291 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-01 16:39:45 +00:00
Kinsey Moore 4d2c7c23f8 PJSIP: Handle defaults properly
This updates the code behind PJSIP configuration options with custom
handlers to deal with the assigned default values properly where it
makes sense and adjusting the default value where it doesn't. Before
applying this patch, there were several cases where the default value
for an option would prevent that config section from loading properly.

Reported by: Thomas Thompson
Review: https://reviewboard.asterisk.org/r/4019/
........

Merged revisions 424263 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 424266 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-01 12:28:05 +00:00
Walter Doekes d172d84fe1 musiconhold: Add preferchannelclass=no option to prefer app class.
The new option 'preferchannelclass' is added to musiconhold.conf. If yes
(the default) the CHANNEL(musicclass) is preferred when choosing the
hold music. If it is no, the class suggested by the application that
calls the MoH (e.g. the Queue() app) gets preferred (new behaviour).

This way you set a different hold-music from the Queue-music by setting
both the CHANNEL(musicclass) and the queue-context musicclass.

ASTERISK-24276 #close
Reported by: Kristian Høgh
Patches:
  app_override_channel_moh.patch uploaded by Kristian Høgh (License #6639)

Review: https://reviewboard.asterisk.org/r/4010/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-25 20:49:04 +00:00
Walter Doekes a62fedf0cb chan_sip: Clarify that sipdebug=yes cannot be undone by the CLI.
Document it in sip.conf.

ASTERISK-24249 #close
Reported by: Avinash Mohod

Review: https://reviewboard.asterisk.org/r/3926/
........

Merged revisions 423066 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 423067 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 423068 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423069 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-14 15:54:22 +00:00
Walter Doekes 9c1f34c7e9 musiconhold: Add sort=randstart, and deprecate old stuff.
- adds sort=randstart (next to sort=, sort=random, sort=alpha)
- combines duplicate moh option parsing code into a single function
- adds deprecationwarnings for application=r to sort randomly
- adds deprecationwarnings for random=yes to sort randomly
- removes invisible code that was supposed to stay until 1.8 

The sort=randstart works like sort=alpha, except we start at a random
position.

Review: https://reviewboard.asterisk.org/r/3991/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-14 15:41:58 +00:00
Mark Michelson baf99dffac Add note about configuring list_items on a single line.
........

Merged revisions 422855 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-08 18:04:01 +00:00
Mark Michelson 5ad0edacb6 Add sample configuration for resource lists.
On review /r/3977, it was recommended to note in the
sample configuration about the size limitation for
resource lists. However, since there was no section in
the sample configuration at all for resource list
subscriptions, I decided to make a separate commit
where I have added the necessary sample configuration
as well as the size limitation warning.
........

Merged revisions 422853 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-08 17:53:33 +00:00
Paul Belanger ef28cc0d43 chan_sip.c: Add 'rtpbindaddr' setting
Users now have the ability to bind the rtpengine instance to a specific IP
address.  For example, you want chan_sip (call control) on eth0 but rtp (media)
on eth1.

ASTERISK-24280 #close
Reported by: Paul Belanger
Tested by: Paul Belanger
Review: https://reviewboard.asterisk.org/r/3952/
Patches:
    rtpengine.diff uploaded by Paul Belanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-28 16:06:55 +00:00
Matthew Jordan add46fd27c app_queue: Add RealTime support for queue rules
This patch gives the optional ability to keep queue rules in RealTime. It is
important to note that with this patch:
 (a) Queue rules in RealTime are only examined on module load/reload
 (b) Queue rules are loaded both from the queuerules.conf file as well as the
     RealTime backend
To inform app_queue to examine RealTime for queue rules, a new setting has been
added to queuerules.conf's general section "realtime_rules". RealTime queue
rules will only be used when this setting is set to "yes".

The schema for the database table supports a rule_name, time, min_penalty, and
max_penalty columns. min_penalty and max_penalty can be relative, if a '-' or
'+' literal is provided. Otherwise, the penalties are treated as constants.

For example:
rule_name, time, min_penalty, max_penalty
'default', '10', '20', '30'
'test2', '20', '30', '55'
'test2', '25', '-11', '+1111'
'test2', '400', '112', '333'
'test3', '0', '4564', '46546'
'test_rule', '40', '15', '50'

which would result in :

Rule: default
 - After 10 seconds, adjust QUEUE_MAX_PENALTY to 30 and adjust
   QUEUE_MIN_PENALTY to 20
Rule: test2
 - After 20 seconds, adjust QUEUE_MAX_PENALTY to 55 and adjust
   QUEUE_MIN_PENALTY to 30
 - After 25 seconds, adjust QUEUE_MAX_PENALTY by 1111 and adjust
   QUEUE_MIN_PENALTY by -11
 - After 400 seconds, adjust QUEUE_MAX_PENALTY to 333 and adjust
   QUEUE_MIN_PENALTY to 112
Rule: test3
 - After 0 seconds, adjust QUEUE_MAX_PENALTY to 46546 and adjust
   QUEUE_MIN_PENALTY to 4564
Rule: test_rule
 - After 40 seconds, adjust QUEUE_MAX_PENALTY to 50 and adjust
   QUEUE_MIN_PENALTY to 15

If you use RealTime, the queue rules will be always reloaded on a module
reload, even if the underlying file did not change. With the option disabled,
the rules will only be reloaded if the file was modified.

Review: https://reviewboard.asterisk.org/r/3607/

ASTERISK-23823 #close
Reported by: Michael K
patches:
  app_queue.c_realtime_trunk.patch uploaded by Michael K (License 6621)
........

Merged revisions 420624 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-11 00:14:53 +00:00
Jason Parker 5ce4ad8031 app_voicemail: Add the ability to specify multiple email addresses.
ASTERISK-24045
Reported by: Jacob Barber
Review: https://reviewboard.asterisk.org/r/3833/
........

Merged revisions 420577 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-08 19:16:29 +00:00
Kinsey Moore f1036f40dc Stasis: Allow message types to be blocked
This introduces stasis.conf and a mechanism to prevent certain message
types from being published. Internally, this works by preventing the
chosen message types from being created which ensures that those
message types can never be published. This patch also adjusts message
publishers such that message payloads are not created if the related
message type is not available.

ASTERISK-23943 #close
Review: https://reviewboard.asterisk.org/r/3823/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-06 12:55:28 +00:00
Matthew Jordan fc0fecb476 configs: Move sample config files into a subdirectory of configs
This moves all samples configs from configs/ to configs/samples. This allows
for additional sets of sample configuration files to be added in the future.

Review: https://reviewboard.asterisk.org/r/3804/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-17 21:17:28 +00:00
Matthew Jordan fd94fea599 res_pjsip: Support setting a default accountcode on endpoints
Most channel drivers let you specify a default accountcode to be set on
channels associated with a particular peer/endpoint/object. Prior to this
patch, chan_pjsip/res_pjsip did not support such a setting.

This patch adds a new setting to the res_pjsip endpoint object, 'accountcode'.
When a channel is created that is associated with an endpoint with this value
set, the channel will automatically have its accountcode property set to the
value configured for the endpoint.

Review: https://reviewboard.asterisk.org/r/3724/

ASTERISK-24000 #close
Reported by: Matt Jordan
........

Merged revisions 418756 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-16 14:03:51 +00:00
Matthew Jordan 03e9c598e5 cel_pgsql, cdr_pgsql, res_config_pgsql: Add PostgreSQL application_name support
This patch adds support for the PostgreSQL application_name connection setting.
When the appropriate PostgreSQL module's configuration is set with an
application name, the name will be passed to PostgreSQL on connection and
displayed in the database's pg_stat_activity view, as well as in CSV logs. This
aids in managing which applications/servers are connected to a PostgreSQL
database, as well as tracing the activity of those connections.

Review: https://reviewboard.asterisk.org/r/3591

ASTERISK-23737 #close
Reported by: Gergely Domodi
patches:
  pgsql_application_name.patch uploaded by Gergely Domodi (License 6610)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-16 13:55:36 +00:00
Richard Mudgett 4339183c3e Actually delete the removed files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-14 01:45:01 +00:00
Corey Farrell 6461d90d8a Remove files left behind on removal of h323, jingle and jabber.
This change removes h323.conf.sample, jingle.h, jabber.h left behind by r3698.

Review: https://reviewboard.asterisk.org/r/3755/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-13 05:05:49 +00:00
Matthew Jordan 97834718c2 Remove many deprecated modules
Billing records are fair,
To get paid is quite bright,
You should really use ODBC;
Good-bye cdr_sqlite.

Microsoft did once push H.323,
Hell, we all remember NetMeeting.
But try to compile chan_h323 now
And you will take quite a beating.

The XMPP and SIP war was fierce,
And in the distant fray
Was birthed res_jabber/chan_jingle;
But neither to stay.

For everyone did care and chase what Google professed.
"Free Internet Calling" was what devotees cried,
But Google did change the specs so often
That the developers were happy the day chan_gtalk died.

And then there was that odd application
Dedicated to the Polish tongue.
app_saycountpl was subsumed by Say;
One could say its bell was rung.

To read and parse a file from the dialplan
You could (I guess) use an application.
app_readfile did fill that purpose, but I think
A function is perhaps better in its creation.

Barging is rude, I'm not sure why we do it.
Inwardly, the caller will probably sigh.
But if you really must do it,
Don't use app_dahdibarge, use ChanSpy.

We all despise the sound of tinny robots
It makes our queues so cold.
To control such an abomination
It's better to not use Wait/SetMusicOnHold.

It's often nice to know properties of a channel
It makes our calls right
We have a nice function called CHANNEL
And so SIPCHANINFO is sent off into the night.

And now things get odd;
Apparently one could delimit with a colon
Properties from the SIPPEER function!
Commas are in; all others are done.

Finally, a word on pipes and commas.
We're sorry. We can't say it enough.
But those compatibility options in asterisk.conf;
To maintain them forever was just too tough.

This patch removes:

* cdr_sqlite
* chan_gtalk
* chan_jingle
* chan_h323
* res_jabber
* app_saycountpl
* app_readfile
* app_dahdibarge

It removes the following applications/functions:

* WaitMusicOnHold
* SetMusicOnHold
* SIPCHANINFO

It removes the colon delimiter from the SIPPEER function.

Finally, it also removes all compatibility options that were configurable from
asterisk.conf, as these all applied to compatibility with Asterisk 1.4 systems.

Review: https://reviewboard.asterisk.org/r/3698/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-04 13:26:37 +00:00
Richard Mudgett 3bd495a688 chan_dahdi: Add inband_on_setup_ack compatibility option.
The new inband_on_setup_ack option causes Asterisk to assume inband audio
may be present when a SETUP_ACKNOWLEDGE message is received.

Q.931 Section 5.1.3 says that in scenarios with overlap dialing, when a
dialtone is sent from the network side, progress indicator 8 "Inband info
now available" MAY be sent to the CPE if no digits were received with the
SETUP.  It is thus implied that the ie is mandatory if digits came with
the SETUP and dialtone is needed.  This option should be enabled, when the
network sends dialtone and you want to hear it, but the network doesn't
send the progress indicator when needed.

NOTE: For Q.SIG setups this option should be enabled when outgoing overlap
dialing is also enabled because Q.SIG does not send the progress indicator
with the SETUP ACK.

The commit -r413714 (AST-1338) which causes this issue was dealing with a
SIP-to-ISDN interoperability issue.

This commit is a merge of the two patches indicated below.

ASTERISK-23897 #close
Reported by: Pavel Troller
Patches:
      pri-4.diff (license #6302) patch uploaded by Pavel Troller
      jira_asterisk_23897_v11.patch (license #5621) patch uploaded by rmudgett

Review: https://reviewboard.asterisk.org/r/3633/
........

Merged revisions 417956 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 417957 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 417958 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-03 22:22:36 +00:00
Richard Mudgett dbec5e0d8d HTTP: Add persistent connection support.
Persistent HTTP connection support is needed due to the increased usage of
the Asterisk core HTTP transport and the frequency at which REST API calls
are going to be issued.

* Add http.conf session_keep_alive option to enable persistent
connections.

* Parse and discard optional chunked body extension information and
trailing request headers.

* Increased the maximum application/json and
application/x-www-form-urlencoded body size allowed to 4k.  The previous
1k was kind of small.

* Removed a couple inlined versions of ast_http_manid_from_vars() by
calling the function.  manager.c:generic_http_callback() and
res_http_post.c:http_post_callback()

* Add missing va_end() in ast_ari_response_error().

* Eliminated unnecessary RAII_VAR() use in http.c:auth_create().

ASTERISK-23552 #close
Reported by: Scott Griepentrog

Review: https://reviewboard.asterisk.org/r/3691/
........

Merged revisions 417880 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-03 17:16:55 +00:00
Joshua Colp 6e60f5d317 Recorded merge of revisions 417677 from http://svn.asterisk.org/svn/asterisk/branches/11
........
res_rtp_asterisk: Add SHA-256 support for DTLS and perform DTLS negotiation on RTCP.

This change fixes up DTLS support in res_rtp_asterisk so it can accept and provide
a SHA-256 fingerprint, so it occurs on RTCP, and so it occurs after ICE negotiation
completes. Configuration options to chan_sip and chan_pjsip have also been added to
allow behavior to be tweaked (such as forcing the AVP type media transports in SDP).

ASTERISK-22961 #close
Reported by: Jay Jideliov

Review: https://reviewboard.asterisk.org/r/3679/
Review: https://reviewboard.asterisk.org/r/3686/
........

Merged revisions 417678 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-30 19:51:28 +00:00
Matthew Jordan 365ae7523b res_http_websocket: Close websocket correctly and use careful fwrite
When a client takes a long time to process information received from Asterisk,
a write operation using fwrite may fail to write all information. This causes
the underlying file stream to be in an unknown state, such that the socket
must be disconnected. Unfortunately, there are two problems with this in
Asterisk's existing websocket code:
1. Periodically, during the read loop, Asterisk must write to the connected
   websocket to respond to pings. As such, Asterisk maintains a reference to
   the session during the loop. When ast_http_websocket_write fails, it may
   cause the session to decrement its ref count, but this in and of itself
   does not break the read loop. The read loop's write, on the other hand,
   does not break the loop if it fails. This causes the socket to get in a
   'stuck' state, preventing the client from reconnecting to the server.
2. More importantly, however, is that the fwrite in ast_http_websocket_write
   fails with a large volume of data when the client takes awhile to process
   the information. When it does fail, it fails writing only a portion of
   the bytes. With some debugging, it was shown that this was failing in a
   similar fashion to ASTERISK-12767. Switching this over to ast_careful_fwrite
   with a long enough timeout solved the problem.

Note that this version of the patch, unlike r417310 in Asterisk 11, exposes
configuration options beyond just chan_sip's sip.conf. Configuration options
to configure the write timeout have also been added to pjsip.conf and ari.conf.

#ASTERISK-23917 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/3624/
........

Merged revisions 417310 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 417311 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 12:21:14 +00:00
George Joseph cc4178bf25 Update extensions.lua.sample with naming conflict guidance.
The sample extensions.lua was causing pbx_lua to fail to load when parsing
'app.goto("default", "s", 1)' because in Lua 5.2, 'goto' is now a reserved
word.  This patch adds guidance to extensions.lua.sample and changed
'app.goto("default", "s", 1)' to 'app.['goto']("default", "s", 1)'. 

ASTERISK-23844 #close
Reported by: rnewton
Tested by: gtjoseph
Review: https://reviewboard.asterisk.org/r/3627/
 
........

Merged revisions 416581 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 416582 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-18 17:20:13 +00:00
Richard Mudgett 0c896d8b9b chan_dahdi: Adds support for major update to libss7.
* SS7 support now requires libss7 v2.0 or later.  The new libss7 is not
backwards compatible.

* Added SS7 support for connected line and redirecting.

* Most SS7 CLI commands are reworked as well as new SS7 commands added.
See online CLI help.

* Added several SS7 config option parameters described in
chan_dahdi.conf.sample.

* ISUP timer support reworked and now requires explicit configuration.
See ss7.timers.sample.

Special thanks to Kaloyan Kovachev for his support and persistence in
getting the original patch by adomjan updated and ready for release.

SS7-27 #close
Reported by: adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16 18:27:51 +00:00
Richard Mudgett 4ca5745dbe AST-2014-007: Fix DOS by consuming the number of allowed HTTP connections.
Simply establishing a TCP connection and never sending anything to the
configured HTTP port in http.conf will tie up a HTTP connection.  Since
there is a maximum number of open HTTP sessions allowed at a time you can
block legitimate connections.

A similar problem exists if a HTTP request is started but never finished.

* Added http.conf session_inactivity timer option to close HTTP
connections that aren't doing anything.  Defaults to 30000 ms.

* Removed the undocumented manager.conf block-sockets option.  It
interferes with TCP/TLS inactivity timeouts.

* AMI and SIP TLS connections now have better authentication timeout
protection.  Though I didn't remove the bizzare TLS timeout polling code
from chan_sip.

* chan_sip can now handle SSL certificate renegotiations in the middle of
a session.  It couldn't do that before because the socket was non-blocking
and the SSL calls were not restarted as documented by the OpenSSL
documentation.

* Fixed an off nominal leak of the ssl struct in
handle_tcptls_connection() if the FILE stream failed to open and the SSL
certificate negotiations failed.

The patch creates a custom FILE stream handler to give the created FILE
streams inactivity timeout and timeout after a specific moment in time
capability.  This approach eliminates the need for code using the FILE
stream to be redesigned to deal with the timeouts.

This patch indirectly fixes most of ASTERISK-18345 by fixing the usage of
the SSL_read/SSL_write operations.

ASTERISK-23673 #close
Reported by: Richard Mudgett
........

Merged revisions 415841 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 415854 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 415896 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-12 17:00:08 +00:00
Rusty Newton 4e292ea3af configs/cli_aliases.conf: Two new aliases, plus enhancements for context names.
Changed naming of included alias templates to avoid confusion between version names. For example, asterisk12 was for asterisk 1.2, so I changed it to asterisk_1dot2, so that later we can use asterisk_12 for Asterisk 12.

Added alias for "features reload" to the template for Asterisk 11 style syntax template, as features reload was removed in 12, but you can still do "module reload features"

Added alias for "pjsip reload" to the friendly template. It is shorter than "module reload res_pjsip.so" and if some are like me; I constantly forget that reloading chan_pjsip doesn't parse config. Remembering "pjsip reload" is just easier.

ASTERISK-23654 #close
ASTERISK-23654 #comment Fixed by adding two new aliases and enhancements for context names.

Review: https://reviewboard.asterisk.org/r/3572/
........

Merged revisions 415301 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-06 12:49:38 +00:00
Rusty Newton 812f33d222 pjsip.conf: privkey_file should be priv_key_file, mediaencryption=yes should be mediaencryption=sdes
privkey_file was missed in the snake case update. An example included an invalid value for the mediaencryption option.
........

Merged revisions 414780 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28 20:53:05 +00:00
Igor Goncharovskiy d3433771c9 Introducing changes proposed to chan_unistim driver:
1) Added the unistim.conf variable dtmf_duration which can select the DTMF playback duration from 0ms to 150ms (0 is off and is the new default)
2) Enabled the transmission of month names, which are sent with the date and changed the dateformat variable to accept the values 0-3 as per the UNISTIM standard (2 & 3 match the previous 1 & 2 formats).
3) Enabled the "Mute" packet so muting microphone works as expected and microphone muted for all calls while LED light on
4) Changed Duree to Timer on i2004 display

(closes issue ASTERISK-23592)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-28 07:43:33 +00:00
Jonathan Rose ae21162a69 chan_sip: Add sendrpid trust options
In r411189, some behavior was changed which made sendrpid behavior
act in a more trusting manner by sending full user data for peers
set with private caller presence in P-Asserted-Identity headers.
Since this changed long time expected behaviors, we decided to pull
that patch when that was pointed out by the community. Instead, this
patch provides a trust_id_outbound setting which will expose the data
per RFC-3325 if set to 'yes' and simply not send the PAI/RPID headers
at all if set to 'no'. By default trust_id_outbound will be set to
'legacy' which will preserve the behavior prior to these patches.
Extra special thanks to Walter Doekes for providing advice and
feedback.

(closes issue AST-1301)

(closes issue ASTERISK-19465)
Reported by: Krzysztof Chmielewski

Review: https://reviewboard.asterisk.org/r/3447/
........

Merged revisions 412744 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 412746 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 412747 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-21 16:20:32 +00:00
Jonathan Rose cc4a0a7fc9 Reverting r411189 so that it can be put up for public review
---
  r411189 | jrose | 2014-03-26 10:50:48 -0500 (Wed, 26 Mar 2014) | 12 lines

  chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325)

  Prior to this patch, the P-Asserted-Identity header would include anonymous
  caller id information which seems to go against the point of the
  P-Asserted-Identity header. Now the real caller ID information will be
  included in this header. Also, no privacy header would be included.
  This patch adds 'Privacy: id' to outgoing SIP messages that include the
  P-Asserted-Identity header.

  (closes issue AST-1301)
---
........

Merged revisions 412328 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 412329 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 412330 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15 16:13:35 +00:00
Richard Mudgett 03beadb6e9 internal_timing: Remove the option and always make it enabled if a timing module is loaded.
The masquerade supertest frequently fails because either the local channel
chain doesn't completely optimize out or the DTMF handshake doesn't
completely get accross.  Local channel optimization requires frames
flowing to trigger when optimization can happen.  When optimization
happens the media frame that triggered the optimization is dropped.
Sending DTMF requires frames to flow in the other direction for timing
purposes while sending nothing.  If internal timing is not enabled when
MOH is playing, Asterisk switches to received timing when an audio frame
is received.  With optimization dropping media frames and MOH not sending
frames unless it receives frames, occasionaly there are no more frames
being passed and the test fails.

* The asterisk command line -I option and the asterisk.conf
internal_timing option are removed.  Asterisk now always uses internal
timing when needed if any timing module is loaded.  The issue
ASTERISK-14861 did this quite awhile ago in v1.4 but effectively is broken
if other internal timing modules besides DAHDI are used.  The
ast_read_generator_actions() now only does received timing if it has no
choice for frame generators like MOH, silence, and playback streaming.

* Cleaned up some code dealing with frame generators in
ast_deactivate_generator(), generator_write_format_change(),
ast_activate_generator(), and ast_channel_stop_silence_generator().

* Removed ast_internal_timing_enabled(), AST_OPT_FLAG_INTERNAL_TIMING, and
ast_opt_internal_timing.

ASTERISK-22846 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/3414/
........

Merged revisions 411715 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 411716 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 411717 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-04 19:19:55 +00:00
Mark Michelson eefcb79bfb Prevent duplicate sorcery wizards from being applied to sorcery object types.
This commit contains several changes to sorcery:

1) Application of sorcery configuration based on module name is automatically performed
when sorcery is opened for a module.
2) Sorcery will not attempt to apply the same wizard to an object type more than once.
3) Sorcery gives more exact results when attempting to apply a wizard, whether as the
default or based on configuration.

Sorcery unit tests still pass for me after making these changes.

Review: https://reviewboard.asterisk.org/r/3326
........

Merged revisions 411159 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-02 18:57:29 +00:00
Matthew Jordan ef0c9fe4d8 res_hep/res_hep_pjsip: Add a HEPv3 capture agent module and a logger for PJSIP
This patch adds the following:
(1) A new module, res_hep, which implements a generic packet capture agent for
the Homer Encapsulation Protocol (HEP) version 3. Note that this code is based
on a patch provided by Alexandr Dubovikov; I basically just wrapped it up,
added configuration via the configuration framework, and threw in a
taskprocessor.
(2) A new module, res_hep_pjsip, which forwards all SIP message traffic that
passes through the res_pjsip stack over to res_hep for encapsulation and
transmission to a HEPv3 capture server.

Much thanks to Alexandr for his Asterisk patch for this code and for a *lot*
of patience waiting for me to port it to 12/trunk. Due to some dithering on
my part, this has taken the better part of a year to port forward (I still
blame CDRs for the delay).

ASTERISK-23557 #close

Review: https://reviewboard.asterisk.org/r/3207/
........

Merged revisions 411534 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-28 18:32:50 +00:00
Jonathan Rose fa3a2f8eca chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325)
Prior too this patch, the P-Asserted-Identity header would include anonymous
caller id information which seems to go against the point of the
P-Asserted-Identity header. Now the real caller ID information will be
included in this header. Also, no privacy header would be included.
This patch adds 'Privacy: id' to outgoing SIP messages that include the
P-Asserted-Identity header.

(closes issue AST-1301)
........

Merged revisions 411189 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 411190 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 411193 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-26 16:15:12 +00:00
Mark Michelson eba91d2a98 Revert changes to sorcery that accidentally got committed.
These changes were still up for review and have not been approved
yet. I must have had the changes in my working copy when making
a different change.
........

Merged revisions 410696 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 19:35:17 +00:00
Mark Michelson d44aefeef4 Fix stuck channel in ARI through the introduction of synchronous bridge actions.
Playing back a file to a channel in an ARI bridge would attempt to wait until
the playback concluded before returning. The method used involved signaling the
waiting thread in the ARI custom playback function.

The problem with this is that there were some corner cases that were not accounted for:
* If a bridge channel could not be found, then we never would attempt the playback but
  would still attempt to wait for the playback to complete.
* If the bridge playfile action failed to queue, we would still attempt to wait for the
  playback to complete.
* If the bridge playfile action were queued but some circumstance caused the playback
  not to occur (the bridge dies, the channel is removed from the bridge), then we would
  never be notified.

The solution to this is to move the waiting logic into the bridge code. A new bridge
API function is added to queue a synchronous action on a bridge. The waiting thread
is notified when the queued frame has been freed, either due to an error occurring
or due to successful playback. As a failsafe, the waiting thread has a 10 minute
timeout just in case there is a frame leak somewhere.

Review: https://reviewboard.asterisk.org/r/3338
........

Merged revisions 410673 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 17:22:12 +00:00
Corey Farrell 3ee8cf6efb res_fax: Comment out default settings from res_fax.conf.
Comment out many settings in res_fax.conf.sample. The defaults are set in
res_fax.c, so setting the same value in sample config does nothing but make
the sample config more fragile.

(closes issue ASTERISK-23231)
Reported by: David Brillert
Review: https://reviewboard.asterisk.org/r/3261/
........

Merged revisions 409052 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 409053 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 409054 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 16:08:03 +00:00
Rusty Newton 23b142d5c8 configs/voicemail.conf.sample - Make mailcmd sample text more explicit
Made the wording a bit more explicit. Didn't really change the meaning.
........

Merged revisions 408876 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 408877 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 408878 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-25 17:44:53 +00:00
Kinsey Moore 75edef52e0 ConfBridge: Correct prompt playback target
Currently, when the first marked user enters the conference that
contains waitmarked users, a prompt is played indicating that the user
is being placed into the conference. Unfortunately, this prompt is
played to the marked user and not the waitmarked users which is not
very helpful.

This patch changes that behavior to play a prompt stating
"The conference will now begin" to the entire conference after adding
and unmuting the waitmarked users since the design of confbridge is not
conducive to playing a prompt to a subset of users in a conference in
an asynchronous manner.

(closes issue PQ-1396)
Review: https://reviewboard.asterisk.org/r/3155/
Reported by: Steve Pitts
........

Merged revisions 407857 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407858 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-10 16:01:37 +00:00
Richard Mudgett 6f38887cb7 chan_iax2: Block unnecessary control frames to/from the wire.
Establishing an IAX2 call between Asterisk v1.4 and v1.8 (or later)
results in an unexpected call disconnect.  The problem happens because
newer values in the enum ast_control_frame_type are not consistent between
the branch versions of Asterisk.

For example:
1) v1.4 calls v1.8 (or later) using IAX2

2) v1.8 answers and sends a connected line update control frame.  (on v1.8
AST_CONTROL_CONNECTED_LINE = 22)

3) v1.4 receives the control frame as an end-of-q (on v1.4
AST_CONTROL_END_OF_Q = 22)

4) v1.4 disconnects the call once the receive queue becomes empty.

Several things are done by this patch to fix the problem and attempt to
prevent it from happening again in the future:

* Added a warning at the definition of enum ast_control_frame_type about
how to add new control frame values.

* Made block sending and receiving control frames that have no reason to
go over the wire.

* Extended the connectedline iax.conf parameter to also include the
redirecting information updates.

* Updated the connectedline iax.conf parameter documentation to include a
notice that the parameter must be "no" when the peer is an Asterisk v1.4
instance.

(closes issue AST-1302)

Review: https://reviewboard.asterisk.org/r/3174/
........

Merged revisions 407678 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 407727 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407729 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 18:29:49 +00:00