[svn-commits] file: branch file/bridge_unreal_optimizer r410828 - in /team/file/bridge_unre...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 18 06:00:14 CDT 2014


Author: file
Date: Tue Mar 18 05:59:57 2014
New Revision: 410828

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410828
Log:
Multiple revisions 410451,410471,410491,410493,410509-410510,410527,410541,410555,410558-410559,410574,410588,410590,410592,410607,410623,410625,410650,410671,410673,410696,410747,410750,410793,410795,410813

........
  r410451 | file | 2014-03-11 13:06:42 -0300 (Tue, 11 Mar 2014) | 35 lines
  
  res_pjsip_multihomed: Add module which places the correct address within messages.
  
  Due to how messages are handled within PJSIP it is not until a message is actually
  sent that the destination is reliably known. This means that the addresses placed
  within the message may not be of the interface the message is being sent out on.
  
  This module determines what interface a message is being sent on and updates the
  message to contain the correct address if applicable.
  
  This module was tested by myself in a virtualized environment with multiple interfaces
  and also by Kinsey Moore in the following configuration:
  
  Networks:
  * 10.24.16.0/21
  ** hard phone
  ** default gateway
  * 10.24.64.0/21
  ** softphone with pjsip-based stack
  
  Transport details:
  bind address: 0.0.0.0
  protocol: UDP
  
  All endpoints were tested with explicitly configured transports and unconfigured transports.
  
  This was tested with inbound and outbound calls, both of which were experiencing detrimental
  effects from incorrect IP addresses in SIP messages. These effects were only experienced by the
  soft phone on the 10.24.64.0 network since the messages to the hard phone on the 10.24.16.0
  network had the correct IP address.
  
  (closes issue ASTERISK-23020)
  Reported by: xrobau
  
  Review: https://reviewboard.asterisk.org/r/3102/
........
  r410471 | file | 2014-03-12 09:50:46 -0300 (Wed, 12 Mar 2014) | 6 lines
  
  res_pjsip_multihomed: Fix a bug where outgoing messages for TCP would go out using UDP.
  
  This change fixes a bug where the code which changes the transport did not check whether
  the message is going out over UDP or not before changing it. For TCP and TLS transports
  we don't need to change the transport as the correct one is already chosen.
........
  r410491 | rmudgett | 2014-03-12 15:45:54 -0300 (Wed, 12 Mar 2014) | 14 lines
  
  app_confbridge: Make explicitly stop MOH if a user is kicked or hangs up while MOH is playing.
  
  When MOH is playing to a user in a conference and the user is kicked or
  hangs up from the conference then the AMI MusicOnHoldStop events didn't
  happen.  (Asterisk v11 AMI event: MusicOnHold, state:Stop)
  
  (closes issue ASTERISK-23311)
  Reported by: Benjamin Keith Ford
  
  Review: https://reviewboard.asterisk.org/r/3306/
  ........
  
  Merged revisions 410490 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r410493 | rmudgett | 2014-03-12 16:05:27 -0300 (Wed, 12 Mar 2014) | 19 lines
  
  res_musiconhold.c: Generate MOH start/stop events whenever the MOH stream is started/stopped.
  
  * Made res_musiconhold.c always post the MusicOnHoldStart/MusicOnHoldStop
  events when it actually starts/stops the music streams.  This allows the
  events to always happen when MOH starts/stops.  The event posting code was
  moved to the MOH alloc/release routines.
  
  * Made channel_do_masquerade() stop any MOH on the original channel before
  masquerading so the original channel will get a stop event with correct
  information.
  
  * Cleaned up a couple odd codings in moh_files_alloc() and moh_alloc()
  dealing with the music state variable.
  
  (issue ASTERISK-23311)
  Reported by: Benjamin Keith Ford
  
  Review: https://reviewboard.asterisk.org/r/3306/
........
  r410509 | file | 2014-03-13 10:23:14 -0300 (Thu, 13 Mar 2014) | 2 lines
  
  res_pjsip_multihomed: Fix a bug where the 200 OK for a REGISTER would contain the wrong contact.
........
  r410510 | file | 2014-03-13 10:24:17 -0300 (Thu, 13 Mar 2014) | 2 lines
  
  res_pjsip_multihomed: Remove change for testing fix.
........
  r410527 | kmoore | 2014-03-13 16:30:06 -0300 (Thu, 13 Mar 2014) | 14 lines
  
  ARI: Ensure managing application receives ChannelEnteredBridge messages
  
  This fixes an issue where a Stasis application running over ARI and
  subscribed to ari/events could miss the ChannelEnteredBridge event
  because it did not subscribe to the new bridge fast enough.
  
  To accomplish this, it subscribes the application controlling the
  channel to the new bridge before adding it to that bridge which
  required the stasis_app_control structure to maintain a reference to
  the stasis_app.
  
  (closes issue ASTERISK-23295)
  Review: https://reviewboard.asterisk.org/r/3336/
