Commit Graph

25340 Commits

Author SHA1 Message Date
Richard Mudgett
dccc215ba9 devicestate.c: Simplified some logic in _ast_device_state().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-01 00:04:47 +00:00
Richard Mudgett
4c840980cf stasis_cache.c: Remove some unnecessary RAII_VAR() usage.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-01 00:00:33 +00:00
Richard Mudgett
014010bf8e stasis.c: Misc code cleanups.
* Remove some unnecessary RAII_VAR() usage.

* Made the struct stasis_subscription ao2 object use the ao2 lock instead
of a redundant join_lock in the struct for ast_cond_wait().

* Removed locks on some ao2 objects that don't need the lock.

* Made the topic pool entries container use the ao2 template functions.

* Add some missing allocation failure checks.

* Add missing cleanup in off nominal path of dispatch_message().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 23:29:58 +00:00
Richard Mudgett
c38f3bd145 chan_sip: Add precautionary p->owner checks.
* Add precautionary p->owner checks in sip_hangup(), get_refer_info(),
get_also_info(), and interpret_t38_parameters().

* Simplify some tangled logic in get_refer_info(), get_also_info(), and
add_rpid().

* Removed some dead code in handle_request_invite().

(closes issue ASTERISK-23323)
Reported by: Walter Doekes
Patches:
      issueA23323-more_p_owner_checks-1.8.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-11.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-12.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-trunk.patch (license #5674) uploaded by wdoekes (modified)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:40:54 +00:00
Kinsey Moore
370b75e4e1 app_queue: Fix documented AMI event name
During the rewrite of AMI events to use the Stasis bus, the name of the
QueueMemberPaused event was changed to QueueMemberPause. This corrects
documentation to reflect that.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:24:15 +00:00
Kinsey Moore
f0948cf239 Blocked revisions 409208
........
app_queue: Fix documentation generation

The documentation for QueueMemberPaused was causing documentation
generation to fail because the documentation for that AMI event was in
the wrong location. This moves that documentation the correct location
and adds a missing parameter.

(closes issue SWDAT-261)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:15:22 +00:00
Richard Mudgett
649dfa007c chan_sip: Fix crash in ast_channel_hangupcause_set().
* Fix crash in ast_channel_hangupcause_set() because p->owner not checked
before calling.  Regression introduced by the fix for ASTERISK-22621.

(closes issue ASTERISK-23135)
Reported by: OK

(issue ASTERISK-23323)
Reported by: Walter Doekes
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 18:02:11 +00:00
Jonathan Rose
5261fd7bc7 Multiple revisions 409129-409130
........
  r409129 | jrose | 2014-02-27 13:19:02 -0600 (Thu, 27 Feb 2014) | 15 lines
  
  res_rtp_asterisk: Fix checklist creating problems in ICE sessions
  
  Prior to this patch, local candidate lists including SRFLX would fail to start
  properly when building ICE candidate check lists. This patch fixes that problem
  by making sure that each SRFLX candidate is associated with the proper
  base address so that the check list can create matches properly.
  This patch was written by jcolp. The issue will be left open to await testing
  by the issue participants.
  
  (issue ASTERISK-23213)
  Reported by: Andrea Suisani
  Review: https://reviewboard.asterisk.org/r/3256/
........
  r409130 | jrose | 2014-02-27 13:38:10 -0600 (Thu, 27 Feb 2014) | 8 lines
  
  res_rtp_asterisk: correct build error from r409129
  
  Accidentally placed a declaration below functional code
  
  (issue ASTERISK-23213)
  Reported by: Andrea Suisani
  Review: https://reviewboard.asterisk.org/r/3256/
........

Merged revisions 409129-409130 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 19:42:17 +00:00
David M. Lee
7bf499290d Fix memory stomping bug in astman.
This memset complained in dev mod on my Ubuntu box. The memset is both
unnecessary and dangerous. At this point, m hasn't been initialized
yet, so the memset will write off to whatever address happens to be
on the stack at the time.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 16:25:32 +00:00
Corey Farrell
a976d09cdc res_fax: Warn that minrate=2400 is not valid for V.27 instead of failing load.
Change minrate from 2400 to 4800 on config reload in response to changes from
ASTERISK-22790 only.  Any config with minrate of 2400 that would fail before
r405693 will still fail.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 16:05:31 +00:00
Matthew Jordan
4488ca127b Blocked revisions 409002
Note that this is blocked in 12 as channels are no longer masqueraded out
of bridges. The channel cannot be replaced with a ZOMBIE channel in the
affected routine.

........
rtp_engine: fix crash during remote native bridging when calling get_codecs

When two RTP channels are in a remote bridge, the remote bridging loop in
rtp_engine will periodically check to see if the two channels can still be
bridged. One of the many things it checks is whether or not the codecs have
changed on the channel. If the codec has changed, it will break out of the
loop to re-determine which type of bridge is appropriate.

In order to perform this check, the ast_rtp_glue virtual table's get_codec
callback is called for each channel. The callback implementations assume
that the channel tech private is valid when called; as such, there has
always been some code in place to check whether or not the channel pvt is
NULL before calling. However, this check is insufficient.

The channels are unlocked during the remote bridging loop. It is possible
for a channel to get masqueraded between the check for the pvt being NULL and
the actual call to get_codec. When this occurs, the callback is called with a
ZOMBIE channel, which now has a NULL pvt. Crash.

While this has always been possible in Asterisk 1.8, it is much more likely to
occur in Asterisk 11 and later versions due to the timing changes that occur
when getting the codec from a channel. Note that this is much more likely to be
reproduced on slow, boggy hardware running Asterisk 11 - but fairly rarely
otherwise.

Also Note: This crash was also caught by the various SIP blind transfer tests,
in addition to the bug report Alec filed.

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

(closes issue ASTERISK-21737)
Reported by: Alec Davis
Tested by: Alec Davis
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 13:09:37 +00:00
Matthew Jordan
e7d0c35210 res_pjsip_sdp_rtp: Apply packetization rules on inbound SDP handling
The setting 'use_ptime' is supposed to tell Asterisk to honour the ptime
attribute in an offer, preferring it to whatever packetization
preferences have been set internally. Currently, however, something
rather quirky will happen:

(1) The SDP answer will be constructed in create_outgoing_sdp_stream.
    This will use the preferences from the endpoint, such that the 200 OK
    response will add the packetization preferences from the endpoint, and
    not what was offered.
(2) When the 200 response is issued, apply_negotiated_sdp_stream is called.
    This will call apply_packetization, which will use the ptime attribute
    from the offer internally.

We end up telling the offerer to use the internal ptime attribute, but we end
up using the offered ptime attribute. Hilarity ensues.

This patch modifies the behaviour by calling apply_packetization from
negotiate_incoming_sdp_stream, which is called prior to
create_outgoing_sdp_stream. This causes the format preferences on the
session's media object to be set to the inbound ptime value (if 'use_ptime'
is enabled), such that the construction of the answer gets the right value
immediately.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 12:28:04 +00:00
Richard Mudgett
312d0122c3 test_stasis.c: Misc cleanups.
* Make the consumer ao2 object use the ao2 lock instead of a redundant
lock in the struct for ast_cond_wait().

