[svn-commits] qwell: branch qwell/ari_channel_mute r393848 - in /team/qwell/ari_channel_mut...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 8 15:53:34 CDT 2013


Author: qwell
Date: Mon Jul  8 15:53:23 2013
New Revision: 393848

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393848
Log:
Multiple revisions 393704,393716,393729,393740,393749,393757,393768,393777,393785,393793,393801,393804,393806-393807,393815-393816,393831,393833-393834,393843

........
  r393704 | jrose | 2013-07-04 13:46:56 -0500 (Thu, 04 Jul 2013) | 12 lines
  
  res_parking: Replace Parker snapshots with ParkerDialString
  
  This process also involved a large amount of rework regarding how to redial
  the Parker when a channel leaves a parking lot due to timeout. An attended
  transfer channel variable has been added to attended transfers to extensions
  that will eventually park (but haven't at the time of transfer) as well.
  This resolves one of the two BUGBUG comments remaining in res_parking.
  
  (issues ASTERISK-21877)
  Reported by: Matt Jordan
  Review: https://reviewboard.asterisk.org/r/2638/
........
  r393716 | mjordan | 2013-07-04 22:08:58 -0500 (Thu, 04 Jul 2013) | 13 lines
  
  Remove parkinglot from the channel snapshot
  
  Legacy channel drivers often include the ability to set a default parking lot
  on an endpoint basis; when channels are created for that endpoint, they inherit
  the parkinglot option. Parking used to use this option more frequently; while
  it is still supported, other options (such as using channel variables or
  creation of a custom parkinglot) are supported. More importantly, conveying the
  parkinglot information through a channel snapshot isn't terribly useful - it
  is rarely (if ever) changed on a channel and some consumers of channel
  snapshots, such as ARI, will never use the information.
  
  (closes issue ASTERISK-21968)
  Reported by: Matt Jordan
........
  r393729 | rmudgett | 2013-07-05 09:54:27 -0500 (Fri, 05 Jul 2013) | 1 line
  
  OneTouchRecord: Add function defined earlier: ast_bridge_features_do()
........
  r393740 | mjordan | 2013-07-05 12:33:33 -0500 (Fri, 05 Jul 2013) | 44 lines
  
  Refactor RTCP events over to Stasis; associate with channels
  
  This patch does the following:
  
  * It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel
    information in the RTCP events. Because Stasis provides a cache, Jaco's
    patch was modified to pass the channel uniqueid to the RTP layer as
    opposed to a pointer to the channel. This has the following benefits:
    (1) It keeps the RTP engine 'clean' of references back to channels
    (2) It prevents circular dependencies and other potential ref counting issues
  * The RTP engine now allows any RTP implementation to raise RTCP messages.
    Potentially, other implementations (such as res_rtp_multicast) could also
    raise RTCP information. The engine provides structs to represent RTCP headers
    and RTCP SR/RR reports.
  * Some general refactoring in res_rtp_asterisk was done to try and tame the
    RTCP code. It isn't perfect - that's *way* beyond the scope of this work -
    but it does feel marginally better.
  * A few random bugs were fixed in the RTCP statistics. (Example: performing an
    assignment of a = a is probably not correct)
  * We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't
    raise an event when we sent a RR report.
  
  Note that this work will be of use to others who want to monitor call quality
  or build modules that report call quality statistics. Since the events are now
  moving across the Stasis message bus, this is far easier to accomplish. It is
  also a first step (though by no means the last step) towards getting Olle's
  pinefrog work incorporated.
  
  Again: note that the patch by Jaco Kroon was modified slightly for this work;
  however, he did all of the hard work in finding the right places to set the
  channel in the RTP engine across the channel drivers. Much thanks goes to Jaco
  for his hard work here.
  
  Review: https://reviewboard.asterisk.org/r/2603/
  
  (closes issue ASTERISK-20574)
  Reported by: Jaco Kroon
  patches:
    asterisk-rtcp-channel.patch uploaded by jkroon (License 5671)
  
  (closes issue ASTERISK-21471)
  Reported by: Matt Jordan
........
  r393749 | dlee | 2013-07-05 14:15:27 -0500 (Fri, 05 Jul 2013) | 1 line
  
  Document MissingParams error message for /ari/events
........
  r393757 | dlee | 2013-07-05 14:56:50 -0500 (Fri, 05 Jul 2013) | 1 line
  
  Print error details when set nonblock fails
........
  r393768 | dlee | 2013-07-05 17:08:27 -0500 (Fri, 05 Jul 2013) | 1 line
  
  ARI: return a 503 if Asterisk isn't fully booted
........
  r393777 | mjordan | 2013-07-07 15:34:38 -0500 (Sun, 07 Jul 2013) | 21 lines
  
  Handle hangup logic in the Stasis message bus and consumers of Stasis messages
  
  This patch does the following:
  * It adds a new soft hangup flag AST_SOFTHANGUP_HANGUP_EXEC that is set when a
    channel is executing dialplan hangup logic, i.e., the 'h' extension or a
    hangup handler. Stasis messages now also convey the soft hangup flag so
    consumers of the messages can know when a channel is executing said
    hangup logic.
  * It adds a new channel flag, AST_FLAG_DEAD, which is set when a channel is
    well and truly dead. Not just a zombie, but dead, Jim. Manager, CEL, CDRs,
    and other consumers of Stasis have been updated to look for this flag to
    know when the channel should by lying six feet under.
  * The CDR engine has been updated to better handle a channel entering and
    leaving a bridge. Previously, a new CDR was automatically created when a
    channel left a bridge and put into the 'Pending' state; however, this
    way of handling CDRs made it difficult for the 'endbeforehexten' logic to
    work correctly - there was always a new CDR waiting in the hangup logic
    and, even if 'ended', wouldn't be the CDR people wanted to inspect in the
    hangup routine. This patch completely removes the Pending state and instead
    defers creation of the new CDR until it gets a new message that requires
    a new CDR.
........
  r393785 | mjordan | 2013-07-07 16:29:40 -0500 (Sun, 07 Jul 2013) | 11 lines
  
  In a channel destructor dispose of items that raise Stasis message properly
  
  This patch reorders certain actions that may raise Stasis messages in the
  channel destructor such that they occur before the Stasis cache is cleared.
  Once the Stasis cache is cleared, its rather a bad idea to be trying to
  publish information about a channel.
  
  (closes issue ASTERISK-22001)
  Reported by: Jonathan Rose
........
  r393793 | mmichelson | 2013-07-08 08:57:28 -0500 (Mon, 08 Jul 2013) | 8 lines
  
  Fix some broken logic in sending outbound caller ID.
  
  * trust_id_outbound was required even when the caller ID was not marked
  private. This is against intentions and documentation.
  * We now check both name and number privacy instead of checking name privacy
  twice.
........
  r393801 | mjordan | 2013-07-08 09:26:40 -0500 (Mon, 08 Jul 2013) | 21 lines
  
  Create Local channel messages on the Stasis message bus and produce AMI events
  
  This patch does the following:
  
  * It adds a virtual table of callbacks to core_unreal. These callbacks can be
    supplied by concrete implementations of "unreal" channel drivers, which lets
    the unreal channel driver call specific functionality when it performs some
    action. Currently, this is done to notify implementations when an
    optimization operation has begun, and when an optimization operation has
    succeeded.
  
  * It adds Stasis-Core messages for Local channel bridging and Local channel
    optimization. Local channel optimization is now two events: a Begin and an
    End. Some consumers of Stasis-Core may want to know when an operation is
    beginning so that they can 'prepare' their information; others will be more
    concerned about when the operation has completed, so that they can 'fix up'
    information. Stasis-Core allows for both, as does AMI.
  
  Review: https://reviewboard.asterisk.org/r/2552
........
  r393804 | qwell | 2013-07-08 09:42:57 -0500 (Mon, 08 Jul 2013) | 8 lines
  
  Move channel driver Registry manager events to core.
  
  This also shuffles the stasis system topic and related handling.
  
  (closes issue ASTERISK-21488)
  
  Review: https://reviewboard.asterisk.org/r/2631/
........
  r393806 | qwell | 2013-07-08 09:46:20 -0500 (Mon, 08 Jul 2013) | 8 lines
  
  ARI: Add support for getting/setting channel and global variables.
  
  This allows for reading and writing of functions on channels.
  
  (closes issue ASTERISK-21868)
  
  Review: https://reviewboard.asterisk.org/r/2641/
........
  r393807 | file | 2013-07-08 10:11:07 -0500 (Mon, 08 Jul 2013) | 2 lines
  
  Fix building.
........
  r393815 | jrose | 2013-07-08 10:59:47 -0500 (Mon, 08 Jul 2013) | 6 lines
  
  res_parking: Apply ringing role option on swap with a channel that rings
  
  (closes issue ASTERISK-21877)
  Reported by: Matt Jordan
  Review: https://reviewboard.asterisk.org/r/2656/
........
  r393816 | dlee | 2013-07-08 11:04:01 -0500 (Mon, 08 Jul 2013) | 1 line
  
  res_stasis_http doesn't depend on res_stasis any more
........
  r393831 | file | 2013-07-08 14:19:55 -0500 (Mon, 08 Jul 2013) | 6 lines
  
  Refactor operations to access the stasis cache instead of objects directly when retrieving information.
  
  (closes issue ASTERISK-21883)
  
  Review: https://reviewboard.asterisk.org/r/2645/
........
  r393833 | file | 2013-07-08 14:53:13 -0500 (Mon, 08 Jul 2013) | 5 lines
  
  Ensure that a valid bind host is specified for transports.
  
  (closes issue ASTERISK-22017)
  Reported by: Rusty Newton
........
  r393834 | dlee | 2013-07-08 15:07:58 -0500 (Mon, 08 Jul 2013) | 1 line
  
  Better structure for the WebSocket validation failure message
........
  r393843 | dlee | 2013-07-08 15:31:41 -0500 (Mon, 08 Jul 2013) | 1 line
  
  Oh menuconfig, why do you hate margins?
........

Merged revisions 393704,393716,393729,393740,393749,393757,393768,393777,393785,393793,393801,393804,393806-393807,393815-393816,393831,393833-393834,393843 from http://svn.asterisk.org/svn/asterisk/trunk

Added:
    team/qwell/ari_channel_mute/include/asterisk/stasis_system.h
      - copied unchanged from r393843, trunk/include/asterisk/stasis_system.h
    team/qwell/ari_channel_mute/main/manager_system.c
      - copied unchanged from r393843, trunk/main/manager_system.c
    team/qwell/ari_channel_mute/main/stasis_system.c
      - copied unchanged from r393843, trunk/main/stasis_system.c
Modified:
    team/qwell/ari_channel_mute/   (props changed)
    team/qwell/ari_channel_mute/CHANGES
    team/qwell/ari_channel_mute/UPGRADE.txt
    team/qwell/ari_channel_mute/bridges/bridge_builtin_features.c
    team/qwell/ari_channel_mute/build_tools/cflags-devmode.xml
    team/qwell/ari_channel_mute/channels/chan_gtalk.c
    team/qwell/ari_channel_mute/channels/chan_gulp.c
    team/qwell/ari_channel_mute/channels/chan_h323.c
    team/qwell/ari_channel_mute/channels/chan_iax2.c
    team/qwell/ari_channel_mute/channels/chan_jingle.c
    team/qwell/ari_channel_mute/channels/chan_mgcp.c
    team/qwell/ari_channel_mute/channels/chan_motif.c
    team/qwell/ari_channel_mute/channels/chan_multicast_rtp.c
    team/qwell/ari_channel_mute/channels/chan_sip.c
    team/qwell/ari_channel_mute/channels/chan_skinny.c
    team/qwell/ari_channel_mute/channels/chan_unistim.c
    team/qwell/ari_channel_mute/include/asterisk.h
    team/qwell/ari_channel_mute/include/asterisk/bridging.h
    team/qwell/ari_channel_mute/include/asterisk/cdr.h
    team/qwell/ari_channel_mute/include/asterisk/channel.h
    team/qwell/ari_channel_mute/include/asterisk/core_local.h
    team/qwell/ari_channel_mute/include/asterisk/core_unreal.h
    team/qwell/ari_channel_mute/include/asterisk/json.h
    team/qwell/ari_channel_mute/include/asterisk/manager.h
    team/qwell/ari_channel_mute/include/asterisk/parking.h
    team/qwell/ari_channel_mute/include/asterisk/rtp_engine.h
    team/qwell/ari_channel_mute/include/asterisk/stasis_app.h
    team/qwell/ari_channel_mute/include/asterisk/stasis_channels.h
    team/qwell/ari_channel_mute/main/asterisk.c
    team/qwell/ari_channel_mute/main/bridging.c
    team/qwell/ari_channel_mute/main/cdr.c
    team/qwell/ari_channel_mute/main/cel.c
    team/qwell/ari_channel_mute/main/channel.c
    team/qwell/ari_channel_mute/main/channel_internal_api.c
    team/qwell/ari_channel_mute/main/cli.c
    team/qwell/ari_channel_mute/main/core_local.c
    team/qwell/ari_channel_mute/main/core_unreal.c
    team/qwell/ari_channel_mute/main/features.c
    team/qwell/ari_channel_mute/main/file.c
    team/qwell/ari_channel_mute/main/json.c
    team/qwell/ari_channel_mute/main/manager.c
    team/qwell/ari_channel_mute/main/manager_bridging.c
    team/qwell/ari_channel_mute/main/manager_channels.c
    team/qwell/ari_channel_mute/main/parking.c
    team/qwell/ari_channel_mute/main/pbx.c
    team/qwell/ari_channel_mute/main/rtp_engine.c
    team/qwell/ari_channel_mute/main/sounds_index.c
    team/qwell/ari_channel_mute/main/stasis_channels.c
    team/qwell/ari_channel_mute/res/parking/parking_applications.c
    team/qwell/ari_channel_mute/res/parking/parking_bridge.c
    team/qwell/ari_channel_mute/res/parking/parking_bridge_features.c
    team/qwell/ari_channel_mute/res/parking/parking_controller.c
    team/qwell/ari_channel_mute/res/parking/parking_manager.c
    team/qwell/ari_channel_mute/res/parking/parking_ui.c
    team/qwell/ari_channel_mute/res/parking/res_parking.h
    team/qwell/ari_channel_mute/res/res_agi.c
    team/qwell/ari_channel_mute/res/res_rtp_asterisk.c
    team/qwell/ari_channel_mute/res/res_sip/config_transport.c
    team/qwell/ari_channel_mute/res/res_sip_caller_id.c
    team/qwell/ari_channel_mute/res/res_stasis_http.c
    team/qwell/ari_channel_mute/res/res_stasis_http_asterisk.c
    team/qwell/ari_channel_mute/res/res_stasis_http_channels.c
    team/qwell/ari_channel_mute/res/res_stasis_http_events.c
    team/qwell/ari_channel_mute/res/res_stasis_recording.c
    team/qwell/ari_channel_mute/res/res_stun_monitor.c
    team/qwell/ari_channel_mute/res/stasis/control.c
    team/qwell/ari_channel_mute/res/stasis_http/ari_model_validators.c
    team/qwell/ari_channel_mute/res/stasis_http/ari_model_validators.h
    team/qwell/ari_channel_mute/res/stasis_http/ari_websockets.c
    team/qwell/ari_channel_mute/res/stasis_http/resource_asterisk.c
    team/qwell/ari_channel_mute/res/stasis_http/resource_asterisk.h
    team/qwell/ari_channel_mute/res/stasis_http/resource_channels.c
    team/qwell/ari_channel_mute/res/stasis_http/resource_channels.h
    team/qwell/ari_channel_mute/res/stasis_http/resource_events.c
    team/qwell/ari_channel_mute/rest-api/api-docs/asterisk.json
    team/qwell/ari_channel_mute/rest-api/api-docs/channels.json
    team/qwell/ari_channel_mute/rest-api/api-docs/events.json

Propchange: team/qwell/ari_channel_mute/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jul  8 15:53:23 2013
@@ -1,1 +1,1 @@
-/trunk:1-393692
+/trunk:1-393847

Modified: team/qwell/ari_channel_mute/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/CHANGES?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/CHANGES (original)
+++ team/qwell/ari_channel_mute/CHANGES Mon Jul  8 15:53:23 2013
@@ -136,6 +136,10 @@
    feature on the bridge peer in a multi-party bridge will execute it on all
    peers of the activating channel.
 
+ * A channel variable ATTENDEDTRANSFER is now set which indicates which channel
+   was responsible for an attended transfer in a similar fashion to
+   BLINDTRANSFER.
+
 AMI (Asterisk Manager Interface)
 ------------------
  * The SIPshowpeer action will now include a 'SubscribeContext' field for a peer
@@ -176,12 +180,24 @@
 
  * The AMI events 'ParkedCall', 'ParkedCallTimeOut', 'ParkedCallGiveUp', and
    'UnParkedCall' have changed significantly in the new res_parking module.
-   First, channel snapshot data is included for both the parker and the parkee
-   in lieu of the "From" and "Channel" fields. They follow standard channel
-   snapshot format but each field is suffixed with 'Parker' or 'Parkee'
-   depending on which side it applies to. The 'Exten' field is replaced with
-   'ParkingSpace' since the registration of extensions as for parking spaces
-   is no longer mandatory.
+
+   The 'Channel' and 'From' headers are gone. For the channel that was parked
+   or is coming out of parking, a 'Parkee' channel snapshot is issued and it
+   has a number of fields associated with it. The old 'Channel' header relayed
+   the same data as the new 'ParkeeChannel' header.
+
+   The 'From' field was ambiguous and changed meaning depending on the event.
+   for most of these, it was the name of the channel that parked the call
+   (the 'Parker'). There is no longer a header that provides this channel name,
+   however the 'ParkerDialString' will contain a dialstring to redial the
+   device that parked the call.
+
+   On UnParkedCall events, the 'From' header would instead represent the
+   channel responsible for retrieving the parkee. It receives a channel
+   snapshot labeled 'Retriever'. The 'from' field is is replaced with
+   'RetrieverChannel'.
+
+   Lastly, the 'Exten' field has been replaced with 'ParkingSpace'.
 
  * The AMI event 'Parkinglot' (response to 'Parkinglots' command) in a similar
    fashion has changed the field names 'StartExten' and 'StopExten' to
@@ -254,6 +270,17 @@
 
  * AMI events now contain a SystemName field, if available.
 
+ * Local channel optimization is now conveyed in two events:
+   LocalOptimizationBegin and LocalOptimizationEnd. The Begin event is sent
+   when the Local channel driver begins attempting to optimize itself out of
+   the media path; the End event is sent after the channel halves have
+   successfully optimized themselves out of the media path.
+
+ * Local channel information in events is now prefixed with "LocalOne" and
+   "LocalTwo". This replaces the suffix of "1" and "2" for the two halves of
+   the Local channel. This affects the LocalBridge, LocalOptimizationBegin,
+   and LocalOptimizationEnd events.
+
 AGI (Asterisk Gateway Interface)
 ------------------
  * The manager event AGIExec has been split into AGIExecStart and AGIExecEnd.
@@ -270,8 +297,11 @@
  * CDRs will now be created between all participants in a bridge. For each
    pair of channels in a bridge, a CDR is created to represent the path of
    communication between those two endpoints. This lets an end user choose who
-   to bill for what during multi-party bridges or bridge operations during
-   transfer scenarios.
+   to bill for what during bridge operations with multiple parties.
+
+ * The duration, billsec, start, answer, and end times now reflect the times
+   associated with the current CDR for the channel, as opposed to a cumulative
+   measurement of all CDRs for that channel.
 
  * When a CDR is dispatched, user defined CDR variables from both parties are
    included in the resulting CDR. If both parties have the same variable, only

Modified: team/qwell/ari_channel_mute/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/UPGRADE.txt?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/UPGRADE.txt (original)
+++ team/qwell/ari_channel_mute/UPGRADE.txt Mon Jul  8 15:53:23 2013
@@ -75,6 +75,22 @@
    - Channels no longer swap Uniqueid's as a result of the masquerade.
    - Instead of a shell game of renames, there's now a single rename, appending
      <ZOMBIE> to the name of the original channel.
+ - The AMI events 'ParkedCall', 'ParkedCallTimeOut', 'ParkedCallGiveUp', and
+   'UnParkedCall' have changed significantly in the new res_parking module.
+   - The 'Channel' and 'From' headers are gone. For the channel that was parked
+     or is coming out of parking, a 'Parkee' channel snapshot is issued and it
+     has a number of fields associated with it. The old 'Channel' header relayed
+     the same data as the new 'ParkeeChannel' header.
+   - The 'From' field was ambiguous and changed meaning depending on the event.
+     for most of these, it was the name of the channel that parked the call
+     (the 'Parker'). There is no longer a header that provides this channel name,
+     however the 'ParkerDialString' will contain a dialstring to redial the
+     device that parked the call.
+   - On UnParkedCall events, the 'From' header would instead represent the
+     channel responsible for retrieving the parkee. It receives a channel
+     snapshot labeled 'Retriever'. The 'from' field is is replaced with
+     'RetrieverChannel'.
+   - Lastly, the 'Exten' field has been replaced with 'ParkingSpace'.
 
 CEL:
  - The Uniqueid field for a channel is now a stable identifier, and will not

Modified: team/qwell/ari_channel_mute/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/bridges/bridge_builtin_features.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/bridges/bridge_builtin_features.c (original)
+++ team/qwell/ari_channel_mute/bridges/bridge_builtin_features.c Mon Jul  8 15:53:23 2013
@@ -139,6 +139,9 @@
 
 	/* Who is transferring the call. */
 	pbx_builtin_setvar_helper(chan, "TRANSFERERNAME", ast_channel_name(caller));
+
+	/* To work as an analog to BLINDTRANSFER */
+	pbx_builtin_setvar_helper(chan, "ATTENDEDTRANSFER", ast_channel_name(caller));
 
 	/* Before we actually dial out let's inherit appropriate information. */
 	copy_caller_data(chan, caller);

Modified: team/qwell/ari_channel_mute/build_tools/cflags-devmode.xml
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/build_tools/cflags-devmode.xml?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/build_tools/cflags-devmode.xml (original)
+++ team/qwell/ari_channel_mute/build_tools/cflags-devmode.xml Mon Jul  8 15:53:23 2013
@@ -24,9 +24,6 @@
 		<member name="THREAD_CRASH" displayname="Crash on mutex errors">
 			<support_level>extended</support_level>
 		</member>
-		<member name="CHANNEL_TRACE" displayname="Enable CHANNEL(trace) function">
-			<support_level>extended</support_level>
-		</member>
 		<member name="TEST_FRAMEWORK" displayname="Enable Test Framework API">
 			<support_level>extended</support_level>
 		</member>

Modified: team/qwell/ari_channel_mute/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/channels/chan_gtalk.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/channels/chan_gtalk.c (original)
+++ team/qwell/ari_channel_mute/channels/chan_gtalk.c Mon Jul  8 15:53:23 2013
@@ -210,6 +210,7 @@
 static int gtalk_update_externip(void);
 static int gtalk_parser(void *data, ikspak *pak);
 static int gtalk_create_candidates(struct gtalk *client, struct gtalk_pvt *p, char *sid, char *from, char *to);
+static void gtalk_set_owner(struct gtalk_pvt *p, struct ast_channel *chan);
 
 /*! \brief PBX interface structure for channel registration */
 static struct ast_channel_tech gtalk_tech = {
@@ -1007,6 +1008,17 @@
 	return 1;
 }
 
+static void gtalk_set_owner(struct gtalk_pvt *p, struct ast_channel *chan)
+{
+	p->owner = chan;
+	if (p->rtp) {
+		ast_rtp_instance_set_channel_id(p->rtp, chan ? ast_channel_uniqueid(chan) : "");
+	}
+	if (p->vrtp) {
+		ast_rtp_instance_set_channel_id(p->vrtp, chan ? ast_channel_uniqueid(chan) : "");
+	}
+}
+
 static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const char *them, const char *sid)
 {
 	struct gtalk_pvt *tmp = NULL;
@@ -1198,7 +1210,7 @@
 		ast_channel_musicclass_set(tmp, client->musicclass);
 	if (!ast_strlen_zero(client->parkinglot))
 		ast_channel_parkinglot_set(tmp, client->parkinglot);
-	i->owner = tmp;
+	gtalk_set_owner(i, tmp);
 	ast_module_ref(ast_module_info->self);
 	ast_channel_context_set(tmp, client->context);
 	ast_channel_exten_set(tmp, i->exten);
@@ -1712,8 +1724,9 @@
 		ast_mutex_unlock(&p->lock);
 		return -1;
 	}
