asterisk/asterisk.git
6 years agoSet the CALLERID(dnid-num-plan) for incoming ISDN calls.
Richard Mudgett [Mon, 25 Mar 2013 23:25:32 +0000 (23:25 +0000)]
Set the CALLERID(dnid-num-plan) for incoming ISDN calls.

The CALLEDTON channel variable is set for incoming ISDN calls to the lower
7 bits of the Q.931 type-of-number/numbering-plan octet.  The
CALLERID(dnid-num-plan) should have the same value.

(closes issue ASTERISK-21248)
Reported by: rmudgett
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383799 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix typo
Kinsey Moore [Mon, 25 Mar 2013 20:15:09 +0000 (20:15 +0000)]
Fix typo

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383754 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix missing ' ' around '='
Kinsey Moore [Mon, 25 Mar 2013 20:07:00 +0000 (20:07 +0000)]
Fix missing ' ' around '='

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383753 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoinstall_prereq: removed some out-of-date comments
David M. Lee [Mon, 25 Mar 2013 19:28:04 +0000 (19:28 +0000)]
install_prereq: removed some out-of-date comments

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383747 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoinstall_prereq: Adding jansson-devel to RH packages
David M. Lee [Mon, 25 Mar 2013 17:12:03 +0000 (17:12 +0000)]
install_prereq: Adding jansson-devel to RH packages

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383728 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMove NewCallerid, HangupRequest and SoftHangupRequest to Stasis
David M. Lee [Mon, 25 Mar 2013 16:19:55 +0000 (16:19 +0000)]
Move NewCallerid, HangupRequest and SoftHangupRequest to Stasis

HangupRequest and SoftHangupRequest are now ast_channel_blob Stasis
messages, with the cause code as an optional field in the blob.

NewCallerid now simply watches for changes in the callerid information
in channel snapshots, and creates the AMI event appropriately.

Since the original NewCallerid event honored the channelvars setting
in manager.conf, the channel variables configured there had to become
a part of the channel snapshot. These are now a part of every snapshot
based event, making the configuration description "every time a
channel-oriented event is emitted" less of a lie.

There a a few other changes wrapped up in here as well.

 * When ast_channel_topic() is given NULL for a channel, it returns
   the ast_channel_topic_all() topic instead of NULL. This can clean
   up a lot of NULL checking we're doing currently.
 * The fields Cause and Cause-txt were removed from the base channel
   information and put only on the Hangup events, since those fields
   are meaningless outside of a Hangup event.
 * Removed the pipe-delimiter processing of the channelvars field,
   since that's been deprecated forever.

(closes issue ASTERISK-21096)
Review: https://reviewboard.asterisk.org/r/2405/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383726 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoProperly delimit post data in res_config_curl.
Sean Bright [Mon, 25 Mar 2013 12:38:15 +0000 (12:38 +0000)]
Properly delimit post data in res_config_curl.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383669 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixed another issue from r383579.
David M. Lee [Fri, 22 Mar 2013 20:51:33 +0000 (20:51 +0000)]
Fixed another issue from r383579.

Core modules don't honor <depend> flags in MODULEINFO, which broke jansson
if specified --with-jansson to configure.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383633 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix StopMixMonitor Hanging Up When Unable To Stop MixMonitor On A Channel
Michael L. Young [Fri, 22 Mar 2013 20:43:24 +0000 (20:43 +0000)]
Fix StopMixMonitor Hanging Up When Unable To Stop MixMonitor On A Channel

A regression was accidentally introduced when allowing an optional ID to be used
when calling StopMixMonitor.  When we are unable to stop MixMonitor on a
channel, -1 is being returned which triggers the hangup of the channel.

This patch restores the prior behavior by returning 0 whether we were successful
or not.  It also allows the call from the manager to use the return code when
the action fails.

(closes issue ASTERISK-21294)
Reported by: daroz
Tested by: daroz
Patches:
  asterisk-21294-stop_mixmonitor_hangingup.diff Michael L. Young (license 5026)

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383632 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCorrected some module issues introduced by r383579.
David M. Lee [Fri, 22 Mar 2013 19:26:37 +0000 (19:26 +0000)]
Corrected some module issues introduced by r383579.

When I moved res_json.c to json.c, I left the MODULE_INFO stuff in there,
which was interesting if you ran module show. I also forgot to call what
was in module_load() from asterisk main().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383611 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMove more channel events to Stasis; move res_json.c to main/json.c.
David M. Lee [Fri, 22 Mar 2013 14:06:46 +0000 (14:06 +0000)]
Move more channel events to Stasis; move res_json.c to main/json.c.

This patch started out simply as fixing the bouncing tests introduced
in r382685, but required some other changes to give it a decent
implementation.

To fix the bouncing tests, the UserEvent and Newexten AMI events
needed to be refactored to dispatch via Stasis. Dispatching directly
to AMI resulted in those events sometimes getting ahead of the
associated Newchannel events, which would understandably confuse anyone.

I found that instead of creating a zillion different message types and
structures associated with them, it would be preferable to define a
message type that has a channel snapshot and a blob of structured data
with a small bit of additional information. The JSON object model
provides a very nice way of representing structured data, so I went
with that.

 * Move JSON support from res_json.c to main/json.c
   * Made libjansson-dev a required dependency
 * Added an ast_channel_blob message type, which has a channel
   snapshot and JSON blob of data.
 * Changed UserEvent and Newexten events so that they are dispatched
   via ast_channel_blob messages on the channel's topic.
 * Got rid of the ast_channel_varset message; used ast_channel_blob
   instead.
 * Extracted the manager functions converting Stasis channel events to
   AMI events into manager_channel.c.

(issue ASTERISK-21096)
Review: https://reviewboard.asterisk.org/r/2381/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383579 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix skinny voicemail indication issues.
Damien Wedhorn [Fri, 22 Mar 2013 06:32:03 +0000 (06:32 +0000)]
Fix skinny voicemail indication issues.

Unsubscribe from MWI stasis event on channel reload.

(closes issue ASTERISK-21216)
Reported by: wedhorn
Tested by: snuffy, myself
Patches:
    skinny-mwiind02.diff uploaded by snuffy (license 5024)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383560 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCorrected doc error for Stasis. I guess the mutex isn't necessary.
David M. Lee [Thu, 21 Mar 2013 20:09:11 +0000 (20:09 +0000)]
Corrected doc error for Stasis. I guess the mutex isn't necessary.