* Fixed some curly brace placements.

* Fixed use of malloc(0).  malloc(0) has variant behavior.  It is up to
the implementation to determine if it returns NULL or a valid pointer that
can be later passed to free().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 23:33:06 +00:00
Scott Griepentrog
33d60bed46 pjsip: avoid edge case potential crash in answer()
When accidentally compiling against a wrong version of
pjsip headers with a different pjsip_inv_session size,
the invite_tsx structure could be null in the answer()
function.  This led to a crash because it attempted to
send the session response with an uninitialized packet
pointer.  This patch presets packet to null and adds a
diagnostic log message to explain why the call fails.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 19:00:07 +00:00
Joshua Colp
ccfa79d2ba res_ari: Make some additional error responses consistent with the rest of the system.
This change makes some error cases use ast_ari_response_error to construct their
error responses instead of manually doing it. This ensures they are consistent
with the other error responses.

Based on the original patch as done by Paul Belanger on the associated review.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 17:03:47 +00:00
Kinsey Moore
b0655b6439 PJSIP: Fix some bad spacing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 13:46:44 +00:00
Kinsey Moore
a4dfffc124 PJSIP: Prevent crash if channel has gone away
It is currently possible for an ast_sip_session to exist without an
associated channel as is the case when a new invite is coming in or
just after a hangup is issued on a chan_pjsip channel. Part of the
attended transfer code assumed the channel would be non-NULL and used
it as such causing a crash. This bug was exposed thanks to the attended
transfer ARI test in the test suite.