-	if (p->owner == oldchan)
-		p->owner = newchan;
+	if (p->owner == oldchan) {
+		gtalk_set_owner(p, newchan);
+	}
 	ast_mutex_unlock(&p->lock);
 	return 0;
 }
@@ -1889,7 +1902,7 @@
 
 	ast_mutex_lock(&p->lock);
 	client = p->parent;
-	p->owner = NULL;
+	gtalk_set_owner(p, NULL);
 	ast_channel_tech_pvt_set(ast, NULL);
 	if (!p->alreadygone) {
 		gtalk_action(client, p, "terminate");

Modified: team/qwell/ari_channel_mute/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/channels/chan_gulp.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/channels/chan_gulp.c (original)
+++ team/qwell/ari_channel_mute/channels/chan_gulp.c Mon Jul  8 15:53:23 2013
@@ -429,7 +429,7 @@
 {
 	RAII_VAR(struct ast_datastore *, datastore, NULL, ao2_cleanup);
 
-	if (session->endpoint->direct_media_glare_mitigation == 
+	if (session->endpoint->direct_media_glare_mitigation ==
 			AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_NONE) {
 		return 0;
 	}
@@ -563,6 +563,13 @@
 	pvt->media[SIP_MEDIA_AUDIO] = ao2_find(session->media, "audio", OBJ_KEY);
 	pvt->media[SIP_MEDIA_VIDEO] = ao2_find(session->media, "video", OBJ_KEY);
 	ast_channel_tech_pvt_set(chan, pvt);
+	if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
+		ast_rtp_instance_set_channel_id(pvt->media[SIP_MEDIA_AUDIO]->rtp, ast_channel_uniqueid(chan));
+	}
+	if (pvt->media[SIP_MEDIA_VIDEO] && pvt->media[SIP_MEDIA_VIDEO]->rtp) {
+		ast_rtp_instance_set_channel_id(pvt->media[SIP_MEDIA_VIDEO]->rtp, ast_channel_uniqueid(chan));
+	}
+
 
 	if (ast_format_cap_is_empty(session->req_caps) || !ast_format_cap_has_joint(session->req_caps, session->endpoint->codecs)) {
 		ast_format_cap_copy(ast_channel_nativeformats(chan), session->endpoint->codecs);
@@ -742,8 +749,15 @@
 static int fixup(void *data)
 {
 	struct fixup_data *fix_data = data;
+	struct gulp_pvt *pvt = ast_channel_tech_pvt(fix_data->chan);
 
 	fix_data->session->channel = fix_data->chan;
+	if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
+		ast_rtp_instance_set_channel_id(pvt->media[SIP_MEDIA_AUDIO]->rtp, ast_channel_uniqueid(fix_data->chan));
+	}
+	if (pvt->media[SIP_MEDIA_VIDEO] && pvt->media[SIP_MEDIA_VIDEO]->rtp) {
+		ast_rtp_instance_set_channel_id(pvt->media[SIP_MEDIA_VIDEO]->rtp, ast_channel_uniqueid(fix_data->chan));
+	}
 
 	return 0;
 }
@@ -1434,6 +1448,19 @@
 	return h_data;
 }
 
+/*! \brief Clear a channel from a session along with its PVT */
+static void clear_session_and_channel(struct ast_sip_session *session, struct ast_channel *ast, struct gulp_pvt *pvt)
+{
+	session->channel = NULL;
+	if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
+		ast_rtp_instance_set_channel_id(pvt->media[SIP_MEDIA_AUDIO]->rtp, "");
+	}
+	if (pvt->media[SIP_MEDIA_VIDEO] && pvt->media[SIP_MEDIA_VIDEO]->rtp) {
+		ast_rtp_instance_set_channel_id(pvt->media[SIP_MEDIA_VIDEO]->rtp, "");
+	}
+	ast_channel_tech_pvt_set(ast, NULL);
+}
+
 static int hangup(void *data)
 {
 	pj_status_t status;
@@ -1453,9 +1480,7 @@
 		}
 	}
 
