Commit Graph

26288 Commits

Author SHA1 Message Date
George Joseph 8786fe13a4 res_pjsip_pubsub: Fix persistent subscriptions not surviving graceful shutdown
If you do a 'core (shutdown|restart) graceful' persistent subscriptions won't 
survive.  If you do a 'core (shutdown|restart) now' or asterisk terminates for 
some reason, they do.  Here's why...

When asterisk shuts down gracefully, it sends a 'NOTIFY/terminated' to 
subscribers for each subscription.  This not only tells the subscribers that the 
dialog/state machine is done, it also frees the last reference to the 
subscription tree which causes the persistent subscription to get deleted from 
astdb.  When asterisk restarts, nothing's left.  Just preventing the delete from 
astdb doesn't work because we already told the subscriber to terminate the 
dialog so we can't restart it even if it was still in astdb.  Everything works 
OK if asterisk terminates unexpectedly because we never send the 'terminated' 
message so on restart, the subscription is still in astdb and the subscriber is 
none the wiser.

This patch suppresses the sending of 'NOTIFY/terminated' on shutdown for 
persistent connections.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-08 21:41:02 +00:00
George Joseph c55f86c69d res_pjsip_outbound_registration: Fix reference leak.
Every time a registration started, sip_outbound_registration_response_cb bumps 
the ref count on client_state then pushes a handle_registration_response task.  
handle_registration_response never unreffed it though.  So every time a 
registration goes out, the ref count goes up by one.

This patch adds the unreffs to handle_registration_response.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-08 21:38:26 +00:00
George Joseph 030facce94 res_pjsip_outbound_registration: Fix several reload issues
There are 2 issues with reloading registrations...

1.  The 'can_reuse_registration' test wasn't considering the intervals or 
expiration in its determination of whether a registration changed or not so if 
you changed any of the intervals or the expiration and reloaded, the object 
would get reloaded but the actual timers wouldn't change.  
can_reuse_registration now does a sorcery diff on the old and new objects 
instead of discretely testing certain fields.  Now if you change expiration for 
instance, and reload, the timer is updated and re-registration will occur on the 
new value.

2.  If you mung up your password on an outbound registration you get a permanent 
failure.  If you fix the password (on the outbound_auth object) and reload, 
nothing tells outbound_registration to try again because the registration itself 
didn't change.  This patch adds an observer on the "auth" object type and if any 
auth changes, existing registration states are searched and those in a 
REJECTED_PERMANENT state are retried.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-08 17:51:36 +00:00
Kinsey Moore f8c4909eb7 ARI: Allow usage of ASYNCGOTO with Stasis()
When the AMI Redirect action is used with a channel bridged inside
Stasis() and not running a pbx, the channel is hung up instead of
proceeding to the desired location in dialplan. This change allows
such channels to be Redirected properly by detecting the operation
used by Redirect (ASYNCGOTO) and using the code already established
for functionality of the ARI channel continue operation.

ASTERISK-24591 #close
Review: https://reviewboard.asterisk.org/r/4271/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 21:26:48 +00:00
Mark Michelson 7f836c1c15 Add the ability to continue and originate using priority labels.
With this patch, the following two ARI commands

POST /channels
POST /channels/{id}/continue

Accept a new parameter, label, that can be used to continue to or originate
to a priority label in the dialplan.

Because this is adding a new parameter to ARI commands, the API version of
ARI has been bumped from 1.6.0 to 1.7.0.

This patch comes courtesy of Nir Simionovich from Greenfield Tech. Thanks!