(closes issue ASTERISK-23287)
Reported by: Matt Jordan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 13:33:52 +00:00
Kevin Harwell
4cf4c0c61a res_pjsip_exten_state: Presence for digium phones
Added presence support for digium phones.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-25 17:50:54 +00:00
Kevin Harwell
138767895c res_pjsip_send_to_voicemail: transferring to voicemail for digium phones
Added the ability for transferring directly to voicemail on digium phones.
Added a new module that checks for the presence of a custom header and/or
diversion header within a sip REFER.  If either is found and they specify
a sending to voicemail action then variables are added to the channel
allowing the user access to them in the dialplan.  Dialplan can then be
written that branches based upon these values allowing, for instace, for
a single number to be used for dialing and/or accessing voicemail directly.

Also fixed a problem where the PJSIP_HEADER function was allowing non pjsip
channels through (checked to make sure it has the correct channel type before
proceeding).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-25 17:45:27 +00:00
Rusty Newton
fdbad7a21f 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-25 17:43:59 +00:00
Matthew Jordan
91991bbfe0 main: Initialize dialplan providing core components prior to module pre-load
It is possible to pre-load pbx_config. As a result, pbx_config - which will
load and parse the dialplan - will attempt to use various dialplan components,
such as device state providers and presence state providers, prior to them
being initialized by the core. This would lead to a crash, as the components
had not created their Stasis cache entries.

This patch moves a number of core component initializations before the module
pre-load. This guarantees that if someone does pre-load pbx_config - or other
pbx modules - that the Stasis caches for the various core components are
created.

(closes issue ASTERISK-23320)
Reported by: xrobau

(closes issue ASTERISK-23265)
Reported by: Andrew Nagy
Tested by: Andrew Nagy, Rusty Newton


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-22 19:56:23 +00:00
Alexandr Anikin
ef7783822d ignore AST_CONTROL_PVT_CAUSE_CODE without any messages
(closes issue ASTERISK-23336)
Reported by: Alexander Semych
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-22 17:57:07 +00:00
Corey Farrell
695f77ac12 Remove extra defines of AST_PBX_MAX_STACK.
* Ensure AST_PBX_MAX_STACK is only defined in extconf.h and pbx.h.
* Fix incorrect function parameters in utils/extconf.c.

(closes issue ASTERISK-23141)
Reported by: Maxim
Review: https://reviewboard.asterisk.org/r/3241/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-22 02:29:55 +00:00
Kevin Harwell
47c449122c rtp_engine: Dynamic payload change in rtp mapping not supported
Asterisk didn't support the dynamic payload change in rtp mapping in the 200
OK response.

Scenario:
Asterisk sends the INVITE proposing alaw and telephone-event, it proposes
rtpmap:101 for telephone-event.  Peer responds with 2xx, it answers with
alaw and telephone-event also, but it proposes a different rtpmap number
(rtpmap:103) for telephone-event.

Expected Behaviour:
Asterisk should honour the rtpmapping in the response and send DTMF packets
using 103 as payload type for DTMF.

Actual Behaviour: Asterisk sends DTMF packets using payload type 101.

With this patch asterisk now supports changes that can occur in the rtp mapping
in the response.