-	session->channel = NULL;
-	ast_channel_tech_pvt_set(ast, NULL);
-
+	clear_session_and_channel(session, ast, pvt);
 	ao2_cleanup(pvt);
 	ao2_cleanup(h_data);
 
@@ -1485,11 +1510,9 @@
 	/* Go ahead and do our cleanup of the session and channel even if we're not going
 	 * to be able to send our SIP request/response
 	 */
+	clear_session_and_channel(session, ast, pvt);
+	ao2_cleanup(pvt);
 	ao2_cleanup(h_data);
-	session->channel = NULL;
-	ast_channel_tech_pvt_set(ast, NULL);
-
-	ao2_cleanup(pvt);
 
 	return -1;
 }
@@ -1859,8 +1882,8 @@
  * Module loading including tests for configuration or dependencies.
  * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE,
  * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails
- * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the 
- * configuration file or other non-critical problem return 
+ * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the
+ * configuration file or other non-critical problem return
  * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
  */
 static int load_module(void)

Modified: team/qwell/ari_channel_mute/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/channels/chan_h323.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/channels/chan_h323.c (original)
+++ team/qwell/ari_channel_mute/channels/chan_h323.c Mon Jul  8 15:53:23 2013
@@ -250,6 +250,8 @@
 static void delete_aliases(void);
 static void prune_peers(void);
 