ASTERISK-24412 #close
Reported by Nir Simionovich

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 18:54:06 +00:00
George Joseph e83853eebc res_pjsip_exten_state: Change 'does not exist' warning to notice
The 'new_subscribe: Extension <> does not exist or has no associated hint'
is a config issue and doesn't need to clutter up logs with warnings.
Changed to notice.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430321 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 18:17:42 +00:00
George Joseph 8cde7443c2 res_pjsip_mwi: Change "MWI Subscription failed" message from warning to notice
The "MWI Subscription failed" message means the client is trying to subscribe
to a mailbox that doesn't exist.  There's no need to clutter up logs with
warnings for a client misconfiguration so I changed it to a notice.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 18:15:02 +00:00
George Joseph 685f7ef924 func_config: Add ability to retrieve specific occurrence of a variable
I guess nobody uses templates with AST_CONFIG because today if you have a
context that inherits from a template and you call AST_CONFIG on the context,
you'll get the value from the template even if you've overridden it in the
context.  This is because AST_CONFIG only gets the first occurrence which is
always from the template.

This patch adds an optional 'index' parameter to AST_CONFIG which lets you
specify the exact occurrence to retrieve, or '-1' to retrieve the last.
The default behavior is the current behavior.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 17:54:13 +00:00
Mark Michelson 464647d8f8 Fix ability to perform a remote attended transfer with PJSIP.
This fix has two parts:

* Corrected an error message to properly state that external_replaces is an extension. The
  error message also prints what dialplan context the external_replaces extension was being
  looked for in.
* Corrected the printing of the Replaces: header in an INVITE request. We were duplicating
  "Replaces: " in the header.

ASTERISK-24376 #close
Reported by Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 17:45:56 +00:00
George Joseph 56de48107f config: Add option to NOT preserve effective context when changing a template
Let's say you have a template T with variable VAR1 = ON and you have a
context C(T) that doesn't specify VAR1.  If you read C, the effective value
of VAR1 is ON.  Now you change T VAR1 to OFF and call
ast_config_text_file_save.  The current behavior is that the file gets
re-written with T/VAR1=OFF but C/VAR1=ON is added.  Personally, I think this
is a bug. It's preserving the effective state of C even though I didn't
specify C/VAR1 in th first place.  I believe the behavior should be that if
I didn't specify C/VAR1 originally, then the effective value of C/VAR1 should
continue to follow the inherited state.  Now, if I DID explicitly specify
C/VAR1, the it should be preserved even if the template changes.

Even though I think the existing behavior is a bug, it's been that way forever
so I'm not changing it.  Instead, I've created ast_config_text_file_save2()
that takes a bitmask of flags, one of which is to preserve the effective context
(the current behavior).  The original ast_config_text_file_save calls *2 with
the preserve flag.  If you want the new behavior, call *2 directly without a
flag.

I've also updated Manager UpdateConfig with a new parameter
'PreserveEffectiveContext' whose default is 'yes'.  If you want the new behavior
with UpdateConfig, set 'PreserveEffectiveContext: no'.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 16:56:59 +00:00
Kinsey Moore 0c5234f12a Fix dev-mode build on recent gcc
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 03:01:39 +00:00
Matthew Jordan 220df246d9 Blocked revisions 430252
........
contrib/ast-db-manage: Correct down_revision path for user_eq_phone

When the user_eq_phone patch was backported to 13, it referenced the downward
revision that the PJSIP optimistic encryption option also references. This
creates a multi-path upgrade Exception when generating the SQL files.

This patch corrects this in the 13 branch. Note that trunk, which already
contained both of these features, is unaffected by this problem.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-06 22:46:43 +00:00
George Joseph 8b5bde3e5a res_pjsip_mwi: Change warning to notice
When res_pjsip loads and an endpoint auto-subscribes a mailbox for mwi,
if a contact hasn't registered yet, res_pjsip_mwi spits out a warning.
This is a perfectly normal situation though and doesn't require something
as serious as a warning.  It's also self correcting. The device will start
getting mwi as soon as it registers.

This patch changes the warning to a notice.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-06 17:53:42 +00:00
George Joseph 5f60ebc004 bridge_native_rtp: Change local/remote message from debug/2 to verb/4
Change the "Locally bridged"/"Remotely bridged" messages from dbg/2 to verb/4.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-06 17:49:03 +00:00
George Joseph fb3c8e3424 outbound_registration: Add 'pjsip send register' and update 'send unregister'
The current behavior of 'pjsip send unregister' is to send the unregister
(REGISTER with 0 exp) but let the next scheduled register proceed normally.
I don't think that's a good idea.  If you unregister, it should stay
unregistered until you decide to start registrations again.  So this patch
just adds a cancel_registration call to the current unregister_task to
cancel the timer.