Thanks, rmudgett!

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383541 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix astobj2 doxygen comment.
Richard Mudgett [Thu, 21 Mar 2013 17:41:52 +0000 (17:41 +0000)]
Fix astobj2 doxygen comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383519 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoHave func_curl log a warning when a curl request fails.
Walter Doekes [Wed, 20 Mar 2013 20:27:37 +0000 (20:27 +0000)]
Have func_curl log a warning when a curl request fails.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383462 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMinor cleanup in func_curl near hashcompat code.
Walter Doekes [Wed, 20 Mar 2013 20:18:40 +0000 (20:18 +0000)]
Minor cleanup in func_curl near hashcompat code.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383458 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoResolve a race condition in Stasis
Kinsey Moore [Wed, 20 Mar 2013 16:01:30 +0000 (16:01 +0000)]
Resolve a race condition in Stasis

Because of the way that topics were handled when publishing, it was
possible to dispatch a message to a subscription after that
subscription had been unsubscribed such that the dispatched message
arrived at the callback after the callback had received its final
message. In callbacks that cleaned up user data, this would often cause
a segfault. This has been resolved by locking the topic during the
entirety of dispatch. To prevent long publishing and topic locking
times, forwarding subscriptions have been made to be standard
subscriptions instead of mailboxless subscriptions which were
dispatched at publishing time.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383422 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPass the sorcery instance to wizards for CUD operations as well as retrieve.
Joshua Colp [Wed, 20 Mar 2013 14:52:23 +0000 (14:52 +0000)]
Pass the sorcery instance to wizards for CUD operations as well as retrieve.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383405 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix lock destruction/unlock inversion
Kinsey Moore [Tue, 19 Mar 2013 19:07:46 +0000 (19:07 +0000)]
Fix lock destruction/unlock inversion

When using scoped locks, the unref of an AO2 object should happen after
the unlock occurs which requires usage of scoped refs.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383377 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMultiple revisions 383341-383342
David M. Lee [Tue, 19 Mar 2013 16:00:22 +0000 (16:00 +0000)]
Multiple revisions 383341-383342