+static void oh323_set_owner(struct oh323_pvt *pvt, struct ast_channel *c);
+
 static struct ast_channel *oh323_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause);
 static int oh323_digit_begin(struct ast_channel *c, char digit);
 static int oh323_digit_end(struct ast_channel *c, char digit, unsigned int duration);
@@ -719,7 +721,7 @@
 		return 0;
 	}
 
-	pvt->owner = NULL;
+	oh323_set_owner(pvt, NULL);
 	ast_channel_tech_pvt_set(c, NULL);
 
 	if (ast_channel_hangupcause(c)) {
@@ -974,7 +976,7 @@
 		ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, pvt->owner);
 		return -1;
 	}
-	pvt->owner = newchan;
+	oh323_set_owner(p, newchan);
 	ast_mutex_unlock(&pvt->lock);
 	return 0;
 }
@@ -1007,6 +1009,7 @@
 		ast_debug(1, "Created RTP channel\n");
 
 	ast_rtp_instance_set_qos(pvt->rtp, tos, cos, "H323 RTP");
+	ast_rtp_instance_set_channel_id(pvt->rtp, pvt->owner ? ast_channel_uniqueid(pvt->owner), "");
 
 	if (h323debug)
 		ast_debug(1, "Setting NAT on RTP to %d\n", pvt->options.nat);