(closes issue ASTERISK-23279)
Reported by: NITESH BANSAL
Review: https://reviewboard.asterisk.org/r/3225/
Patches:
     dynamic_payload_change.patch uploaded by nbansal (license 6418)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 18:34:15 +00:00
Richard Mudgett
f6875db8e7 manager: Fix AMI Status action of a single channel.
Fixed use of uninitialized ao2 container iterator in an off-nominal
condition.  Either a memory allocation error or the requested channel is
an internal channel not exposed to the outside.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 18:17:14 +00:00
Richard Mudgett
f064222b89 json: Fix off-nominal json ref counting issues.
* Fixed off-nominal json ref counting issue with using the following API
calls: ast_json_object_set() and ast_json_array_append().

* Fixed off-nominal error reporting in ast_ari_endpoints_list().

* Fixed some miscellaneous off-nominal json ref counting issues in
report_receive_fax_status() and dial_to_json().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 17:49:07 +00:00
Richard Mudgett
8090faebf1 json: Fix json API wrapper code for json library versions earlier than 2.3.0.
* Fixed json ref counting issue with json API wrapper code for
ast_json_object_update_existing() and ast_json_object_update_missing()
when the json library is earlier than version 2.3.0.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 17:43:00 +00:00
Kevin Harwell
fcb8c05420 rtp_engine: Output mixup in ${CHANNEL(rtpqos,audio,all)}
Fixed the output of CHANNEL(rtpqos,audio,all) to use txjitter instead
of rxjitter.

(closes issue ASTERISK-23261)
Reported by: rsw686
Patches:
     rtpqos.patch uploaded by rsw686 (license 5887)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 16:20:27 +00:00
Kevin Harwell
a72f07544a channel.c: MOH is not working for transferee after attended transfer
Updated the code to check to see if MOH is playing on the transferor and if
so then start it on the channel that replaces it during a masquerade.

Example scenario of the problem:
Alice calls Bob and then Bob begins the attended transfer process into a queue.
Upon going on hold Alice hears music and so does Bob once he is in the queue.
Bob then transfers Alice into the queue and then music for Alice stops even
though she should be hearing it since has now replaced Bob in the queue.

The problem that was occurring is that once the channel was masqueraded the app
(queues, confbridge, etc...) had no way of knowing that the channel had just
been swapped out thus it did not start music for the present channel.

Credit to Olle Johansson for pointing me in the right direction on this issue.

(closes issue ASTERISK-19499)
Reported by: Timo Teräs
Review: https://reviewboard.asterisk.org/r/3226/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 15:44:55 +00:00
Alexandr Anikin
8ec5ab8b33 Fix type of roundTripDelay variables
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 10:42:40 +00:00
Michael L. Young
eec7d62f14 app_chanspy: Documentation Update To Clarify "x" Option
When using the "x" option (specify a DTMF digit to exit the application), it is
not obvious in the documentation that this only works when spying on a channel.
If a channel being used to spy on other channels is waiting to connect to a
channel or is no longer attached to a channel, the DTMF is ignored.

As noted on the issue tracker, since there are workarounds available and this is
a rarely used option we are opting for a documentation change here.

(closes issue ASTERISK-22661)
Reported by: Chris Hillman
Patches:
    asterisk-22661-doc-clarify-chan_spy.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 00:49:19 +00:00
George Joseph
db64b734c1 pjsip_cli: Add pjsip commands 'show registrations' and 'show contacts'.
Added 'show registrations' and 'show contacts' to pjsip cli to make things
a little more consistent.  The output is exactly the same as the list command.

Just needed to add entries to their respective ast_cli_entry structures.

(closes issue ASTERISK-23275)
Review: http://reviewboard.asterisk.org/r/3210/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-20 21:09:47 +00:00
George Joseph
d048c19120 pjsip_cli: Fix memory leak in ast_sip_cli_print_sorcery_objectset.
Fixed memory leaks in ast_sip_cli_print_sorcery_objectset and
ast_variable_list_sort.  