Of course, now you need  a way to start registration again so I've added
a 'pjsip send register' command that unregisters and cancels any existing
registration (the same as send unregister), then sends an immediate
registration and starts the timer back up again.

Both changes also ripple to AMI.  There's a new PJSIPRegister command.

There's no harm in calling either command repeatedly.  They don't care
about the actual state.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-06 17:43:16 +00:00
George Joseph 7dc0c88fc6 pjsip cli: Fix sorting of contacts for 'pjsip list contacts'
For some reason I was using a hash container instead of a list to gather the
contacts for 'pjsip list/show contacts' so even though I had a sort function,
the output wasn't sorted.  This patch just changes the hash container to a
list container and the contacts now appear sorted in the CLI.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-06 17:29:33 +00:00
Scott Griepentrog 0b8fbf9238 bridge: avoid leaking channel during blond transfer pt2
A blond transfer to a failed destination, when followed
by a recall attempt, lead to a leak of the reference to
the destination channel.  In addition to correcting the
regression on the previous attempt (r429826) this fixes
the leak and two additional reference leaks on failures
of bridge_import.

ASTERISK-24513 #close
Review: https://reviewboard.asterisk.org/r/4302/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-05 22:50:32 +00:00
Joshua Colp e0bd2ca104 pjsip: Document addition of 'PJSIP_AOR' and 'PJSIP_CONTACT' in CHANGES file.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-05 17:57:43 +00:00
Joshua Colp f7cf988a82 pjsip: Add 'PJSIP_AOR' and 'PJSIP_CONTACT' dialplan functions.
The PJSIP_AOR dialplan function allows inspection of configured AORs including
what contacts are currently bound to them.

The PJSIP_CONTACT dialplan function allows inspection of contacts in existence.
These can include both externally added (by way of registration) or permanent
ones.

ASTERISK-24341
Reported by: xrobau

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-05 17:53:42 +00:00
Scott Griepentrog 8d059c3808 rtp_engine: keep payload types in correct range
In r428708 additional codecs were added including
a payload type of 128 which is outside of nominal
range of 0-127.  This change moves changes 128 to
96 to avoid causing a pjsip assertion when making
a call to an endpoint configured with allow=all.

ASTERISK-24367 #close
Review: https://reviewboard.asterisk.org/r/4286/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-31 18:54:37 +00:00
Kinsey Moore cb6a737359 PJSIP: Update transport method documentation
This updates the documentation for the 'method' configuration option to
be more verbose about the behaviors of values 'unspecified' and
'default'. They do exactly the same thing which is to select the
default as defined by PJSIP which is currently TLSv1.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-29 13:14:19 +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 3a73c6c90e main/pbx.c: Fix double lock of contexts lock introduced by r429967
We only need to hold the context_merge_lock once. Locking it twice will make
many other parts of Asterisk very sad.

ASTERISK-24641 #close


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-24 16:59:42 +00:00
George Joseph 7ea4156a5e pjsip_options: Fix continued qualifies after endpoint/aor deletion
If you remove an endpoint/aor from pjsip.conf then do a core reload,
qualifies will continue even though the object are gone.  This happens
because nothing clears out the qualify tasks.

This patch unschedules all existing qualify tasks before scheduling
new ones on reload.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-23 23:19:30 +00:00
George Joseph 62d1dba271 test_astobj2: Fix warning for missing trailing slash in category
This patch adds a trailing slash to the category for this test.
No more warning.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-23 23:16:35 +00:00
Richard Mudgett 1c0604e905 DTMF atxfer: Setup recall channels as if the transferee initiated the call.
After the initial DTMF atxfer call attempt to the transfer target fails to
answer during a blonde transfer, the recall callback channels do not get
setup with information from the initial transferrer channel.  As a result,
the recall callback to the transferrer does not have callid, channel
variables, datastores, accountcode, peeraccount, COLP, and CLID setup.  A
similar situation happens with the recall callback to the transfer target
but it is less visible.  The recall callback to the transfer target does
not have callid, channel variables, datastores, accountcode, peeraccount,
and COLP setup.