@@ -1100,7 +1103,7 @@
 		/* Register channel functions. */
 		ast_channel_tech_pvt_set(ch, pvt);
 		/* Set the owner of this channel */
-		pvt->owner = ch;
+		oh323_set_owner(pvt, ch);
 
 		ast_channel_context_set(ch, pvt->context);
 		ast_channel_exten_set(ch, pvt->exten);
@@ -1187,6 +1190,14 @@
 	iflist = pvt;
 	ast_mutex_unlock(&iflock);
 	return pvt;
+}
+
+static void oh323_set_owner(struct oh323_pvt *pvt, struct ast_channel *chan)
+{
+	pvt->owner = chan;
+	if (pvt->rtp) {
+		ast_rtp_instance_set_channel_id(pvt, chan ? ast_channel_uniqueid(chan) : "");
+	}
 }
 
 static struct oh323_pvt *find_call_locked(int call_reference, const char *token)

Modified: team/qwell/ari_channel_mute/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/channels/chan_iax2.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/channels/chan_iax2.c (original)
+++ team/qwell/ari_channel_mute/channels/chan_iax2.c Mon Jul  8 15:53:23 2013
@@ -103,6 +103,8 @@
 #include "asterisk/security_events.h"
 #include "asterisk/stasis_endpoints.h"
 #include "asterisk/bridging.h"