(closes issue ASTERISK-23266)
Review: http://reviewboard.asterisk.org/r/3200/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-20 20:52:03 +00:00
George Joseph
31b4edae7f sorcery: Create sorcery instance registry.
In order to retrieve an arbitrary sorcery instance from a dialplan function
(or any place else) there needs to be a registry of sorcery instances.

ast_sorcery_init now creates a hashtab as a registry.

ast_sorcery_open now checks the hashtab for an existing sorcery instance
matching the caller's module name.  If it finds one, it bumps the 
refcount and returns it.  If not, it creates a new sorcery instance,
adds it to the hashtab, then returns it.

ast_sorcery_retrieve_by_module_name is a new function that does a hashtab 
lookup by module name.  It can be called by the future dialplan function.

res_pjsip/config_system needed a small change to share the main res_pjsip 
sorcery instance.

tests/test_sorcery was updated to include a test for the registry.

(closes issue ASTERISK-22537)
Review: http://reviewboard.asterisk.org/r/3184/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-20 20:42:36 +00:00
Matthew Jordan
1253c28633 res_pjsip: Update documentation for 'use_avpf' option
When 'use_avpf' is set to True, inbound offers must use the AVPF/SAVPF RTP
profile. However, when 'use_avpf' is set to False, Asterisk will accept
both AVP/SAVP or AVPF/SAVPF RTP profiles in inbound offers. The documentation
previously implied that Asterisk would reject AVPF/SAVPF if 'use_avpf' was
set to False and a UA offered said profile in an INVITE request.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-20 19:02:13 +00:00
Rusty Newton
42ccec9dda apps/app_queue - Fix incorrect Macro parameter documentation
Macro is executed on the called channel, not the calling channel.

(closes issue ASTERISK-23069)
Reported By: Bryan Anderson
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-20 02:43:11 +00:00
Richard Mudgett
21a7a6f146 config: Add file size and nanosecond resolution fields to the cached modified config file information.
Repeatedly modifying config files and reloading too fast sometimes fails
to reload the configuration because the cached modification timestamp has
one second resolution.

* Added file size and nanosecond resolution fields to the cached config
file modification timestamp information.  Now if the file size changes or
the file system supports nanosecond resolution the modified file has a
better chance of being detected for reload.

* Added a missing unlock in an off-nominal code path.

(closes issue AST-1303)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408389 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-19 19:07:42 +00:00
Richard Mudgett
e9d641a2de res_sorcery_astdb.c: Fix regex handling and keep simple prefix matching performance.
The sorcery astDB wizzard does not handle regex correctly if the pattern
begins with an anchor character.

This patch attempts to convert the anchored regex pattern to a prefix
pattern supported by astDB for performance reasons.  If it is not able to
convert the pattern it falls back to getting all astDB members of the
family and doing a normal regex pattern matching on the retrieved records.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-19 18:26:17 +00:00
Alexandr Anikin
771ab0b35d process receiveAndTransmit user input remote caps instead of receive only
send receiveAndTransmit user input our caps instead of receive only
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-19 12:00:27 +00:00
Alexandr Anikin
c3efd95c90 Allow different socket and signalling ip on h.323 connection if gk mode is active
Reported by: Gabriele Odone
Patches:
	ASTERISK-22738-1.patch
Tested by: Gabriele Odone
(closes issue ASTERISK-22738)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-19 10:20:02 +00:00
Richard Mudgett
a0f1e41fe0 alembic: Add svn:ignore *.pyc to directories and svn:executable to *.py files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-18 19:18:35 +00:00
Mark Michelson
cb791f0275 Store SIP User-Agent information in contacts.
When an endpoint sends a REGISTER request to Asterisk, we now will
associate the User-Agent header with all contacts that were bound in
that REGISTER request.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-17 15:21:59 +00:00
Matthew Jordan
fe6f1d5d0a pbx: Handle a completely empty dialplan during a context merge
It is highly unlikely, but - at least in Asterisk 12 - theoretically possible
to load Asterisk with no dialplan whatsoever. If that occurs, and some other
module (that is not a pbx module) attempts to merge its contexts into the
dialplan, the existing merge routine will crash. This is because it is not
insane, and rightly believes that you provided some sort of dialplan,
somewhere.