* Added missing information to the recall callback channels before
initiating the call.  callid, channel variables, datastores, accountcode,
peeraccount, COLP, and CLID

* Set callid of the transferrer channel on the DTMF atxfer controller
thread attended_transfer_monitor_thread().

* Added missing channel unlocks and props unref to off nominal paths in
attended_transfer_properties_alloc().

ASTERISK-23841 #close
Reported by: Richard Mudgett

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 21:20:11 +00:00
Richard Mudgett 7d954f4cb1 Fix compilation since the patch for ASTERISK-24363 went in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 20:25:40 +00:00
Richard Mudgett bbd9ff122e queue_log: Post QUEUESTART entry when Asterisk fully boots.
The QUEUESTART log entry has historically acted like a fully booted event
for the queue_log file.  When the QUEUESTART entry was posted to the log
was broken by the change made by ASTERISK-15863.

* Made post the QUEUESTART queue_log entry when Asterisk fully boots.
This restores the intent of that log entry and happens after realtime has
had a chance to load.

AST-1444 #close
Reported by: Denis Martinez

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 20:08:35 +00:00
Matthew Jordan 264a50c52a chan_sip: Send CANCEL via original INVITE destination even after UPDATE request
Given the following scenario:
* Three SIP phones (A, B, C), all communicating via a proxy with Asterisk
* A call is established between A and B. B performs a SIP attended transfer of
  A to C. B sets the call on hold (A is hearing MOH) and dials the extension of
  C. While phone C is ringing, B transfers the call (that is, what we typically
  call a 'blond transfer').
* When the transfer completes, A hears the ringing of phone C, while B is idle.

In the SIP messaging for the above scenario, a REFER request is sent to
transfer the call. When "sendrpid=yes" is set in sip.conf, Asterisk may send an
UPDATE request to phone C to update party information. This update is sent
directly to phone C, not through the intervening proxy. This has the unfortunate
side effect of providing route information, which is then set on the sip_pvt
structure for C. If someone (e.g. B) is trying to get the call back (through a
directed pickup), Asterisk will send a CANCEL request to C. However, since we
have now updated the route set, the CANCEL request will be sent directly to C
and not through the proxy. The phone ignores this CANCEL according to RFC3261
(Section 9.1).

This patch updates reqprep such that the route is not updated if an UPDATE
request is being sent while the INVITE state is INV_PROCEEDING or
INV_EARLY_MEDIA. This ensures that a subsequent CANCEL request is still sent
to the correct location.

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

ASTERISK-24628 #close
Reported by: Karsten Wemheuer
patches:
  issue.patch uploaded by Karsten Wemheuer (License 5930)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429984 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 15:40:27 +00:00
Matthew Jordan 0c38276d6e presencestate: Allow channel drivers to provide presence state information
This patch adds the ability for channel drivers to supply presence information
in a similar manner to device state. The patch does not provide any channel
driver implementations, but it does provide the core infrastructure necessary
for channel drivers to provide such information.

The core handles multiple providers of presence state information. Ordering
of presence state is as follows:
 INVALID < NOT_SET < AVAILABLE < UNAVAILABLE < CHAT < AWAY < XA < DND

Each provider can trump the previous if it provides a presence state that
supercedes a previous one.

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

ASTERISK-24363 #close
Reported by: Gareth Palmer
patches:
  chan_presencestate-428146.patch uploaded by Gareth Palmer (License 5169)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 14:33:24 +00:00