+#include "asterisk/stasis.h"
+#include "asterisk/stasis_system.h"
 
 #include "iax2/include/iax2.h"
 #include "iax2/include/firmware.h"
@@ -8376,6 +8378,11 @@
 	return 0;
 }
 
+static void iax2_publish_registry(const char *username, const char *domain, const char *status, const char *cause)
+{
+	ast_system_publish_registry("IAX2", username, domain, status, cause);
+}
+
 /*! \brief Acknowledgment received for OUR registration */
 static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int callno)
 {
@@ -8437,7 +8444,7 @@
 		}
 		snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(reg->us.sin_addr), ntohs(reg->us.sin_port));
 		ast_verb(3, "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
-		manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(sin->sin_addr));
+		iax2_publish_registry(reg->username, ast_inet_ntoa(sin->sin_addr), "Registered", NULL);
 	}
 	reg->regstate = REG_STATE_REGISTERED;
 	return 0;
@@ -11179,8 +11186,8 @@
 				if (iaxs[fr->callno]->reg) {
 					if (authdebug) {
 						ast_log(LOG_NOTICE, "Registration of '%s' rejected: '%s' from: '%s'\n", iaxs[fr->callno]->reg->username, ies.cause ? ies.cause : "<unknown>", ast_inet_ntoa(sin.sin_addr));
-						manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nUsername: %s\r\nStatus: Rejected\r\nCause: %s\r\n", iaxs[fr->callno]->reg->username, ies.cause ? ies.cause : "<unknown>");
 					}
+					iax2_publish_registry(iaxs[fr->callno]->reg->username, ast_inet_ntoa(sin.sin_addr), "Rejected", S_OR(ies.cause, "<unknown>"));
 					iaxs[fr->callno]->reg->regstate = REG_STATE_REJECTED;
 				}
 				/* Send ack immediately, before we destroy */