........
  r410541 | rmudgett | 2014-03-13 18:25:40 -0300 (Thu, 13 Mar 2014) | 6 lines
  
  cdr.c: Add missing aow_unlock(cdr) in off nominal path of handle_dial_message().
  
  * Trivial common code hoisting in handle_bridge_leave_message().
  
  * Some whitespace fixing.
........
  r410555 | rmudgett | 2014-03-14 12:55:51 -0300 (Fri, 14 Mar 2014) | 7 lines
  
  res_mwi_external: Clear the stasis cache entry when the external MWI is deleted.
  
  One of the things missing when external MWI support was added was the
  ability to clear the stasis cache entry of deleted external MWI mailboxes.
  
  Review: https://reviewboard.asterisk.org/r/3325/
........
  r410558 | jrose | 2014-03-14 13:05:45 -0300 (Fri, 14 Mar 2014) | 6 lines
  
  ARI/bridges: Forward Playback/Recording Started/Finished to bridge topic
  
  (closes issue ASTERISK-23444)
  Reported by: Ben Merrills
  Review: https://reviewboard.asterisk.org/r/3340/
........
  r410559 | mmichelson | 2014-03-14 13:11:42 -0300 (Fri, 14 Mar 2014) | 15 lines
  
  Prevent delayed astdb syncs.
  
  The syncing thread sleeps for a second before waiting to be
  told to attempt to sync again. If a signal were sent during this
  sleeping period, we would end up having to wait until the next
  sync signal occurred in order to sync up the astdb.
  
  This code rearrangement also ensures that any pending transactions
  will be synced prior to Asterisk shutting down.
  
  Patches: db_sync.patch by John Hardin (License #6512)
  ........
  
  Merged revisions 410556 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r410574 | jrose | 2014-03-14 13:26:07 -0300 (Fri, 14 Mar 2014) | 6 lines
  
  PJSIP: TOS values should be represented as decimals in sorcery objects
  
  (closes issue ASTERISK-23235)
  Reported by: George Joseph
  Review: https://reviewboard.asterisk.org/r/3324/
........
  r410588 | sgriepentrog | 2014-03-14 14:56:13 -0300 (Fri, 14 Mar 2014) | 9 lines
  
  uniqueid: Update CHANGES to reflect new features
  
  Note the new features provided by uniqueid in the
  CHANGES file.
  
  (issue ASTERISK-23120)
  Review: https://reviewboard.asterisk.org/r/3316/
........
  r410590 | mmichelson | 2014-03-14 15:00:03 -0300 (Fri, 14 Mar 2014) | 8 lines
  
  Prevent conflicts regarding unsolicited and solicited MWI to an endpoint.
  
  If an endpoint is receiving unsolicited MWI for a mailbox and then attempts
  to subscribe to an AOR that provides MWI for the same mailbox, then the SUBSCRIBE
  is rejected with a 500 response.
  
  Review: https://reviewboard.asterisk.org/r/3345
........
  r410592 | mmichelson | 2014-03-14 15:10:47 -0300 (Fri, 14 Mar 2014) | 16 lines
  
  Handle the return values of realtime updates and stores more accurately.
  
  Realtime backends' update and store callbacks return the number of rows affected,
  or -1 if there was a failure. There were a couple of issues:
  
  * The config API was treating 0 as a successful return, and positive values as
    a failure. Now the config API treats anything >= 0 as a success.
  
  * res_sorcery_realtime was treating 0 as a successful return from the store
    procedure, and any positive values as a failure. Now sorcery treats anything
    > 0 as a success. It still considers 0 a "failure" since there is no change
    to report to observers.
  
  Review: https://reviewboard.asterisk.org/r/3341
........
  r410607 | mmichelson | 2014-03-14 17:53:35 -0300 (Fri, 14 Mar 2014) | 5 lines
  
  Remove an extra ast_cond_wait() that slipped through the patch.
  ........
  
  Merged revisions 410606 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r410623 | jrose | 2014-03-14 18:28:31 -0300 (Fri, 14 Mar 2014) | 10 lines
  
  manager: fix memory leak in manager_add_filter function
  
  (closes issue ASTERISK-23420)
  Reported by: Etienne Lessard
  Patches:
      manager_eventfilter_leak uploaded by Etienne Lessard (license 6394)
  ........
  
  Merged revisions 410609 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r410625 | mmichelson | 2014-03-14 18:55:45 -0300 (Fri, 14 Mar 2014) | 6 lines
  
  Fix failing realtime sorcery tests.
  
  The store realtime callback needs to return a positive value for
  sorcery to treat the store as a success.
........
  r410650 | mjordan | 2014-03-16 17:20:14 -0300 (Sun, 16 Mar 2014) | 14 lines
  
  stasis/app.c: Add some extra debugging for subscription counts
  
  Events are sent to a connected ARI application based on the things that ARI
  application cares about. These subscriptions can be set up implicitly - such
  as when that ARI application creates a new object - or explicitly, via the
  application resource's subscription operations. Debugging *why* something was
  being sent to an application - or why something was not being sent to an
  application - was a bit tricky, as there was no debug information for the
  subscriptions.
  
  This patch adds some debug level 3 statements that show the subscription counts
  for applications. (Level 3 was chosen as it matches the verbose level 3
  statements elsewhere)
........
  r410671 | rmudgett | 2014-03-17 13:42:05 -0300 (Mon, 17 Mar 2014) | 1 line
  
  app_confbridge: Add missing destructor call to announcer channel destructor.
........
  r410673 | mmichelson | 2014-03-17 13:52:12 -0300 (Mon, 17 Mar 2014) | 24 lines
  
  Fix stuck channel in ARI through the introduction of synchronous bridge actions.
  
  Playing back a file to a channel in an ARI bridge would attempt to wait until
  the playback concluded before returning. The method used involved signaling the
  waiting thread in the ARI custom playback function.
  
  The problem with this is that there were some corner cases that were not accounted for:
  * If a bridge channel could not be found, then we never would attempt the playback but
    would still attempt to wait for the playback to complete.
  * If the bridge playfile action failed to queue, we would still attempt to wait for the
    playback to complete.
  * If the bridge playfile action were queued but some circumstance caused the playback
    not to occur (the bridge dies, the channel is removed from the bridge), then we would
    never be notified.
  
  The solution to this is to move the waiting logic into the bridge code. A new bridge
  API function is added to queue a synchronous action on a bridge. The waiting thread
  is notified when the queued frame has been freed, either due to an error occurring
  or due to successful playback. As a failsafe, the waiting thread has a 10 minute
  timeout just in case there is a frame leak somewhere.
  
  Review: https://reviewboard.asterisk.org/r/3338
........
  r410696 | mmichelson | 2014-03-17 15:36:05 -0300 (Mon, 17 Mar 2014) | 7 lines
  
  Revert changes to sorcery that accidentally got committed.
  
  These changes were still up for review and have not been approved
  yet. I must have had the changes in my working copy when making
  a different change.
........
  r410747 | rmeyerriecks | 2014-03-17 18:38:28 -0300 (Mon, 17 Mar 2014) | 18 lines
  
  callerid: Logic error in checksum processing
  
  Callerid checksum-ing was being handled incorrectly here. When the checksum is
  calculated to be 0x00, it will perform 0x100-0x00 which results in 0x100. This
  value will then fail the otherwise correct callerid message.
  
  This patch changes the logic to simply add the calculated checksum to the
  transmitted 2's compliment checksum.  
  
  Review: https://reviewboard.asterisk.org/r/3356/
  (closes issue ASTERISK-23488)
  ........
  
  Merged revisions 410710 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 410717 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r410750 | rmeyerriecks | 2014-03-17 18:56:57 -0300 (Mon, 17 Mar 2014) | 10 lines
  
  !fixup: callerid: Logic error in checksum processing
  
  Fixes syntax error in previous commit :-(
  ........
  
  Merged revisions 410748 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 410749 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r410793 | file | 2014-03-17 19:46:12 -0300 (Mon, 17 Mar 2014) | 9 lines
  
  res_pjsip_multihomed: Make address replacement less aggressive.
  
  This change makes the res_pjsip_multihomed module less aggressive when
  changing the address in messages. It will now only occur if the transport
  in use is bound to the any address OR if the system determined source
  address matches the bound address of the transport in use.
  
  Review: https://reviewboard.asterisk.org/r/3369/
........
  r410795 | file | 2014-03-17 19:53:08 -0300 (Mon, 17 Mar 2014) | 15 lines
  
  res_pjsip: Enable PJSIP DNS client support.
  
  This change enables DNS client support within PJSIP. System
  nameservers are automatically discovered using res_init or
  res_ninit. If this fails then PJSIP will resort to using
  gethostbyname for resolution.
  
  By enabling this support we gain SRV support, failover, and
  weight support.
  
  (closes issue ASTERISK-23435)
  Reported by: Matt Jordan
  
  Review: https://reviewboard.asterisk.org/r/3343/
........
  r410813 | rmudgett | 2014-03-17 23:02:38 -0300 (Mon, 17 Mar 2014) | 1 line
  
  stasis_cache: Use the right variable in the cache entry ao2 cmp function.
........

Merged revisions 410451,410471,410491,410493,410509-410510,410527,410541,410555,410558-410559,410574,410588,410590,410592,410607,410623,410625,410650,410671,410673,410696,410747,410750,410793,410795,410813 from http://svn.asterisk.org/svn/asterisk/branches/12

Added:
    team/file/bridge_unreal_optimizer/res/res_pjsip_multihomed.c
      - copied unchanged from r410813, branches/12/res/res_pjsip_multihomed.c
Modified:
    team/file/bridge_unreal_optimizer/   (props changed)
    team/file/bridge_unreal_optimizer/CHANGES
    team/file/bridge_unreal_optimizer/apps/confbridge/conf_chan_announce.c
    team/file/bridge_unreal_optimizer/apps/confbridge/conf_state.c
    team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_inactive.c
    team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single.c
    team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single_marked.c
    team/file/bridge_unreal_optimizer/bridges/bridge_softmix.c
    team/file/bridge_unreal_optimizer/funcs/func_frame_trace.c
    team/file/bridge_unreal_optimizer/include/asterisk/acl.h
    team/file/bridge_unreal_optimizer/include/asterisk/app.h
    team/file/bridge_unreal_optimizer/include/asterisk/bridge_channel.h
    team/file/bridge_unreal_optimizer/include/asterisk/dns.h
    team/file/bridge_unreal_optimizer/include/asterisk/frame.h
    team/file/bridge_unreal_optimizer/main/acl.c
    team/file/bridge_unreal_optimizer/main/app.c
    team/file/bridge_unreal_optimizer/main/bridge_channel.c
    team/file/bridge_unreal_optimizer/main/callerid.c
    team/file/bridge_unreal_optimizer/main/cdr.c
    team/file/bridge_unreal_optimizer/main/channel.c
    team/file/bridge_unreal_optimizer/main/config.c
    team/file/bridge_unreal_optimizer/main/db.c
    team/file/bridge_unreal_optimizer/main/dns.c
    team/file/bridge_unreal_optimizer/main/frame.c
    team/file/bridge_unreal_optimizer/main/manager.c
    team/file/bridge_unreal_optimizer/main/stasis_cache.c
    team/file/bridge_unreal_optimizer/res/ari/resource_bridges.c
    team/file/bridge_unreal_optimizer/res/res_musiconhold.c
    team/file/bridge_unreal_optimizer/res/res_mwi_external.c
    team/file/bridge_unreal_optimizer/res/res_pjsip.c
    team/file/bridge_unreal_optimizer/res/res_pjsip/config_system.c
    team/file/bridge_unreal_optimizer/res/res_pjsip/config_transport.c
    team/file/bridge_unreal_optimizer/res/res_pjsip/include/res_pjsip_private.h
    team/file/bridge_unreal_optimizer/res/res_pjsip/pjsip_configuration.c
    team/file/bridge_unreal_optimizer/res/res_pjsip_mwi.c
    team/file/bridge_unreal_optimizer/res/res_sorcery_realtime.c
    team/file/bridge_unreal_optimizer/res/res_stasis.c
    team/file/bridge_unreal_optimizer/res/res_stasis_playback.c
    team/file/bridge_unreal_optimizer/res/stasis/app.c
    team/file/bridge_unreal_optimizer/res/stasis/control.c
    team/file/bridge_unreal_optimizer/res/stasis/control.h
    team/file/bridge_unreal_optimizer/tests/test_sorcery_realtime.c

Propchange: team/file/bridge_unreal_optimizer/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/file/bridge_unreal_optimizer/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 18 05:59:57 2014
@@ -1,1 +1,1 @@
-/branches/12:1-410448
+/branches/12:1-410827

Modified: team/file/bridge_unreal_optimizer/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/CHANGES?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/CHANGES (original)
+++ team/file/bridge_unreal_optimizer/CHANGES Tue Mar 18 05:59:57 2014
@@ -22,6 +22,30 @@
  * The live recording object on recording events now contains a target_uri
    field which contains the URI of what is being recorded.
 
+ * A channelId can now be provided when creating a channel, either in the
+   uri (POST channels/my-channel-id) or as query parameter.  A local channel
+   will suffix the second channel id with ';2' unless provided as query
+   parameter otherChannelId.
+
+ * A bridgeId can now be provided when creating a bridge, either in the uri
+   (POST bridges/my-bridge-id) or as a query parameter.
+
+ * A playbackId can be provided when starting a playback, either in the uri
+   (POST channels/my-channel-id/play/my-playback-id) or as a query parameter.
+
+ * A snoop channel can be started with a snoopId, in the uri or query.
+
+AMI
+------------------
+ * Originate now takes optional parameters ChannelId and OtherChannelId,
+   used to set the UniqueId on creation.  The other id is assigned to the
+   second channel when dialing LOCAL, or defaults to appending ;2 if only
+   the single Id is given.
+
+res_pjsip
+------------------
+ * transport and endpoint ToS options (tos, tos_audio, and tos_video) may now
+   be set as the named set of ToS values (cs0-cs7, af11-af43, ef).
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 12.0.0 to Asterisk 12.1.0 ------------
@@ -136,6 +160,13 @@
    and other modules that depend on it cannot be built or loaded with
    app_voicemail present.
 
+res_pjsip
+------------------
+ * DNS functionality will now automatically be enabled if the system configured
+   nameservers can be retrieved. If the system configured nameservers can not be
+   retrieved the functionality will resort to using system resolution. Functionalty
+   such as SRV records and failover will not be available if system resolution
+   is in use.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 11 to Asterisk 12 --------------------

Modified: team/file/bridge_unreal_optimizer/apps/confbridge/conf_chan_announce.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/apps/confbridge/conf_chan_announce.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/apps/confbridge/conf_chan_announce.c (original)
+++ team/file/bridge_unreal_optimizer/apps/confbridge/conf_chan_announce.c Tue Mar 18 05:59:57 2014
@@ -75,6 +75,7 @@
 
 	ao2_cleanup(doomed->bridge);
 	doomed->bridge = NULL;
+	ast_unreal_destructor(&doomed->base);
 }
 
 static struct ast_channel *announce_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)