Matthew Jordan 2afeadcc84 app_confbridge: Fix build error caused by XML validation errors
Summaries can't contain XML nodes, as they are defined to contain only text
data.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 12:16:36 +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 b137a92aef res_pjsip_phoneprovi_provider: Fix reload
Reloading wasn't working correctly because on a reload, the sorcery apply
handler was never being called for unchanged users.  So, instead of using
an apply handler, I'm now iterating over all users.  Works much more reliably.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 00:17:49 +00:00
Joshua Colp ba403e83bd acl: Fix reloading of configuration if configuration file does not exist at startup.
The named ACL code incorrectly destroyed the config options information if loading
of the configuration file failed at startup. This would result in reloading
also failing even if a valid configuration file was put in place.

ASTERISK-23733 #close
Reported by: Richard Kenner
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-20 20:57:47 +00:00
Richard Mudgett 54bd1c9683 res_http_websocket.c: Fix incorrect use of sizeof in ast_websocket_write().
This won't fix the reported issue but it is an incorrect use of sizeof.

ASTERISK-24566
Reported by:  Badalian Vyacheslav
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-19 20:56:12 +00:00
Richard Mudgett b508b3474e chan_dahdi: Don't ignore setvar when using configuration section scheme.
When the configuration section scheme of chan_dahdi.conf is used (keyword
dahdichan instead of channel) all setvar= options are completely ignored.
No variable defined this way appears in the created DAHDI channels.

* Move the clearing of setvar values to after the deferred processing of
dahdichan.

AST-1378 #close
Reported by: Guenther Kelleter
Patch by: Guenther Kelleter
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-19 17:34:33 +00:00
Scott Griepentrog 07d1012383 bridge: avoid leaking channel during blond transfer
After a blond transfer (start attended and hang up)
to a destination that also hangs up without answer,
the Local;1 channel was leaked and would show up on
core show channels.  This was happening because the
attended state blond_nonfinal_enter() resetting the
props->transfer_target to null while releasing it's
own reference, which would later prevent props from
releasing another reference during destruction. The
change made here is simply to not assign the target
to NULL.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-19 17:27:25 +00:00
Richard Mudgett 2cbfafa8c1 chan_dahdi.c, res_rtp_asterisk.c: Change some spammy debug messages to level 5.
ASTERISK-24337 #close
Reported by: Rusty Newton
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-18 22:40:16 +00:00
Richard Mudgett eacbb4ceb5 chan_dahdi: Populate CALLERID(ani2) for incoming calls in featdmf signaling mode.
For the featdmf signaling mode the incoming MF Caller-ID information is
formatted as follows: *${CALLERID(ani2)}${CALLERID(ani)}#*${EXTEN}#

Rather than discarding the ani2 digits, populate the CALLERID(ani2) value
with what is received instead.