Modified: team/qwell/ari_channel_mute/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/channels/chan_jingle.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/channels/chan_jingle.c (original)
+++ team/qwell/ari_channel_mute/channels/chan_jingle.c Mon Jul  8 15:53:23 2013
@@ -196,6 +196,7 @@
 static struct jingle_pvt *jingle_alloc(struct jingle *client, const char *from, const char *sid);
 static char *jingle_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
 static char *jingle_do_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static void jingle_set_owner(struct jingle_pvt *pvt, struct ast_channel *chan);
 
 /*! \brief PBX interface structure for channel registration */
 static struct ast_channel_tech jingle_tech = {
@@ -833,6 +834,17 @@
 	return tmp;
 }
 
+static void jingle_set_owner(struct jingle_pvt *pvt, struct ast_channel *chan)
+{
+	pvt->owner = chan;
+	if (pvt->rtp) {
+		ast_rtp_instance_set_channel_id(pvt->rtp, pvt->owner ? ast_channel_uniqueid(pvt->owner) : "");
+	}
+	if (pvt->vrtp) {
+		ast_rtp_instance_set_channel_id(pvt->vrtp, pvt->owner ? ast_channel_uniqueid(pvt->owner) : "");
+	}
+}
+
 /*! \brief Start new jingle channel */
 static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt *i, int state, const char *title, const char *linkedid)
 {
@@ -908,7 +920,7 @@
 		ast_channel_language_set(tmp, client->language);
 	if (!ast_strlen_zero(client->musicclass))
 		ast_channel_musicclass_set(tmp, client->musicclass);
-	i->owner = tmp;
+	jingle_set_owner(i, tmp);
 	ast_channel_context_set(tmp, client->context);
 	ast_channel_exten_set(tmp, i->exten);
 	/* Don't use ast_set_callerid() here because it will
@@ -1321,8 +1333,9 @@
 		ast_mutex_unlock(&p->lock);
 		return -1;
 	}
-	if (p->owner == oldchan)
-		p->owner = newchan;
+	if (p->owner == oldchan) {
+		jingle_set_owner(p, newchan);
+	}
 	ast_mutex_unlock(&p->lock);
 	return 0;
 }
@@ -1540,7 +1553,7 @@
 
 	ast_mutex_lock(&p->lock);
 	client = p->parent;
-	p->owner = NULL;
+	jingle_set_owner(p, NULL);
 	ast_channel_tech_pvt_set(ast, NULL);
 	if (!p->alreadygone)
 		jingle_action(client, p, JINGLE_TERMINATE);

Modified: team/qwell/ari_channel_mute/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/channels/chan_mgcp.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/channels/chan_mgcp.c (original)
+++ team/qwell/ari_channel_mute/channels/chan_mgcp.c Mon Jul  8 15:53:23 2013
@@ -431,6 +431,7 @@
 
 static struct sockaddr_in bindaddr;
 
+static void mgcp_set_owner(struct mgcp_subchannel *sub, struct ast_channel *chan);
 static struct ast_frame  *mgcp_read(struct ast_channel *ast);
 static int transmit_response(struct mgcp_subchannel *sub, char *msg, struct mgcp_request *req, char *msgrest);
 static int transmit_notify_request(struct mgcp_subchannel *sub, char *tone);
@@ -528,7 +529,7 @@
 	}
 	ast_debug(1, "Released sub %d of channel %s@%s\n", sub->id, p->name, p->parent->name);
 
-	sub->owner = NULL;
+	mgcp_set_owner(sub, NULL);
 	if (!ast_strlen_zero(sub->cxident)) {
 		transmit_connection_del(sub);
 	}
@@ -945,7 +946,7 @@
 		}
 	}
 
-	sub->owner = NULL;
+	mgcp_set_owner(sub, NULL);
 
 	/* for deleting gate */
 	if (p->pktcgatealloc && sub->gate) {
@@ -1225,6 +1226,13 @@
 	return f;
 }
 
+static void mgcp_set_owner(struct mgcp_subchannel *sub, struct ast_channel *chan)
+{
+	sub->owner = chan;
+	if (sub->rtp) {
+		ast_rtp_instance_set_channel_id(sub->rtp, sub->owner ? ast_channel_uniqueid(chan) : "");
+	}
+}
 
 static struct ast_frame *mgcp_read(struct ast_channel *ast)
 {
@@ -1288,7 +1296,7 @@
 		ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, sub->owner);
 		return -1;
 	}