Modified: team/file/bridge_unreal_optimizer/apps/confbridge/conf_state.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/apps/confbridge/conf_state.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/apps/confbridge/conf_state.c (original)
+++ team/file/bridge_unreal_optimizer/apps/confbridge/conf_state.c Tue Mar 18 05:59:57 2014
@@ -74,6 +74,9 @@
 void conf_default_leave_waitmarked(struct confbridge_user *user)
 {
 	conf_remove_user_waiting(user->conference, user);
+	if (user->playing_moh) {
+		conf_moh_stop(user);
+	}
 }
 
 void conf_change_state(struct confbridge_user *user, struct confbridge_state *newstate)

Modified: team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_inactive.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_inactive.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_inactive.c (original)
+++ team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_inactive.c Tue Mar 18 05:59:57 2014
@@ -66,7 +66,7 @@
 
 static void leave_waitmarked(struct confbridge_user *user)
 {
-	conf_remove_user_waiting(user->conference, user);
+	conf_default_leave_waitmarked(user);
 	if (user->conference->waitingusers == 0) {
 		conf_change_state(user, CONF_STATE_EMPTY);
 	}

Modified: team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single.c (original)
+++ team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single.c Tue Mar 18 05:59:57 2014
@@ -72,6 +72,9 @@
 static void leave_unmarked(struct confbridge_user *user)
 {
 	conf_remove_user_active(user->conference, user);
+	if (user->playing_moh) {
+		conf_moh_stop(user);
+	}
 
 	if (user->conference->waitingusers) {
 		conf_change_state(user, CONF_STATE_INACTIVE);

Modified: team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single_marked.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single_marked.c (original)
+++ team/file/bridge_unreal_optimizer/apps/confbridge/conf_state_single_marked.c Tue Mar 18 05:59:57 2014
@@ -71,6 +71,9 @@
 static void leave_marked(struct confbridge_user *user)
 {
 	conf_remove_user_marked(user->conference, user);
+	if (user->playing_moh) {
+		conf_moh_stop(user);
+	}
 
 	conf_change_state(user, CONF_STATE_EMPTY);
 }

Modified: team/file/bridge_unreal_optimizer/bridges/bridge_softmix.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/bridges/bridge_softmix.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/bridges/bridge_softmix.c (original)
+++ team/file/bridge_unreal_optimizer/bridges/bridge_softmix.c Tue Mar 18 05:59:57 2014
@@ -661,6 +661,9 @@
 	case AST_FRAME_BRIDGE_ACTION:
 		res = ast_bridge_queue_everyone_else(bridge, bridge_channel, frame);
 		break;
+	case AST_FRAME_BRIDGE_ACTION_SYNC:
+		ast_log(LOG_ERROR, "Synchronous bridge action written to a softmix bridge.\n");
+		ast_assert(0);
 	default:
 		ast_debug(3, "Frame type %d unsupported\n", frame->frametype);
 		/* "Accept" the frame and discard it. */

Modified: team/file/bridge_unreal_optimizer/funcs/func_frame_trace.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/funcs/func_frame_trace.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/funcs/func_frame_trace.c (original)
+++ team/file/bridge_unreal_optimizer/funcs/func_frame_trace.c Tue Mar 18 05:59:57 2014
@@ -392,6 +392,10 @@
 		ast_verbose("FrameType: Bridge\n");
 		ast_verbose("SubClass: %d\n", frame->subclass.integer);
 		break;
+	case AST_FRAME_BRIDGE_ACTION_SYNC:
+		ast_verbose("Frametype: Synchronous Bridge\n");
+		ast_verbose("Subclass: %d\n", frame->subclass.integer);
+		break;
 	}
 
 	ast_verbose("Src: %s\n", ast_strlen_zero(frame->src) ? "NOT PRESENT" : frame->src);

Modified: team/file/bridge_unreal_optimizer/include/asterisk/acl.h
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/include/asterisk/acl.h?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/include/asterisk/acl.h (original)
+++ team/file/bridge_unreal_optimizer/include/asterisk/acl.h Tue Mar 18 05:59:57 2014
@@ -358,17 +358,6 @@
 const char *ast_tos2str(unsigned int tos);
 
 /*!
- * \brief Convert a TOS value into its string representation
- *        and create a dynamically allocated copy
- *
- * \param tos The TOS value to look up
- * \param buf pointer to character pointer where string will be duplicated to
- *
- * \note The string allocated at buf must be free'd
- */
-void ast_tos2str_buf(unsigned int tos, char **buf);
-
-/*!
  * \brief Retrieve a named ACL
  *
  * \details

Modified: team/file/bridge_unreal_optimizer/include/asterisk/app.h
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/include/asterisk/app.h?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/include/asterisk/app.h (original)
+++ team/file/bridge_unreal_optimizer/include/asterisk/app.h Tue Mar 18 05:59:57 2014
@@ -1341,13 +1341,14 @@
 /*!
  * \since 12
  * \brief Publish a MWI state update via stasis
- * \param[in] mailbox The number identifying this mailbox
+ *
+ * \param[in] mailbox The mailbox identifier string.
  * \param[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
  * \param[in] new_msgs The number of new messages in this mailbox
  * \param[in] old_msgs The number of old messages in this mailbox
+ *
  * \retval 0 Success
  * \retval -1 Failure
- * \since 12
  */
 #define ast_publish_mwi_state(mailbox, context, new_msgs, old_msgs) \
 	ast_publish_mwi_state_full(mailbox, context, new_msgs, old_msgs, NULL, NULL)
@@ -1355,15 +1356,16 @@
 /*!
  * \since 12
  * \brief Publish a MWI state update associated with some channel
- * \param[in] mailbox The number identifying this mailbox
+ *
+ * \param[in] mailbox The mailbox identifier string.
  * \param[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
  * \param[in] new_msgs The number of new messages in this mailbox
  * \param[in] old_msgs The number of old messages in this mailbox
  * \param[in] channel_id A unique identifier for a channel associated with this
  * change in mailbox state
+ *
  * \retval 0 Success
  * \retval -1 Failure
- * \since 12
  */
 #define ast_publish_mwi_state_channel(mailbox, context, new_msgs, old_msgs, channel_id) \
 	ast_publish_mwi_state_full(mailbox, context, new_msgs, old_msgs, channel_id, NULL)
@@ -1371,23 +1373,51 @@
 /*!
  * \since 12
  * \brief Publish a MWI state update via stasis with all parameters
- * \param[in] mailbox The number identifying this mailbox
+ *
+ * \param[in] mailbox The mailbox identifier string.
  * \param[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
  * \param[in] new_msgs The number of new messages in this mailbox
  * \param[in] old_msgs The number of old messages in this mailbox
  * \param[in] channel_id A unique identifier for a channel associated with this
+ * change in mailbox state
  * \param[in] eid The EID of the server that originally published the message
+ *
  * \retval 0 Success
  * \retval -1 Failure
- * \since 12
  */
 int ast_publish_mwi_state_full(
-			const char *mailbox,
-			const char *context,
-			int new_msgs,
-			int old_msgs,
-			const char *channel_id,
-			struct ast_eid *eid);
+	const char *mailbox,
+	const char *context,
+	int new_msgs,
+	int old_msgs,
+	const char *channel_id,
+	struct ast_eid *eid);
+
+/*!
+ * \since 12.2.0
+ * \brief Delete MWI state cached by stasis
+ *
+ * \param[in] mailbox The mailbox identifier string.
+ * \param[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
+ *
+ * \retval 0 Success
+ * \retval -1 Failure
+ */
+#define ast_delete_mwi_state(mailbox, context) \
+	ast_delete_mwi_state_full(mailbox, context, NULL)
+
+/*!
+ * \since 12.2.0
+ * \brief Delete MWI state cached by stasis with all parameters
+ *
+ * \param[in] mailbox The mailbox identifier string.
+ * \param[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
+ * \param[in] eid The EID of the server that originally published the message
+ *
+ * \retval 0 Success
+ * \retval -1 Failure
+ */
+int ast_delete_mwi_state_full(const char *mailbox, const char *context, struct ast_eid *eid);
 
 /*! \addtogroup StasisTopicsAndMessages
  * @{
@@ -1421,6 +1451,9 @@
  * \since 12
  * \brief Create a \ref ast_mwi_state object
  *
+ * \param[in] mailbox The mailbox identifier string.
+ * \param[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
+ *
  * \retval \ref ast_mwi_state object on success
  * \retval NULL on error
  */

Modified: team/file/bridge_unreal_optimizer/include/asterisk/bridge_channel.h
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/include/asterisk/bridge_channel.h?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/include/asterisk/bridge_channel.h (original)
+++ team/file/bridge_unreal_optimizer/include/asterisk/bridge_channel.h Tue Mar 18 05:59:57 2014
@@ -529,6 +529,28 @@
 int ast_bridge_channel_queue_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class);
 
 /*!
+ * \brief Synchronously queue a bridge action play file frame onto the bridge channel.
+ * \since 12.2.0
+ *
+ * \param bridge_channel Which channel to put the frame onto.
+ * \param custom_play Call this function to play the playfile. (NULL if normal sound file to play)
+ * \param playfile Sound filename to play.
+ * \param moh_class MOH class to request bridge peers to hear while file is played.
+ *     NULL if no MOH.
+ *     Empty if default MOH class.
+ *
+ * This function will block until the queued frame has been destroyed. This will happen
+ * either if an error occurs or if the queued playback finishes.
+ *
+ * \note No locks may be held when calling this function.
+ *
+ * \retval 0 The playback was successfully queued.
+ * \retval -1 The playback could not be queued.
+ */
+int ast_bridge_channel_queue_playfile_sync(struct ast_bridge_channel *bridge_channel,
+		ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class);
+
+/*!
  * \brief Custom callback run on a bridge channel.
  *
  * \param bridge_channel Which channel to operate on.

Modified: team/file/bridge_unreal_optimizer/include/asterisk/dns.h
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/include/asterisk/dns.h?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/include/asterisk/dns.h (original)
+++ team/file/bridge_unreal_optimizer/include/asterisk/dns.h Tue Mar 18 05:59:57 2014
@@ -36,4 +36,7 @@
 int ast_search_dns(void *context, const char *dname, int class, int type,
 	 int (*callback)(void *context, unsigned char *answer, int len, unsigned char *fullanswer));
 
+/*! \brief Retrieve the configured nameservers of the system */
+struct ao2_container *ast_dns_get_nameservers(void);
+
 #endif /* _ASTERISK_DNS_H */