AST-1368 #close
Reported by: Denis Martinez
Patches:
      extract_ani2_for_featdmf_v11.patch (license #5621) patch uploaded by Richard Mudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-18 20:09:21 +00:00
Kevin Harwell 546a54574f res_pjsip_sdp_rtp: wrong bridge chosen when the DTMF mode is not compatible
A native rtp bridge was being chosen (it shouldn't have been) when using two
pjsip channels with incompatible DTMF modes.  This patch sets the rtp instance
property, AST_RTP_PROPERTY_DTMF, for the appropriate DTMF mode(s) for pjsip.
It was not being set before, meaning all DTMF modes for pjsip were being treated
as compatible, thus native bridging would be chosen as the bridge type when it
shouldn't have been.

ASTERISK-24459 #close
Reported by: Yaniv Simhi
Review: https://reviewboard.asterisk.org/r/4265/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-18 15:55:03 +00:00
Mark Michelson 2f3e5b494a Prevent potential infinite outbound authentication loops in registration.
Prior to this patch, Asterisk would always respond to 401 responses to
registration attempts by trying to provide a registration with authentication
credentials. Even if subsequent attempts were rejected with 401 responses,
Asterisk would continue this behavior. If authentication credentials were
incorrect, this could continue forever.

With this patch, we keep track of whether we have attempted authentication
on an outbound registration attempt. If we already have, we don not try
again until the next attempt. This prevents the infinite loop scenario.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-18 15:40:13 +00:00
Mark Michelson 2b1f2b5c1f Prevent possible race condition on dual redirect of channels in the same bridge.
The AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT flag was created to prevent bridges from
prematurely acting on orphaned channels in bridges. The problem with the AMI
redirect action was that it was setting this flag on channels based on the presence
of a PBX, not whether the channel was in a bridge. Whether a channel has a PBX
is irrelevant, so the condition has been altered to check if the channel is in a
bridge.

ASTERISK-24536 #close
Reported by Niklas Larsson

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-18 15:18:45 +00:00
Mark Michelson cc1405bd38 Ensure the correct value is returned for CHANNEL(pjsip, secure)
Prior to this patch, we were using the PJSIP dialog's secure flag
to determine if a secure transport was being used. Unfortunately,
the dialog's secure flag was only set if a SIPS URI were in use,
as required by RFC 3261 sections 12.1.1 and 12.1.2. What we're interested
in is not dialog security, but transport security. This code change
switches to a model where we use the dialog's target URI to determine
what transport would be used to communicate, and then check if that
transport is secure.

AST-1450 #close
Reported by John Bigelow

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-18 14:50:06 +00:00
George Joseph 18b5a336ef res_pjsip_config_wizard: fix unload SEGV
If certain pjsip modules aren't loaded, the wizard causes a SEGV
when it unloads.  Added a check for the presense of the object
type wizard before trying to clean it up.

Tested-by: George Joseph
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-18 00:11:24 +00:00
George Joseph c4360796f7 res_pjsip_config_wizard: Change FILEUNCHANGED config_load2 flag determination
The module now applies the FILEUNCHANGED flag when both reloaded is
specified AND there's no last_config for the object type.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-17 23:06:01 +00:00
Walter Doekes 8b6ecc449c Fix printf problems with high ascii characters after r413586 (1.8).
In r413586 (1.8) various casts were added to silence gcc 4.10 warnings.
Those fixes included things like:

    -out += sprintf(out, "%%%02X", (unsigned char) *ptr);
    +out += sprintf(out, "%%%02X", (unsigned) *ptr);

That works for low ascii characters, but for the high range that yields
e.g. FFFFFFC3 when C3 is expected.

This changeset:
- fixes those casts to use the 'hh' unsigned char modifier instead
- consistently uses %02x instead of %2.2x (or other non-standard usage)
- adds a few 'h' modifiers in various places
- fixes a 'replcaes' typo
- dev/urandon typo (in 13+ patch)

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

ASTERISK-24619 #close
Reported by: Stefan27 (on IRC)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-17 10:23:32 +00:00
George Joseph c4cc668ba9 res_pjsip_config_wizard: fix test breakage
Fix test breakage caused by not checking for res_pjsip before
calling ast_sip_get_sorcery.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-16 17:53:59 +00:00
Joshua Colp 58095d2486 chan_sip: Allow T.38 switch-over when SRTP is in use.
Previously when SRTP was enabled on a channel it was not possible
to switch to T.38 as no crypto attributes would be present.

This change makes it so it is now possible. If a T.38 re-invite
comes in SRTP is terminated since in practice you can't encrypt
a UDPTL stream. Now... if we were doing T.38 over RTP (which
does exist) then we'd have a chance but almost nobody does that so
here we are.

ASTERISK-24449 #close
Reported by: Andreas Steinmetz
patches:
 udptl-ignore-srtp-v2.patch submitted by Andreas Steinmetz (license 6523)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-16 16:39:47 +00:00
Joshua Colp b5182a6795 res_pjsip_t38: Fix T.38 failure when peer reinvites immediately.
If a remote endpoint reinvites to T.38 immediately the state machine
will go into a peer reinvite state. If a T.38 capable application
(such as ReceiveFax) queries it will receive this state. Normally
the application will then indicate so that the channel driver will
queue up the T.38 offer previously received. Once it receives this
offer the application will act normally and negotiate.

The res_pjsip_t38 module incorrectly partially squashed this indication.
This would cause the application to think the request had failed when
in reality it had actually worked.

This change makes it so that no T.38 control frames (or indications)
are squashed.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-16 15:44:43 +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