-	sub->owner = newchan;
+	mgcp_set_owner(sub, newchan);
 	ast_mutex_unlock(&sub->lock);
 	return 0;
 }
@@ -1529,7 +1537,7 @@
 			ast_channel_accountcode_set(tmp, i->accountcode);
 		if (i->amaflags)
 			ast_channel_amaflags_set(tmp, i->amaflags);
-		sub->owner = tmp;
+		mgcp_set_owner(sub, tmp);
 		ast_module_ref(ast_module_info->self);
 		ast_channel_callgroup_set(tmp, i->callgroup);
 		ast_channel_pickupgroup_set(tmp, i->pickupgroup);

Modified: team/qwell/ari_channel_mute/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_mute/channels/chan_motif.c?view=diff&rev=393848&r1=393847&r2=393848
==============================================================================
--- team/qwell/ari_channel_mute/channels/chan_motif.c (original)
+++ team/qwell/ari_channel_mute/channels/chan_motif.c Mon Jul  8 15:53:23 2013
@@ -656,6 +656,18 @@
 	.update_peer = jingle_set_rtp_peer,
 };
 
+/*! \brief Set the channel owner on the \ref jingle_session object and related objects */
+static void jingle_set_owner(struct jingle_session *session, struct ast_channel *chan)
+{
+	session->owner = chan;
+	if (session->rtp) {
+		ast_rtp_instance_set_channel_id(session->rtp, session->owner ? ast_channel_uniqueid(session->owner) : "");
+	}
+	if (session->vrtp) {
+		ast_rtp_instance_set_channel_id(session->vrtp, session->owner ? ast_channel_uniqueid(session->owner) : "");
+	}
+}
+
 /*! \brief Internal helper function which enables video support on a sesson if possible */
 static void jingle_enable_video(struct jingle_session *session)
 {
@@ -679,7 +691,7 @@
 	}
 
 	ast_rtp_instance_set_prop(session->vrtp, AST_RTP_PROPERTY_RTCP, 1);
-
+	ast_rtp_instance_set_channel_id(session->vrtp, ast_channel_uniqueid(session->owner));
 	ast_channel_set_fd(session->owner, 2, ast_rtp_instance_fd(session->vrtp, 0));
 	ast_channel_set_fd(session->owner, 3, ast_rtp_instance_fd(session->vrtp, 1));
 	ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(session->vrtp), session->vrtp, &session->prefs);
@@ -775,7 +787,7 @@
 
 	ast_channel_tech_set(chan, &jingle_tech);
 	ast_channel_tech_pvt_set(chan, session);
-	session->owner = chan;
+	jingle_set_owner(session, chan);
 
 	ast_channel_callid_set(chan, session->callid);
 
@@ -1712,7 +1724,7 @@
 
 	ao2_lock(session);
 
-	session->owner = newchan;
+	jingle_set_owner(session, newchan);
 
 	ao2_unlock(session);
 
@@ -1862,7 +1874,7 @@
 	}
 
 	ast_channel_tech_pvt_set(ast, NULL);
-	session->owner = NULL;
+	jingle_set_owner(session, NULL);
 
 	ao2_unlink(session->state->sessions, session);
 	ao2_ref(session->state, -1);


[... 9208 lines stripped ...]



More information about the svn-commits mailing list