This patch will gracefully merge the contexts in such a case. Note that this
is highly unlikely to occur in 1.8/11, as features will most likely provide
some dialplan via parking. However, in Asterisk 12, parking is now provided
by res_parking, and hence may create its dialplan later.

(closes issue ASTERISK-23297)
Reported by: CJ Oster

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-16 03:23:14 +00:00
Matthew Jordan
374cd971f9 buildsystem: Unbreak the build (infloop) on Asterisk 11+
Apparently r408084 ( https://reviewboard.asterisk.org/r/3212/ ) broke the
build. This patch fixes it by ignoring the .lastclean dependencies if the
MENUSELECT_EMBED variable is not defined.

patches:
  tmp.diff uploaded by wdoekes (License 5674)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-16 01:49:05 +00:00
Scott Griepentrog
23966a1c6d ARI: correct upper/lower case URI discrepancies
URI's are supposed to be case sensitive and all
lower case.  In practice some portions of URI's
in ARI are case insensitive and others are not,
such as TECH, which in one instance would match
a lower case name and in another would not.  In
this patch, the ast_endpoint_lastest_snapshot()
function is modified to change the TECH portion
to full upper case before lookup. This resolves
the discrepancy noted by the reporter.  However
I chose to avoid forcing the /ari prefix of the
URI's to be lower case for now.  Except for the
two cases here, all URI's should be lower case,
unless they are part of a resource name or id.

Review: https://reviewboard.asterisk.org/r/3211/
Reported by: Zane Conkle
(closes issue ASTERISK-23125)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 21:44:34 +00:00
Scott Griepentrog
3ad378592c format.c: correct possible null pointer dereference
In ast_format_sdp_parse and ast_format_sdp_generate
the check checks for a valid interface and function
were potentially confusing, and hid an error in the
test of the presence of the function that is called
later.  This patch clears up and corrects the test.

Review: https://reviewboard.asterisk.org/r/3208/
(closes issue ASTERISK-23098)
Reported by: marcelloceschia
Patches:
     main_format.patch uploaded by marcelloceschia (license 6036)
	 ASTERISK-23098.patch uploaded by coreyfarrell (license 5909)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 21:28:18 +00:00
Walter Doekes
e628b1488d buildsystem: Don't force main to depend on everything else.
Directory 'main' only needs to depend on embedded modules. If no
module embedding is selected, the dependency is dropped.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 13:29:22 +00:00
Matthew Jordan
e56f01903d chnan_sip: Set SIP_DEFER_BYE_ON_TRANSFER prior to calling bridge blind transfer
This patch moves setting SIP_DEFER_BY_ON_TRANSFER prior to calling
ast_bridge_transfer_blind. This prevents a BYE from being sent prior to the
NOTIFY request that informs the transferor if the transfer succeeded or failed.

This patch also clears said flag from the off nominal NOTIFY paths in the
local_attended_transfer code, as once we've sent the NOTIFY request it is safe
to send by the BYE request.

This was caught by the blind-transfer-accountcode test in the Asterisk Test
Suite.

(closes issue ASTERISK-23290)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 12:39:11 +00:00
Mark Michelson
600c528e92 Remove all PJSIP MWI-specific use from our MWI code.
PJSIP has built-in MWI code that could be useful to some
degree, but our utilization of the API actually made our
code a bit more cluttered since we had to have special
cases peppered throughout.

With this change, we move to using the pjsip_evsub API
instead, which streamlines the code by removing special
cases.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-13 18:50:30 +00:00
Mark Michelson
39f87c16a9 Fix crash in AMI PJSIPShowEndpoint action.
If an AOR has no permanent contacts, then the
permanent_contacts container is never allocated.
This makes the code safe in the face of NULLs.

I also changed the variable that counts contacts
from "num" to "total_contacts" since there are now
two variables that are indicate numbers of things.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@407988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-13 15:45:52 +00:00