Modified: team/file/bridge_unreal_optimizer/include/asterisk/frame.h
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/include/asterisk/frame.h?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/include/asterisk/frame.h (original)
+++ team/file/bridge_unreal_optimizer/include/asterisk/frame.h Tue Mar 18 05:59:57 2014
@@ -122,6 +122,12 @@
 	AST_FRAME_DTMF_BEGIN,
 	/*! Internal bridge module action. */
 	AST_FRAME_BRIDGE_ACTION,
+	/*! Internal synchronous bridge module action.
+	 * Synchronous bridge actions may be queued onto bridge
+	 * channels, but they absolutely must not ever be written
+	 * directly into bridges.
+	 */
+	AST_FRAME_BRIDGE_ACTION_SYNC,
 };
 #define AST_FRAME_DTMF AST_FRAME_DTMF_END
 

Modified: team/file/bridge_unreal_optimizer/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/main/acl.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/main/acl.c (original)
+++ team/file/bridge_unreal_optimizer/main/acl.c Tue Mar 18 05:59:57 2014
@@ -894,12 +894,6 @@
 	return "unknown";
 }
 
-void ast_tos2str_buf(unsigned int tos, char **buf)
-{
-	const char *tos_string = ast_tos2str(tos);
-	*buf = ast_strdup(tos_string);
-}
-
 int ast_get_ip(struct ast_sockaddr *addr, const char *hostname)
 {
 	return ast_get_ip_or_srv(addr, hostname, NULL);

Modified: team/file/bridge_unreal_optimizer/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/main/app.c?view=diff&rev=410828&r1=410827&r2=410828
==============================================================================
--- team/file/bridge_unreal_optimizer/main/app.c (original)
+++ team/file/bridge_unreal_optimizer/main/app.c Tue Mar 18 05:59:57 2014
@@ -2821,36 +2821,51 @@
 	return mwi_state;
 }
 