........
  r383341 | dlee | 2013-03-19 10:57:29 -0500 (Tue, 19 Mar 2013) | 5 lines

  Removed codecs/g722/*.i on make clean
  ........

  Merged revisions 383340 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
  r383342 | dlee | 2013-03-19 10:58:33 -0500 (Tue, 19 Mar 2013) | 1 line

  Remove codecs/speex/*.i on make clean
........

Merged revisions 383341-383342 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383343 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake sure things compile...
Kinsey Moore [Sat, 16 Mar 2013 16:00:40 +0000 (16:00 +0000)]
Make sure things compile...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383287 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoTransition MWI to Stasis-core
Kinsey Moore [Sat, 16 Mar 2013 15:45:58 +0000 (15:45 +0000)]
Transition MWI to Stasis-core

Remove MWI's dependency on the event system by moving it to
Stasis-core. This also introduces forwarding topic pools in Stasis-core
which aggregate many dynamically allocated topics into a single primary
topic.

Review: https://reviewboard.asterisk.org/r/2368/
(closes issue ASTERISK-21097)
Patch-by: Kinsey Moore

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383284 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd support for using XMPP buddy state via device state.
Joshua Colp [Sat, 16 Mar 2013 15:40:31 +0000 (15:40 +0000)]
Add support for using XMPP buddy state via device state.

This change allows you to use XMPP buddy state in places where device state
can be used be used, such as dialplan hints. If at least one resource is
available the buddy is considered available. Now your phone can reflect
their IM status too!

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383283 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a bug where resources were not found due to hashing on the priority itself.
Joshua Colp [Sat, 16 Mar 2013 15:15:44 +0000 (15:15 +0000)]
Fix a bug where resources were not found due to hashing on the priority itself.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383267 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoA simplistic router for stasis_message's.
David M. Lee [Fri, 15 Mar 2013 17:35:16 +0000 (17:35 +0000)]
A simplistic router for stasis_message's.

Often times, when subscribing to a topic, one wants to handle
different message types differently. While one could cascade if/else
statements through the subscription handler, it is much cleaner to
specify a different callback for each message type. The
stasis_message_router is here to help!

A stasis_message_router is constructed for a particular stasis_topic,
which is subscribes to. Call stasis_message_router_unsubscribe() to
cancel that subscription.

Once constructed, routes can be added using
stasis_message_router_add() (or stasis_message_router_set_default()
for any messages not handled by other routes). There may be only one
route per stasis_message_type. The route's callback is invoked just as
if it were a callback for a subscription; but it only gets called for
messages of the specified type.

(issue ASTERISK-20887)
Review: https://reviewboard.asterisk.org/r/2390/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383242 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoSample config file for stasis-core.
David M. Lee [Fri, 15 Mar 2013 16:42:05 +0000 (16:42 +0000)]
Sample config file for stasis-core.

(issue ASTERISK-20887)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383225 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoTake advantage of the fact that stasis_unsubscribe now returns NULL
Kinsey Moore [Fri, 15 Mar 2013 13:04:52 +0000 (13:04 +0000)]
Take advantage of the fact that stasis_unsubscribe now returns NULL

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383169 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake stasis unsubscription functions return NULL
Kinsey Moore [Fri, 15 Mar 2013 12:58:23 +0000 (12:58 +0000)]
Make stasis unsubscription functions return NULL

Unsubscribing things in Asterisk seems to very commonly follow with
NULLing out the variable that was unsubscribed. This change makes that
a bit simpler.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383168 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agotcptls: Prevent unsupported options from being set
Kinsey Moore [Fri, 15 Mar 2013 12:53:03 +0000 (12:53 +0000)]
tcptls: Prevent unsupported options from being set

AMI, HTTP, and chan_sip all support TLS in some way, but none of them
support all the options that Asterisk's TLS core is capable of
interpreting. This prevents consumers of the TLS/SSL layer from setting
TLS/SSL options that they do not support.

This also gets tlsverifyclient closer to a working state by requesting
the client certificate when tlsverifyclient is set. Currently, there is
no consumer of main/tcptls.c in Asterisk that supports this feature and
so it can not be properly tested.

Review: https://reviewboard.asterisk.org/r/2370/
Reported-by: John Bigelow
Patch-by: Kinsey Moore
(closes issue AST-1093)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383167 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoWhen a session timer expires during a T.38 call, re-invite with correct SDP
Matthew Jordan [Fri, 15 Mar 2013 01:38:53 +0000 (01:38 +0000)]
When a session timer expires during a T.38 call, re-invite with correct SDP

When a session timer expires during a dialog that has re-negotiated to T.38
and Asterisk is the refresher, Asterisk will send a re-INVITE with an SDP
containing audio media only. This causes some hilarity with the poor fax
session under weigh.

This patch corrects that by sending T.38 parameters if we are in the middle of
a T.38 session.

(closes issue ASTERISK-21232)
Reported by: Nitesh Bansal
patches:
  dont-send-audio-reinvite-for-sess-timer-in-t38-call.patch uploaded by nbansal (License 6418)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383126 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix processing of call files when using KQueue on OS X
Matthew Jordan [Fri, 15 Mar 2013 01:24:23 +0000 (01:24 +0000)]
Fix processing of call files when using KQueue on OS X

In certain situations, call files are not processed when using KQueue with
pbx_spool. Asterisk was sending an invalid timeout value when the spool
directory is empty, causing the call to kevent to error immediately. This
can create a tight loop, increasing the CPU load on the system.

(closes issue ASTERISK-21176)
Reported by: Carlton O'Riley
patches:
  kqueue_osx.patch uploaded by coriley (License 6473)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383122 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix whitespace in AST_EXT_LIB_CHECK macro.
Jason Parker [Thu, 14 Mar 2013 16:57:36 +0000 (16:57 +0000)]
Fix whitespace in AST_EXT_LIB_CHECK macro.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383063 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAlways set the RTP instance data in the RTP engine
Matthew Jordan [Wed, 13 Mar 2013 14:39:54 +0000 (14:39 +0000)]
Always set the RTP instance data in the RTP engine

Not informing the RTP engine of the instance data creates shrapnel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383008 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate Doxygen
Andrew Latham [Tue, 12 Mar 2013 22:43:15 +0000 (22:43 +0000)]
Update Doxygen

Push some cleanups upstream before testing another ticket.

(issue ASTERISK-20259)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382989 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix Sorting Order For Parking Lots Stored In Static Realtime
Michael L. Young [Tue, 12 Mar 2013 21:19:39 +0000 (21:19 +0000)]
Fix Sorting Order For Parking Lots Stored In Static Realtime

When retrieving the parking lots from a MySQL database table, the current order
is "filename, cat_metric desc, var_metric asc, category".  If there are multiple
parking lots with the same cat_metric but different categories, everything is
being sorted on cat_metric first resulting in errors when loading the parking
lots.

This patch fixes the problem by sorting on the category field first, then the
cat_metric field.

(closes issue ASTERISK-21035)
Reported by: Alex Epshteyn
Patches:
  asterisk-21035-orderby.diff Michael L. Young (license 5026)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382954 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate Contributed Realtime Schema Files - IPv6 Addresses
Michael L. Young [Tue, 12 Mar 2013 20:41:42 +0000 (20:41 +0000)]
Update Contributed Realtime Schema Files - IPv6 Addresses

This commit updates some fields in the contributed realtime schema files to
handle IPv6 addresses.

(closes issue ASTERISK-21173)
Reported by: Torrey Searle
Patches:
  realtime_sql.patch Torrey Searle (license 5334)
  asterisk-21173-update-ip-fields.diff Michael L. Young (license 5026)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382941 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a crash when res_xmpp is configured using a username without a domain.
Joshua Colp [Tue, 12 Mar 2013 20:07:10 +0000 (20:07 +0000)]
Fix a crash when res_xmpp is configured using a username without a domain.

(closes issue ASTERISK-21156)
Reported by: amsoft2001
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382924 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoSwitch to using external pjproject libraries.
Jason Parker [Tue, 12 Mar 2013 19:08:59 +0000 (19:08 +0000)]
Switch to using external pjproject libraries.

ICE/STUN/TURN support in res_rtp_asterisk is also now optional.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382900 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoInclude the Username field in SIP Registry events when Status is registered
Matthew Jordan [Tue, 12 Mar 2013 16:30:02 +0000 (16:30 +0000)]
Include the Username field in SIP Registry events when Status is registered

In ASTERISK-17888, the AMI Registry event during SIP registrations was supposed
to include the Username field. Somehow, one of the events was missed. This
patch corrects that - the Username field should be included in all AMI Registry
events involving SIP registrations.

(issue ASTERISK-17888)

(closes issue ASTERISK-21201)
Reported by: Dmitriy Serov
patches:
  chan_sip.c.diff uploaded by Dmitriy Serov (license 6479)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382852 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix core dump on CLI usage
Igor Goncharovskiy [Tue, 12 Mar 2013 08:55:14 +0000 (08:55 +0000)]
Fix core dump on CLI usage

Fix issue with 'unistim show info' CLI command when device connected not configured
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382828 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdded an option to disallow music on hold
Kevin Harwell [Mon, 11 Mar 2013 15:22:02 +0000 (15:22 +0000)]
Added an option to disallow music on hold

Added an option "discard_remote_hold_retrieval" (default "no") that if set does
not trigger the music on hold event.  This essentially stops telling the peer
to start music on hold.

(issue ABE-2899)
Reported by: Denis Alberto Martinez
Review: https://reviewboard.asterisk.org/r/2336/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382787 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoconfbridge: Rename items for clarity and consistency.
Richard Mudgett [Sat, 9 Mar 2013 00:21:46 +0000 (00:21 +0000)]
confbridge: Rename items for clarity and consistency.

struct conference_bridge_user -> struct confbridge_user
struct conference_bridge -> struct confbridge_conference
struct conference_state -> struct confbridge_state

struct conference_bridge_user *conference_bridge_user -> struct confbridge_user *user
struct conference_bridge_user *cbu -> struct confbridge_user *user
struct conference_bridge *conference_bridge -> struct confbridge_conference *conference

The names are now generally shorter, consistently used, and don't conflict
with the struct names.

This patch handles the renaming part of the issue.

(issue ASTERISK-20776)
Reported by: rmudgett

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382764 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: Update the via header when relaying SMS MESSAGE
Jonathan Rose [Fri, 8 Mar 2013 20:26:03 +0000 (20:26 +0000)]
chan_sip: Update the via header when relaying SMS MESSAGE

Prior to this change, certain conditions for sending the message would
result in an address of '(null)' being used in the via header of the
SIP message because a NULl value of pvt->ourip was used when initially
generating the via header. This is fixed by adding a call to build_via
when the address is set before sending the message.

(closes issue ASTERISK-21148)
Reported by: Zhi Cheng
Patches:
700-sip_msg_send_via_fix.patch uploaded by Zhi Cheng (license 6475)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382746 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis documentation updates.
David M. Lee [Fri, 8 Mar 2013 16:59:02 +0000 (16:59 +0000)]
Stasis documentation updates.

(issue ASTERISK-20887)
(issue ASTERISK-20959)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382724 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoEnsure dummy channels get a stasis topic.
David M. Lee [Fri, 8 Mar 2013 16:25:58 +0000 (16:25 +0000)]
Ensure dummy channels get a stasis topic.

Fixes test failure introduced in r382685.

(issue ASTERISK-20887)
(issue ASTERISK-20959)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382721 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd message dump capability to stasis cache layer
Kinsey Moore [Fri, 8 Mar 2013 16:00:14 +0000 (16:00 +0000)]
Add message dump capability to stasis cache layer

The cache dump mechanism allows the developer to retreive multiple
items of a given type (or of all types) from the cache residing in a
stasis caching topic in addition to the existing single-item cache
retreival mechanism.  This also adds to the caching unit tests to
ensure that the new cache dump mechanism is functioning properly.

Review: https://reviewboard.asterisk.org/r/2367/
(issue ASTERISK-21097)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382705 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoThis patch adds a new message bus API to Asterisk.
David M. Lee [Fri, 8 Mar 2013 15:15:13 +0000 (15:15 +0000)]
This patch adds a new message bus API to Asterisk.

For the initial use of this bus, I took some work kmoore did creating
channel snapshots. So rather than create AMI events directly in the
channel code, this patch generates Stasis events, which manager.c uses
to then publish the AMI event.

This message bus provides a generic publish/subscribe mechanism within
Asterisk. This message bus is:

 - Loosely coupled; new message types can be added in seperate modules.
 - Easy to use; publishing and subscribing are straightforward
   operations.

In addition to basic publish/subscribe, the patch also provides
mechanisms for message forwarding, and for message caching.

(issue ASTERISK-20887)
(closes issue ASTERISK-20959)
Review: https://reviewboard.asterisk.org/r/2339/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382685 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove unused function
Matthew Jordan [Fri, 8 Mar 2013 04:11:12 +0000 (04:11 +0000)]
Remove unused function

After r382670, get_ip_and_port_from_sdp was no longer used.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382671 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDon't reset the RTP address on a glare re-INVITE
Matthew Jordan [Fri, 8 Mar 2013 03:54:38 +0000 (03:54 +0000)]
Don't reset the RTP address on a glare re-INVITE

Originally, way back in r201583, we added the alternate RTP address so
that the RTP engine would expect to receive audio from a new source
when a glare re-INVITE occurred. In r382589, we remove the alternate
RTP source, as the 'secret' probation mode allows for switching to a new
RTP source when a previous source stops sending RTP. At the time, it
seemed appropriate to set the RTP source based on the information in the
glared re-INVITE.

Unfortunately, that doesn't work so well - in a glared re-INVITE that occurs
with no SDP - such as in a connected line update that glances - we'll set
the RTP source to an invalid address. In subsequent re-INVITE requests from
this Asterisk instance, we'll then send an invalid media address, which will
result in the remote side sending a 488. Whoops.

There isn't any need to reset the RTP source - if we're using strictrtp, we'll
simply synchronize to a new source when we stop getting packets from the old
one. If we aren't using strictrtp, then again there shouldn't be a problem.

Note that the Asterisk Test Suite's connectedline test caught this error.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382670 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoChanging log level of "Not changing threadpool size" from notice to debug.
David M. Lee [Thu, 7 Mar 2013 21:55:28 +0000 (21:55 +0000)]
Changing log level of "Not changing threadpool size" from notice to debug.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382648 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoLoad sorcery modules earlier, so they can actually be used.
Jason Parker [Thu, 7 Mar 2013 21:14:18 +0000 (21:14 +0000)]
Load sorcery modules earlier, so they can actually be used.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382636 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoLet vm_mailbox_snapshot combine "Urgent" when no folder is specified
Matthew Jordan [Thu, 7 Mar 2013 19:14:46 +0000 (19:14 +0000)]
Let vm_mailbox_snapshot combine "Urgent" when no folder is specified

r381835 fixed a bug in vm_mailbox_snapshot where combining INBOX and Old forgot
that Urgent also "counts" as new messages. This fixed the problem when any of
the three folders was specified and the combine option was used.

It missed the case where the folder isn't specified and we build a snapshot of
all folders. This patch corrects that.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382621 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a memory leak in xmldoc
Kinsey Moore [Thu, 7 Mar 2013 16:48:19 +0000 (16:48 +0000)]
Fix a memory leak in xmldoc

Another instance of attribute retrieval not being freed properly.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382604 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoResolve more memory leaks in xmldoc
Kinsey Moore [Thu, 7 Mar 2013 16:21:52 +0000 (16:21 +0000)]
Resolve more memory leaks in xmldoc

Many places that allocated to pull out an attribute are now freed
properly.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382600 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd a 'secret' probation strictrtp mode to handle delayed changes in RTP source
Matthew Jordan [Thu, 7 Mar 2013 15:48:06 +0000 (15:48 +0000)]
Add a 'secret' probation strictrtp mode to handle delayed changes in RTP source

Often, Asterisk may realize that a change in the source of an RTP stream is
about to occur and ask that the RTP engine reset it's lock on the current RTP
source. In certain scenarios, it may take awhile for the new remote system to
send RTP packets, while the old remote system may continue providing RTP during
that time period. This causes Asterisk to re-lock onto the old source, thereby
rejecting the new source when the old source stops sending RTP and the new
source begins.

This patch prevents that by having a constant secondary, 'secret' probation
mode enabled when an RTP source has been chosen. RTP packets from other sources
are always considered, but never chosen unless the current RTP source stops
sending RTP.

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

(closes issue AST-1124)
Reported by: John Bigelow
Tested by: John Bigelow

(closes issue AST-1125)
Reported by: John Bigelow
Tested by: John Bigelow
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382589 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix minor memory leak in xmldoc
Kinsey Moore [Thu, 7 Mar 2013 15:36:52 +0000 (15:36 +0000)]
Fix minor memory leak in xmldoc

Strings retrieved via ast_xml_get_text() must be freed with
ast_xml_free_text().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382587 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoEnsure that logmsgs are freed properly
Kinsey Moore [Thu, 7 Mar 2013 15:09:01 +0000 (15:09 +0000)]
Ensure that logmsgs are freed properly

Messages sent while the logger thread is shutting down will now have
their associated callid freed properly.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382575 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix ref leak in threadpool.c
Kinsey Moore [Thu, 7 Mar 2013 00:05:16 +0000 (00:05 +0000)]
Fix ref leak in threadpool.c

If ast_threadpool_set_size with a size equal to the current size, a
reference to a set_size_data structure would be leaked.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382555 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoResolve a ref leak in threadpool.c
Kinsey Moore [Wed, 6 Mar 2013 15:21:42 +0000 (15:21 +0000)]
Resolve a ref leak in threadpool.c

Ownership of the listener reference is not transferred because the
listener is reffed when placed into the taskprocessor. Ensure that the
listener is dereffed properly.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382489 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd RFC 3327 Path header support to chan_sip
Matthew Jordan [Tue, 5 Mar 2013 13:14:43 +0000 (13:14 +0000)]
Add RFC 3327 Path header support to chan_sip

This patch adds support for RFC 3327 "Path" headers. This can be enabled in
sip.conf using the 'supportpath' setting, either on a global basis or on a
peer basis. This setting enables Asterisk to route outgoing out-of-dialog
requests via a set of proxies by using a pre-loaded route-set defined by the
Path headers in the REGISTER request. This patch also adds Realtime support
for dynamically updating the Path information for a peer.

A huge thank-you to Klaus Darillion and Olle E Johansson for their efforts
in writing this patch.

Review: https://reviewboard.asterisk.org/r/2235/
Review: https://reviewboard.asterisk.org/r/991/

(closes issue ASTERISK-16884)
Reported by: klaus3000
Tested by: klaus3000, oej, mjordan
patches:
  path-1.8.0-patch.txt uploaded by klaus3000 (License 5054)
  oolong-path-support-trunk in team branch by oej (License 5267)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382440 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix several unreleased mutex locks that cause problem with processing calls
Igor Goncharovskiy [Tue, 5 Mar 2013 03:53:44 +0000 (03:53 +0000)]
Fix several unreleased mutex locks that cause problem with processing calls
Reported by: Daniel Bohling
Tested by: Daniel Bohling

(Closes issue ASTERISK-21119)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382411 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixup some bridge and format capabilities comments and whitespace.
Richard Mudgett [Mon, 4 Mar 2013 21:15:36 +0000 (21:15 +0000)]
Fixup some bridge and format capabilities comments and whitespace.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382392 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix comparison of presence state in event subsystem.
Jason Parker [Mon, 4 Mar 2013 21:14:30 +0000 (21:14 +0000)]
Fix comparison of presence state in event subsystem.

Several new IEs were not given types (or names), causing the comparison
function to improperly succeed.  This adds those.

(closes issue AST-1128)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382391 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoConfbridge CLI new record file name check.
Kevin Harwell [Mon, 4 Mar 2013 20:18:36 +0000 (20:18 +0000)]
Confbridge CLI new record file name check.

This fix checks to make sure that if a confbridge record start command is issued
from the CLI it will always use the file name given on the CLI even if it
changes between start/stop records for a conference.  Previously it had been
reusing the same file between start/stops even if a new filename was given.

(issue AST-1088)
Reported by: John Bigelow
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382386 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd support for registering a sorcery handler which supports multiple fields using...
Joshua Colp [Fri, 1 Mar 2013 18:01:56 +0000 (18:01 +0000)]
Add support for registering a sorcery handler which supports multiple fields using a regex.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382340 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix / Clean Up Some Items To Handle The New auto_* NAT Options
Michael L. Young [Fri, 1 Mar 2013 04:32:01 +0000 (04:32 +0000)]
Fix / Clean Up Some Items To Handle The New auto_* NAT Options

The original report had to do with a realtime peer behind NAT being pruned and
the peer's private address being used instead of its external address.  Upon
debugging, it was discovered that this was being caused by the addition of
the auto_force_rport and auto_comedia settings.

This patch does the following:

* Adds a missing note to the CHANGES file indicating that the default global nat
  setting is auto_force_rport

* Constify the 'req' parameter for check_via()

* Add calls to check_via() in a couple of places in order for the auto_*
  settings to do their job in attempting to determine if NAT is involved

* Set the flags SIP_NAT_FORCE_RPORT and SIP_PAGE2_SYMMETRICRTP if the auto_*
  settings are in use where it was needed

* Moves the copying of peer flags up in build_peer() to before they are used;
  this fixes the realtime prune issue

* Update the contrib/realtime schemas to allow the nat column to handle the
  different nat setting combinations we have

This patch received a review and "Ship It!" on the issue itself.

(closes issue ASTERISK-20904)
Reported by: JoshE
Tested by: JoshE, Michael L. Young
Patches:
  asterisk-20904-nat-auto-and-rt-peersv2.diff Michael L. Young (license 5026)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382323 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoWhile the ICE negotiation is occurring leave strictrtp in an open state, media can...
Joshua Colp [Thu, 28 Feb 2013 21:59:56 +0000 (21:59 +0000)]
While the ICE negotiation is occurring leave strictrtp in an open state, media can and will come from different places.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382299 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix a bug with ICE and strictrtp where media could get dropped.
Joshua Colp [Thu, 28 Feb 2013 21:37:57 +0000 (21:37 +0000)]
Fix a bug with ICE and strictrtp where media could get dropped.

If the end result of the ICE negotiation resulted in the path for media
changing it was possible for the strictrtp code to discard the RTP packets.
This change causes strictrtp to enter learning mode once again when the
ICE negotiation has completed successfully.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agothreadpool: Make ast_threadpool_push() return -1 if shutting_down
Richard Mudgett [Thu, 28 Feb 2013 21:31:14 +0000 (21:31 +0000)]
threadpool: Make ast_threadpool_push() return -1 if shutting_down

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382295 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agothreadpool: Whitespace and comment corrections.
Richard Mudgett [Thu, 28 Feb 2013 21:29:57 +0000 (21:29 +0000)]
threadpool: Whitespace and comment corrections.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382294 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDon't undefine bzero()/bcopy().
Jason Parker [Thu, 28 Feb 2013 21:21:50 +0000 (21:21 +0000)]
Don't undefine bzero()/bcopy().

This was causing build failures against external libraries that happened to use
them, unless silly hacks were added to the modules that used those headers.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382292 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPrevent deadlock in chan_iax2 when attempting to set caller ID
Matthew Jordan [Thu, 28 Feb 2013 17:17:35 +0000 (17:17 +0000)]
Prevent deadlock in chan_iax2 when attempting to set caller ID

A deadlock can occur in chan_iax2 when it attempts to set the caller ID, as it
already holds the iax2 private lock and improperly fails to obtain the channel
lock before calling ast_set_callerid. By not safely obtaining the channel lock,
a locking inversion can take place, causing a deadlock.

This patch solves this by calling the required deadlock avoidance functions
that obtain the channel lock before setting the caller ID.

Thanks to Pavel for fixing my syntax errors and testing this patch out.

(closes issue ASTERISK-21128)
Reported by: Pavel Troller
Tested by: Pavel Troller
patches:
  ASTERISK-21128-1.8.diff uploaded by mjordan (license 6283)
  ASTERISK-21128-modified-1.8.diff uploaded by Pavel Troller (license 6302)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382236 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoLet channels joining a MeetMe conference opt out of the denoiser
Matthew Jordan [Thu, 28 Feb 2013 16:56:20 +0000 (16:56 +0000)]
Let channels joining a MeetMe conference opt out of the denoiser

For some channel drivers, specifically those that have a varying rate in the
number of audio samples, the audio quality for a MeetMe conference can be
exceedingly poor. This is due to a unilateral application of the DENOISE
function in func_speex to channels joining the conference.

The denoiser function in the speex library is initialized with the number of
audio samples in each sample that will be provided to it. If the number of
audio samples changes, the denoiser has to be thrown away and re-initialized.

While this could be worked around by removing func_speex, that doesn't help
if you actually use the denoiser with other channels on the system.

This patches does the following:
 * Checks for the presence of func_speex as opposed to codec_speex when
   determining if the DENOISE function is present (which is where the function
   is actually implemented)
 * Adds an option to MeetMe 'n' that causes the denoiser to not be applied
   to a channel when it joins. This keeps the current behavior the default, but
   let's users disable the denoiser if it causes problems on their system.

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

(closes issue AST-1062)
Reported by: Thomas Arimont
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382232 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMore places to eliminate the cast to argv but were not giving warnings.
Richard Mudgett [Wed, 27 Feb 2013 20:31:56 +0000 (20:31 +0000)]
More places to eliminate the cast to argv but were not giving warnings.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382204 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix compiler warning by eliminating the need for a cast.
Richard Mudgett [Wed, 27 Feb 2013 20:21:40 +0000 (20:21 +0000)]
Fix compiler warning by eliminating the need for a cast.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382203 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRelax dialog checking in get_sip_pvt_byid_locked so it works when the dialog is forked.
Joshua Colp [Wed, 27 Feb 2013 16:19:51 +0000 (16:19 +0000)]
Relax dialog checking in get_sip_pvt_byid_locked so it works when the dialog is forked.

(closes issue ASTERISK-20638)
Reported by: eelcob
Patches:
      pedantic-call-pickup-from-tag.patch uploaded by eelcob (license 6442)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382182 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoConsider linux-gnuspe as linux-gnu
Tzafrir Cohen [Tue, 26 Feb 2013 20:05:02 +0000 (20:05 +0000)]
Consider linux-gnuspe as linux-gnu

* The powerpcspe Linux port uses linux-gnuspe as the OS string.
* Our build system shouldn't really care for that, so just call it linux-gnu.
* Original report: Roland Stigge , http://bugs.debian.org/701505

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382113 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCorrect RPID parsing for unquoted display-name.
Walter Doekes [Tue, 26 Feb 2013 19:36:30 +0000 (19:36 +0000)]
Correct RPID parsing for unquoted display-name.

Parsing Remote-Party-ID will now succeed if display-name is of the
*(token LWS) kind and not just the quoted-string kind.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382109 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove unneeded linux-gnueabi*
Tzafrir Cohen [Tue, 26 Feb 2013 19:29:14 +0000 (19:29 +0000)]
Remove unneeded linux-gnueabi*

As of r380522 the configure scripts converts the value of linux-gnueabi*
of OSARCH to "linux-gnu". So no point in testing for those values.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382106 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClean up ConfBridge commands to account for wait_marked users
Matthew Jordan [Tue, 26 Feb 2013 15:52:02 +0000 (15:52 +0000)]
Clean up ConfBridge commands to account for wait_marked users

When ConfBridge was refactored to better handle the concept of marked,
wait_marked, and normal users co-existing in a conference (thereby implementing
a state machine for the conference), the wait_marked users were put into their
own list of conference participants, separate from the active users. This list
is used for wait_marked users when they are waiting in a conference but no
marked user has joined; normal users may have joined at this point however.
There are several AMI/CLI commands that affect conference users that were not
checking the wait_marked users list:
* CLI/AMI commands that mute/unmute a participant. In this case, wait_marked
  users have to remain in their particular state and should not be affected -
  however, the commands would return "Channel not found" as opposed to the
  appropriate error condition.
* CLI/AMI commands that kick a participant. An admin should always be able to
  kick a participant out of the conference.

This patch fixes both sets of commands, and cleans up the CLI commands slightly
by allowing them to complete a participant name (this was supposed to have been
added, but the function call was commented out and wasn't implemented).

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

(closes issue AST-1114)
Reported by: John Bigelow
Tested by: John Bigelow
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382070 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoEnsure that the default bridge/user profiles are always available
Matthew Jordan [Tue, 26 Feb 2013 15:26:16 +0000 (15:26 +0000)]
Ensure that the default bridge/user profiles are always available

ConfBridge and Page require that there always be a default bridge and user
profile available. While properties of the default profiles can be overriden
in the configuration file, removing them can create situations where neither
application can function properly.

This patch ensures that if an administrator removes the profiles from the
confbridge.conf configuration file, the profiles are added upon load.
Documentation clarifying this has been added to the confbridge.conf.sample file.

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

(closes issue AST-1115)
Reported by: John Bigelow
Tested by: John Bigelow
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382067 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoClean up use of va_end/va_args in res_config_mysql
Matthew Jordan [Mon, 25 Feb 2013 12:51:24 +0000 (12:51 +0000)]
Clean up use of va_end/va_args in res_config_mysql

There were several problems using variadic argument macros in res_config_mysql.
 * Improper use of va_end. Multiple calls to va_end were possible resulting in
   an unbalanced matching of va_start/va_end.
 * Calls to va_arg after a possible encounter of a SENTINEL value.

This patch corrects those errors.

(closes issue ASTERISK-19451)
Reported by: wdoekes
patches:
  ASTERISK-19451-1.8--2.diff uploaded by wdoekes (License 5674)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382023 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMore called details fixup for skinny.
Damien Wedhorn [Mon, 25 Feb 2013 07:09:37 +0000 (07:09 +0000)]
More called details fixup for skinny.

Basically sets the callerid and callername to the first device talked to for the
purposes of putting the the calls made log on the device. Does not affect the device
displaying who the device is currently talking to.

Also some minor changes to use sub->exten in lieu of l->lastnumberdialed.

(closes issue ASTERISK-21095)
Reported by: wedhorn
Tested by: snuffy, myself
Patches:
    skinny-calllogsoutbound03.diff uploaded by wedhorn (license 5019)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382008 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd prinotify messages to skinny.
Damien Wedhorn [Mon, 25 Feb 2013 06:46:00 +0000 (06:46 +0000)]
Add prinotify messages to skinny.

Adds both fixed and variable prinotify messages and clearprinotify messages to skinny.
Also adds cli function for pushing messages to devices. i

Initial code by snuffy, expanded by myself to include fixed messages.

(closes issue ASTERISK-21091)
Reported by: snuffy
Tested by: snuffy, myself
Patches:
    skinny-prinotify02.diff uploaded by wedhorn (license 5019)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382007 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoSet the sin_family on the bind address socket during initialization
Matthew Jordan [Sun, 24 Feb 2013 23:01:17 +0000 (23:01 +0000)]
Set the sin_family on the bind address socket during initialization

Somehow, chan_jingle has managed to operate for years without setting the
sin_family on its bindaddr socket. This patch properly sets the field during
initial module load to AF_INET.

Note that the patch on the issue was modified slightly to change the
initialization of the socket from allocation of a chan_jingle private to the
module initialization, as the bindaddr object (which is static) only needs to
have the address set once.

(closes issue ASTERISK-19341)
Reported by: andre valentin
patches:
  0105-chan_jingle.patch uploaded by avalentin (License 6064)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381977 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDon't display the AMI ALL class authorization for users if they don't have it
Matthew Jordan [Sun, 24 Feb 2013 16:27:47 +0000 (16:27 +0000)]
Don't display the AMI ALL class authorization for users if they don't have it

When converting AMI class authorizations to a string representation, the
method always appends the ALL class authorization. This is especially
important for events, as they should always communicate that class
authorization - even if the event itself does not specify ALL as a class
authorization for itself. (Events have always assumed that the ALL class
authorization is implied when they are raised)

Unfortunately, this did mean that specifying a user with restricted class
authorizations would show up in the 'manager show user' CLI command as
having the ALL class authorization.

Rather then modifying the existing string manipulation function, this patch
adds a function that will only return a string if the field being compared
explicitly matches class authorization field it is being compared against.
This prevents ALL from being returned unless it is actually specified for
the user.

(closes issue ASTERISK-20397)
Reported by: Johan Wilfer
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381949 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMake ParkAndAnnounce return to priority + 1 when return context is not defined
Matthew Jordan [Sun, 24 Feb 2013 15:45:29 +0000 (15:45 +0000)]
Make ParkAndAnnounce return to priority + 1 when return context is not defined

The ParkAndAnnounce application documentation for the optional return_context
parameter states the following:

return_context
    The goto-style label to jump the call back into after timeout. Default
    'priority+1'.

Unfortunately, the application was sending the channel back into the dialplan
at 'priority', which is the ParkAndAnnounce application call. This causes an
infinite loop of the channel constantly being parked, announced, timed out,
parked, announced, timed out... while fun, especially for those callers you
wish to drive to the end of madness, this was not the intent of the
application.

(closes issue ASTERISK-20113)
Reported by: serginuez
patches:
  app_parkandannounce.diff uploaded by serginuez (License 6405)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381918 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix FastAGI To Properly Check For A Connection
Michael L. Young [Fri, 22 Feb 2013 19:40:02 +0000 (19:40 +0000)]
Fix FastAGI To Properly Check For A Connection

When IPv6 support was added to FastAGI, the intent was to have the ability to
check all addresses resolved for a host since we might receive an IPv4 address
and an IPv6 address.  The problem with the current code, is that, since we are
doing O_NONBLOCK, we get EINPROGRESS when calling ast_connect() but are ignoring
this instead of handling it.  We break out of the loop and continue on.  When we
later call ast_poll(), it succeeds but we never check if we have a connection or
not on the socket level.  We then attempt to send data to the host address that
we think is setup and it fails.  We then check the errno and see that we have
"connection refused" and then return with agi failed.

This patch does the following:

* Handles EINPROGRESS by creating the function handle_connection()
  - ast_poll() was moved into this function
  - This function checks the results of the connection on the socket level after
    calling ast_poll()
* Continues to the next address if the above fails to create a connection
* Once all addresses resolved are tried and we still are unable to establish a
  connection, then we return that the FastAGI call failed

(closes issue ASTERISK-21065)
Reported by: Jeremy Kister
Tested by: Jeremy Kister, Michael L. Young
Patches:
  asterisk-21065_poll_correctly_v4.diff Michael L. Young (license 5026)

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381894 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_dial: Honor the 'c' flag when the calling party hangs up
Jonathan Rose [Fri, 22 Feb 2013 15:51:20 +0000 (15:51 +0000)]
app_dial: Honor the 'c' flag when the calling party hangs up

Apparently this feature became broken in 11, probably as a result
of the Hangup Cause project.

(closes issue ASTERISK-21113)
Reprted by: Heiko Wundram
Patches:
app_dial.patch uploaded by Heiko Wundram (license 5822)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381881 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoProperly detect launchd
Matthew Jordan [Fri, 22 Feb 2013 01:52:14 +0000 (01:52 +0000)]
Properly detect launchd

Asterisk was a little too pro-active in claiming that it found launchd. On
systems without launchd - such as FreeBSD - this resulted in certain items
in Asterisk that conflict with launchd to not be selectable, such as
res_timing_kqueue.

(closes issue ASTERISK-20749)
Reported by: Oleg Baranov
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381869 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoWrite the correct callid to the data1 field in queue_log for transfer events.
Kevin Harwell [Tue, 19 Feb 2013 19:47:42 +0000 (19:47 +0000)]
Write the correct callid to the data1 field in queue_log for transfer events.

The incorrect callid was being written to the "data1" field in queue_log table
for transfer events.  The callid of the queue was being written instead of the
transfer target's callid.  This now gets the correct "transfer to" number and
places that in the "data1" field of the queue_log table when a transfer event
is triggered.

(closes issue ASTERISK-19960)
Reported by: vladimir shmagin
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381792 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd The Status Of A Module To The Output Of "CLI> module show"
Michael L. Young [Tue, 19 Feb 2013 17:17:10 +0000 (17:17 +0000)]
Add The Status Of A Module To The Output Of "CLI> module show"

When a module's configuration is not loadable, we still load the module but it
is not in a running state.  When trying to troubleshoot, let's say, why
chan_motif is ignoring inbound XMPP traffic, there is no way to indicate that a
loaded module is not currently running.

(closes issue ASTERISK-21108)
Reported by: Rusty Newton
Tested by: Michael L. Young
Patches:
  asterisk-21108_add_status-v2.diff Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381749 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoConfbridge channels staying active when all participants leave.
Kevin Harwell [Tue, 19 Feb 2013 16:23:29 +0000 (16:23 +0000)]
Confbridge channels staying active when all participants leave.

If you started/stopped recording of a conference multiple times channels
would remain active even when all participants left the conference.  This
was due to the fact that a reference to the confbridge was being added
every time a start record command was issued, but when the recording was
stopped there was no matching de-reference thus keeping the conference alive.
Made sure only a single reference is added for the record thread no matter how
many times recording is started/stopped.  A de-reference is issued upon thread
ending.

Note, this issue is being fixed under AST-1088 since it relates to it and
should have been corrected along with those modifications.

(issue AST-1088)
Reported by: John Bigelow
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdded Confbridge record_file_append option.
Kevin Harwell [Tue, 19 Feb 2013 15:41:37 +0000 (15:41 +0000)]
Added Confbridge record_file_append option.

Currently, if one starts, stops, and then starts a recording again for a
conference the recorded data is appended to the file originally created
on the first record start.  An option record_file_append has been added
that defaults to "yes", but when set to "no" will force creation of a new
file between every record start/stop.

(issue AST-1088)
Reported by: John Bigelow
Review: http://reviewboard.digium.internal/r/374/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381729 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd serviceURL stuff to skinny.
Damien Wedhorn [Tue, 19 Feb 2013 06:54:23 +0000 (06:54 +0000)]
Add serviceURL stuff to skinny.

Patch adds all the packet and structure stuff to skinny to enable setting
service URLs in skinny, such as corporate directories.

This stuff is only relevant during load/unload as when activated. Also
some minor changes removing duplicated counting of addons and speedials in
handle_skinny_show_devices.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381718 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixup skinny CLI completion.
Damien Wedhorn [Tue, 19 Feb 2013 06:50:57 +0000 (06:50 +0000)]
Fixup skinny CLI completion.

Auto complete for skinny debug allows multiple options and negation, also add
debug all option. Usage example: 'skinny debug all -packets' (each can be
autocompleted including -packet).

Change show device to use device name. Remove the duplicate ast_strdup's from
place calling device complete return immediately from complete devicename and
complete linename so that multiple options are displayed on the CLI if more
than one option available.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381717 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFixed Confbridge file recording deadlock and appending.
Kevin Harwell [Mon, 18 Feb 2013 22:23:52 +0000 (22:23 +0000)]
Fixed Confbridge file recording deadlock and appending.

A deadlock occurred after starting/stopping and then restarting a confbridge
recording.  Upon starting a recording a record thread is created that holds a
lock until just before exiting.  Stopping the recording does not stop/exit the
thread or release the lock.  The thread waits until recording begins again.
Starting a stopped recording signals the thread to continue and start recording
again.  However restarting the recording also created another record thread
resulting in a deadlock.  The fix was to make sure the record thread was only
created once.

Also it was noted that filenames for the recordings were being concatenated for
each start/stop.  This was fixed by creating a new file for each conference
session and appending the actual recorded data within the file (e.g. passing
the 'a' option to MixMonitor).

(issue AST-1088)
Reported by: John Bigelow
Review: http://reviewboard.digium.internal/r/374/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381703 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove "registertrying" and add "rtp_engine" from/to sip.conf.sample
Walter Doekes [Mon, 18 Feb 2013 20:31:56 +0000 (20:31 +0000)]
Remove "registertrying" and add "rtp_engine" from/to sip.conf.sample

The "registertrying" option was removed in r343220. The "rtp_engine"
option was added in r186078 but erroneously named "engine" in the sample.
Note that there is no global sip setting for a different engine.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381670 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPRESENCE_STATE: Provide better documentation for the 'e' option.
Jonathan Rose [Mon, 18 Feb 2013 19:48:47 +0000 (19:48 +0000)]
PRESENCE_STATE: Provide better documentation for the 'e' option.

Notes that the 'e' option actually decodes data when used as a write function
such as with the SET application while it encodes data when used to read.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381656 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoconfbridge: Add flags column to CLI "confbridge list <conference>"
Richard Mudgett [Mon, 18 Feb 2013 19:12:11 +0000 (19:12 +0000)]
confbridge: Add flags column to CLI "confbridge list <conference>"

* Added the following flags to the CLI "confbridge list <conference>" output:
A - The user is an admin
M - The user is a marked user
W - The user must wait for a marked user to join
E - The user will be kicked after the last marked user leaves the conference
w - The user is waiting for a marked user to join

* Added the following header to the AMI ConfbridgeList events:
WaitMarked, EndMarked, and Waiting.

(closes issue AST-1101)
Reported by: John Bigelow
Patches:
      confbridge-show-admin3.txt (license #5091) patch uploaded by John Bigelow
      Modified

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381644 65c4cc65-6c06-0410-ace0-fbb531ad65f3