-int ast_publish_mwi_state_full(
-			const char *mailbox,
-			const char *context,
-			int new_msgs,
-			int old_msgs,
-			const char *channel_id,
-			struct ast_eid *eid)
-{
-	RAII_VAR(struct ast_mwi_state *, mwi_state, NULL, ao2_cleanup);
-	RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
-	struct stasis_topic *mailbox_specific_topic;
+/*!
+ * \internal
+ * \brief Create a MWI state snapshot message.
+ * \since 12.2.0
+ *
+ * \param[in] mailbox The mailbox identifier string.
+ * \param[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
+ * \param[in] new_msgs The number of new messages in this mailbox
+ * \param[in] old_msgs The number of old messages in this mailbox
+ * \param[in] channel_id A unique identifier for a channel associated with this
+ * change in mailbox state
+ * \param[in] eid The EID of the server that originally published the message
+ *
+ * \retval message on success.  Use ao2_cleanup() when done with it.
+ * \retval NULL on error.
+ */
+static struct stasis_message *mwi_state_create_message(
+	const char *mailbox,
+	const char *context,
+	int new_msgs,
+	int old_msgs,
+	const char *channel_id,
+	struct ast_eid *eid)
+{
+	struct ast_mwi_state *mwi_state;
+	struct stasis_message *message;
 
 	mwi_state = ast_mwi_create(mailbox, context);
 	if (!mwi_state) {
-		return -1;
+		return NULL;
 	}
 
 	mwi_state->new_msgs = new_msgs;
 	mwi_state->old_msgs = old_msgs;
 
 	if (!ast_strlen_zero(channel_id)) {
-		RAII_VAR(struct stasis_message *, chan_message,
-			stasis_cache_get(ast_channel_cache(),
-					ast_channel_snapshot_type(),
-					channel_id),
-			ao2_cleanup);
+		struct stasis_message *chan_message;
+
+		chan_message = stasis_cache_get(ast_channel_cache(), ast_channel_snapshot_type(),
+			channel_id);
 		if (chan_message) {
 			mwi_state->snapshot = stasis_message_data(chan_message);
 			ao2_ref(mwi_state->snapshot, +1);
 		}
+		ao2_cleanup(chan_message);
 	}
 
 	if (eid) {
@@ -2860,16 +2875,34 @@
 	}
 
 	/*
-	 * As far as stasis is concerned, all MWI events are internal.
+	 * XXX As far as stasis is concerned, all MWI events are local.
 	 *
-	 * We may in the future want to make MWI aggregate internal/external
+	 * We may in the future want to make MWI aggregate local/remote
 	 * message counts similar to how device state aggregates state.
 	 */
 	message = stasis_message_create_full(ast_mwi_state_type(), mwi_state, &ast_eid_default);
+	ao2_cleanup(mwi_state);
+	return message;
+}
+
+int ast_publish_mwi_state_full(
+	const char *mailbox,
+	const char *context,
+	int new_msgs,
+	int old_msgs,
+	const char *channel_id,
+	struct ast_eid *eid)
+{
+	struct ast_mwi_state *mwi_state;
+	RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
+	struct stasis_topic *mailbox_specific_topic;
+
+	message = mwi_state_create_message(mailbox, context, new_msgs, old_msgs, channel_id, eid);
 	if (!message) {
 		return -1;
 	}
 
+	mwi_state = stasis_message_data(message);
 	mailbox_specific_topic = ast_mwi_topic(mwi_state->uniqueid);
 	if (!mailbox_specific_topic) {
 		return -1;
@@ -2877,6 +2910,54 @@
 
 	stasis_publish(mailbox_specific_topic, message);
 
+	return 0;
+}
+
+int ast_delete_mwi_state_full(const char *mailbox, const char *context, struct ast_eid *eid)
+{
+	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
+	struct stasis_message *cached_msg;
+	struct stasis_message *clear_msg;
+	struct ast_mwi_state *mwi_state;
+	struct stasis_topic *mailbox_specific_topic;
+
+	msg = mwi_state_create_message(mailbox, context, 0, 0, NULL, eid);
+	if (!msg) {
+		return -1;
+	}
+
+	mwi_state = stasis_message_data(msg);
+
+	/*
+	 * XXX As far as stasis is concerned, all MWI events are local.
+	 *
+	 * For now, it is assumed that there is only one entity
+	 * maintaining the state of a particular mailbox.
+	 *
+	 * If we ever have multiple MWI event entities maintaining
+	 * the same mailbox that wish to delete their cached entry
+	 * we will need to do something about the race condition
+	 * potential between checking the cache and removing the
+	 * cache entry.
+	 */
+	cached_msg = stasis_cache_get_by_eid(ast_mwi_state_cache(),
+		ast_mwi_state_type(), mwi_state->uniqueid, &ast_eid_default);
+	if (!cached_msg) {
+		/* Nothing to clear */
+		return -1;
+	}
+	ao2_cleanup(cached_msg);
+
+	mailbox_specific_topic = ast_mwi_topic(mwi_state->uniqueid);
+	if (!mailbox_specific_topic) {
+		return -1;
+	}
+
+	clear_msg = stasis_cache_clear_create(msg);
+	if (clear_msg) {
+		stasis_publish(mailbox_specific_topic, clear_msg);
+	}
+	ao2_cleanup(clear_msg);
 	return 0;
 }
 

Modified: team/file/bridge_unreal_optimizer/main/bridge_channel.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal_optimizer/main/bridge_channel.c?view=diff&rev=410828&r1=410827&r2=410828

[... 1851 lines stripped ...]



More information about the svn-commits mailing list