[asterisk-commits] may: branch may/ooh323_qsig r397706 - in /team/may/ooh323_qsig: ./ apps/ apps...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 27 10:18:44 CDT 2013


Author: may
Date: Tue Aug 27 10:18:39 2013
New Revision: 397706

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397706
Log:
Multiple revisions 394103,394147,394156,394158,394189,394203,394216,394232,394249,394263,394278,394290,394304-394305,394346,394370,394397,394402,394417,394442,394469-394471,394473,394489,394513,394530-394531,394552,394567,394583,394600

........
  r394103 | file | 2013-07-11 20:23:41 +0400 (Thu, 11 Jul 2013) | 2 lines
  
  Tweak the subscription failure warning message to include endpoint name and context.
........
  r394147 | wedhorn | 2013-07-12 00:17:53 +0400 (Fri, 12 Jul 2013) | 16 lines
  
  Refactor and cleanup of skinny session handling.
  
  Major changes are to pull all packet reading functions into skinny_session 
  and move timeout handling to scheduling arrangements. Thread cancelling is 
  now undertaken directly rather than waiting for the read to timeout 
  (cleanup is popped on thread cancel). Also added some keepalive timings in 
  debugging messages.
  
  Keepalive timeout has been increased from 1.1 by keepalive to 3 times 
  keepalive. This seems to align (after keepalives stabilise) with when 
  devices reset after not receiving keepalives. Probably needs more work, 
  especially around the first and/or second keepalives that vary 
  significantly by device and firmware version.
  
  Review: https://reviewboard.asterisk.org/r/2611/
........
  r394156 | dlee | 2013-07-12 00:59:10 +0400 (Fri, 12 Jul 2013) | 4 lines
  
  Fixed chan_skinny for systems were pthread_t isn't an int.
  
  I'm looking at you, OS X.
........
  r394158 | rmudgett | 2013-07-12 01:01:09 +0400 (Fri, 12 Jul 2013) | 1 line
  
  Fix bridge tech write callback parameter name.
........
  r394189 | qwell | 2013-07-12 21:52:52 +0400 (Fri, 12 Jul 2013) | 8 lines
  
  ARI: Add support for Cross-Origin Resource Sharing (CORS), origin headers
  
  This rejects requests from any unknown origins.
  
  (closes issue ASTERISK-21278)
  
  Review: https://reviewboard.asterisk.org/r/2667/
........
  r394203 | dlee | 2013-07-12 22:23:39 +0400 (Fri, 12 Jul 2013) | 18 lines
  
  Fixed intermittent crash when loading test_json.so
  
  The JSON test attempted an overly clever use of RAII_VAR to run code
  at the beginning and end of each test, in order to validate that no
  JSON objects were leaked during the test.
  
  The problem is that the validation code would run during the initial
  load, when the tests were initialized. This happens during startup,
  when other parts of the system might actively be allocating and
  freeing JSON objects.
  
  This patch changes the RAII_VAR to use the new
  ast_test_register_{init,cleanup} functions to run the validations
  properly.
  
  (closes issue ASTERISK-21978)
  Review: https://reviewboard.asterisk.org/r/2669/
........
  r394216 | qwell | 2013-07-12 23:35:08 +0400 (Fri, 12 Jul 2013) | 2 lines
  
  Fix a compiler warning.
........
  r394232 | mmichelson | 2013-07-13 01:01:51 +0400 (Sat, 13 Jul 2013) | 11 lines
  
  Prevent potential race condition in multiparty basic bridges.
  
  For more details about the race condition see the linked review
  at the bottom of this commit
  
  (closes issue ASTERISK-21882)
  Reported by Matt Jordan
  
  Review: https://reviewboard.asterisk.org/r/2663
........
  r394249 | file | 2013-07-13 01:42:53 +0400 (Sat, 13 Jul 2013) | 6 lines
  
  Add support to the bridging core for performing COLP updates when channels join a 2 party bridge.
  
  (closes issue ASTERISK-21829)
  
  Review: https://reviewboard.asterisk.org/r/2636/
........
  r394263 | moy | 2013-07-13 02:35:50 +0400 (Sat, 13 Jul 2013) | 21 lines
  
  Fix a longstanding issue with MFC-R2 configuration that prevented users
  from mixing different variants or general MFC-R2 settings within the same E1 line.
  
  Most users do not have a problem with this since MFC-R2 lines are usually fractional E1s, or
  the whole E1 has the same country variant and R2 settings.
  
  In Venezuela however is common to have inbound MFC-R2 and outbound DTMF-R2 within the same E1.
  
  This fix now properly parses the chan_dahdi.conf file to generate a new openr2 context every
  time a new channel => section is found and the configuration was changed.
  
  (closes issue ASTERISK-21117)
  Reported by: Rafael Angulo
  Related Elastix issue: http://bugs.elastix.org/view.php?id=1612
  ........
  
  Merged revisions 394106 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 394173 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r394278 | mjordan | 2013-07-14 02:14:04 +0400 (Sun, 14 Jul 2013) | 5 lines
  
  Pretty up a debug message if the referred-by-uri isn't available
  
  Instead of formatting a NULL pointer into a "%s" format string (which is
  usually not a good thing to do), we instead print "Unknown".
........
  r394290 | mjordan | 2013-07-14 03:28:23 +0400 (Sun, 14 Jul 2013) | 27 lines
  
  Fix FRACK message from external redirects; handle outbound channels better
  
  This patch does the following:
   * It simplifies the Dial handling in CDRs. As a rule, the caller in a dial
     relationship is always the Party A. There was some logic present in the
     handling of the dial message that could, conceivably, pick the caller
     as Party A for the beginning of the dial and the peer as Party A for the
     end of the dial. This shouldn't have happened if the code in the bridging
     framework was doing its job; however, that was broken and it led to the
     FRACK. As it is, this code was overly ocmplex and not needed: the caller,
     if present, should always be Party A. Period.
   * It properly checks to see if a channel will continue on in the dialplan.
     ast_check_hangup - much like cake at the end - is a lie. It will tell
     you that you are hungup when you are not. Do not believe it.
  
     I would make this function tell the truth, but I'm nervous that we've been
     depending on it sitting on its throne of lies for far too long, and it would
     probably break lots of things. So I'm just checking the "internal" soft
     hangup flags, like everyone else.
  
  (closes issue ASTERISK-22060)
  Reported by: Mark Michelson
  
  (issue ASTERISK-21831)
  Reported by: Matt Jordan
........
  r394304 | mjordan | 2013-07-14 06:00:02 +0400 (Sun, 14 Jul 2013) | 19 lines
  
  Clarify documentation for function PASSTHRU
  
  It is not apparent to the average user that the PASSTHRU function should not
  be passed as ${PASSTHRU(string)} but just as PASSTHRU(string) to functions
  which take a variable name and not its contents.
  
  This patch clarifies the behavior in the documentation and provides an example.
  
  (closes issue ASTERISK-21717)
  Reported by: Richard Miller
  patches:
    func_strings.diff uploaded by Richard Miller (license 5685)
  ........
  
  Merged revisions 394302 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 394303 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r394305 | mjordan | 2013-07-14 06:05:04 +0400 (Sun, 14 Jul 2013) | 11 lines
  
  Remove redundant code in dns.c
  
  Peter J Philipp pointed out that there are two checks that ensure that len is
  not less than 0. If len is less than 0, the function returns. Having both of
  them is clearly redundant.
  
  This removes the second and attempts to clarify (slightly) the error condition.
  
  (closes issue ASTERISK-21772)
  Reported by: Peter J Philipp
........
  r394346 | mjordan | 2013-07-14 06:41:43 +0400 (Sun, 14 Jul 2013) | 13 lines
  
  Provide error message for QUEUE_MEMBER when member is not in queue
  
  When QUEUE_MEMBER is used and the member specified is not in the queue,
  Asterisk provides an ERROR message that indicates that the option specified
  is not valid. This patch now properly displays an ERROR message that the
  member is not in the queue if an interface is specified.
  
  (closes issue ASTERISK-21980)
  Reported by: Avraam David
  ........
  
  Merged revisions 394345 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r394370 | file | 2013-07-15 17:43:37 +0400 (Mon, 15 Jul 2013) | 2 lines
  
  Remove some callbacks and functions which are not needed.
........
  r394397 | dlee | 2013-07-16 01:22:12 +0400 (Tue, 16 Jul 2013) | 1 line
  
  Document the ari.conf allowed_origins setting
........
  r394402 | mmichelson | 2013-07-16 02:05:57 +0400 (Tue, 16 Jul 2013) | 3 lines
  
  Remove misleading documentation for channel snapshot creation.
........
  r394417 | rmudgett | 2013-07-16 03:20:55 +0400 (Tue, 16 Jul 2013) | 60 lines
  
  Replace chan_agent with app_agent_pool.
  
  The ill conceived chan_agent is no more.  It is now replaced by
  app_agent_pool.
  
  Agents login using the AgentLogin() application as before.  The
  AgentLogin() application no longer does any authentication.
  Authentication is now the responsibility of the dialplan.  (Besides, the
  authentication done by chan_agent did not match what the voice prompts
  asked for.)
  
  Sample extensions.conf
  [login]
  ; Sample agent 1001 login
  ; Set COLP for in between calls so the agent does not see the last caller COLP.
  exten => 1001,1,Set(CONNECTEDLINE(all)="Agent Waiting" <1001>)
  ; Give the agent DTMF transfer and disconnect features when connected to a caller.
  same => n,Set(CHANNEL(dtmf-features)=TX)
  same => n,AgentLogin(1001)
  same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS})
  same => n,Hangup()
  
  [caller]
  ; Sample caller direct connect to agent 1001
  exten => 800,1,AgentRequest(1001)
  same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS})
  same => n,Hangup()
  
  ; Sample caller going through a Queue to agent 1001
  exten => 900,1,Queue(agent_q)
  same => n,Hangup()
  
  Sample queues.conf
  [agent_q]
  member => Local/800 at caller,,SuperAgent,Agent:1001
  
  Under the hood operation overview:
  1) Logged in agents wait for callers in an agents holding bridge.
  2) Caller requests an agent using AgentRequest()
  3) A basic bridge is created, the agent is notified, and caller joins the
     basic bridge to wait for the agent.
  4) The agent is either automatically connected to the caller or must ack
     the call to connect.
  5) The agent is moved from the agents holding bridge to the basic bridge.
  6) The agent and caller talk.
  7) The connection is ended by either party.
  8) The agent goes back to the agents holding bridge.
  
  To avoid some locking issues with the agent holding bridge, I needed to
  make some changes to the after bridge callback support.  The after bridge
  callback is now a list of requested callbacks with the last to be added
  the only active callback.  The after bridge callback for failed callbacks
  will always happen in the channel thread when the channel leaves the
  bridging system or is destroyed.
  
  (closes issue ASTERISK-21554)
  Reported by: Matt Jordan
  
  Review: https://reviewboard.asterisk.org/r/2657/
........
  r394442 | dlee | 2013-07-16 19:30:09 +0400 (Tue, 16 Jul 2013) | 1 line
  
  Fixed null dereference when WebSocket protocol is omitted
........
  r394469 | mjordan | 2013-07-16 22:22:07 +0400 (Tue, 16 Jul 2013) | 9 lines
  
  Re-order cleanup
  
  This patch attempts to fix some possible race conditions in shutdown of the
  CDR engine. It:
  * Adds a cleanup handler to only unsubscribe and join on stasis messages during
    graceful shutdown. The cleanup handler should execute before the regular atexit
    handler, as we want to unsubscribe for any further messages before dispatching
    the CDRs.
  * The CDRs are now locked when we dispatch them on shutdown.
........
  r394470 | rmudgett | 2013-07-16 22:48:49 +0400 (Tue, 16 Jul 2013) | 1 line
  
  Simplify bridge_simple chan join code.
........
  r394471 | rmudgett | 2013-07-16 22:49:26 +0400 (Tue, 16 Jul 2013) | 1 line
  
  Remove some dead code dealing with old bridging method.
........
  r394473 | mmichelson | 2013-07-16 23:13:04 +0400 (Tue, 16 Jul 2013) | 9 lines
  
  Prevent crash from trying to end a session in an invalid way.
  
  This ensures that code that was only meant to be run on a reinvite failure
  only runs on a reinvite failure.
  
  (closes issue ASTERISK-22061)
  reported by Rusty Newton
........
  r394489 | rmudgett | 2013-07-17 00:00:25 +0400 (Wed, 17 Jul 2013) | 1 line
  
  chan_gulp: Fix gulp_indicate() handling of AST_CONTROL_PVT_CAUSE_CODE.
........
  r394513 | dlee | 2013-07-17 01:44:12 +0400 (Wed, 17 Jul 2013) | 1 line
  
  Debug logging to help with WebSocket connection problems
........
  r394530 | mjordan | 2013-07-17 02:25:33 +0400 (Wed, 17 Jul 2013) | 7 lines
  
  Re-order handlers in CEL to ensure that HANGUP events happen after APP_END
  
  When a channel is hungup, both an APP_END event and a HANGUP event can be
  fired. To ensure that HANGUP events occur after APP_END events, the method
  callbacks for the APP_END event should be processed prior to the callbacks
  for the HANGUP event.
........
  r394531 | mjordan | 2013-07-17 02:33:27 +0400 (Wed, 17 Jul 2013) | 13 lines
  
  Add 'kick all' capability to ConfBridge CLI command
  
  This patch adds the ability to kick all users out of a conference from the
  ConfBridge kick CLI command. It is invoked by passing 'all' as the channel
  parameter to the CLI command, i.e., "confbridge kick <conf> all".
  
  Note that this patch was modified slightly to conform to trunk.
  
  (closes issue ASTERISK-21827)
  Reported by: dorianlogan
  patches:
    kickall-patch_v2.diff uploaded by dorianlogan (License 6504)
........
  r394552 | tzafrir | 2013-07-17 20:56:14 +0400 (Wed, 17 Jul 2013) | 20 lines
  
  handle DAHDI_EVENT_REMOVED on a pri D-Channel
  
  When a DAHDI device is removed at run-time it sends the event
  DAHDI_EVENT_REMOVED on each channel. This is intended to signal the
  userspace program to close the respective file handle, as the driver of
  the device will need all of them closed to properly clean-up.
  
  This event has long since been handled in chan_dahdi (chan_zap at the
  time). However the event that is sent on a D-Channel of a "PRI" (ISDN)
  span simply gets ignored.
  
  This commit adds handling for closing the file descriptor (and shutting
  down the span, while we're at it).
  
  It also adds a CLI command 'pri destroy span <N>' to destroy the span
  and its DAHDI channels.
  
  Review: https://reviewboard.asterisk.org/r/726/
........
  r394567 | tzafrir | 2013-07-17 21:49:54 +0400 (Wed, 17 Jul 2013) | 2 lines
  
  Left over spacing issues of review 726.
........
  r394583 | jrose | 2013-07-17 22:26:19 +0400 (Wed, 17 Jul 2013) | 2 lines
  
  app_confbridge: Eliminate a reference leak for confbridge announcer channels
........
  r394600 | rmudgett | 2013-07-17 23:27:26 +0400 (Wed, 17 Jul 2013) | 1 line
  
  Remove some completed and no longer relevant BUGBUG notes.
........

Merged revisions 394103,394147,394156,394158,394189,394203,394216,394232,394249,394263,394278,394290,394304-394305,394346,394370,394397,394402,394417,394442,394469-394471,394473,394489,394513,394530-394531,394552,394567,394583,394600 from http://svn.asterisk.org/svn/asterisk/trunk

Added:
    team/may/ooh323_qsig/apps/app_agent_pool.c
      - copied unchanged from r394600, trunk/apps/app_agent_pool.c
Removed:
    team/may/ooh323_qsig/channels/chan_agent.c
Modified:
    team/may/ooh323_qsig/   (props changed)
    team/may/ooh323_qsig/CHANGES
    team/may/ooh323_qsig/UPGRADE.txt
    team/may/ooh323_qsig/apps/app_confbridge.c
    team/may/ooh323_qsig/apps/app_queue.c
    team/may/ooh323_qsig/apps/confbridge/conf_chan_announce.c
    team/may/ooh323_qsig/bridges/bridge_simple.c
    team/may/ooh323_qsig/channels/chan_dahdi.c
    team/may/ooh323_qsig/channels/chan_gulp.c
    team/may/ooh323_qsig/channels/chan_sip.c
    team/may/ooh323_qsig/channels/chan_skinny.c
    team/may/ooh323_qsig/configs/agents.conf.sample
    team/may/ooh323_qsig/configs/queues.conf.sample
    team/may/ooh323_qsig/funcs/func_strings.c
    team/may/ooh323_qsig/include/asterisk/bridging.h
    team/may/ooh323_qsig/include/asterisk/bridging_technology.h
    team/may/ooh323_qsig/include/asterisk/channel.h
    team/may/ooh323_qsig/include/asterisk/config_options.h
    team/may/ooh323_qsig/include/asterisk/res_sip_session.h
    team/may/ooh323_qsig/include/asterisk/stasis_channels.h
    team/may/ooh323_qsig/main/bridging.c
    team/may/ooh323_qsig/main/bridging_basic.c
    team/may/ooh323_qsig/main/cdr.c
    team/may/ooh323_qsig/main/cel.c
    team/may/ooh323_qsig/main/channel.c
    team/may/ooh323_qsig/main/channel_internal_api.c
    team/may/ooh323_qsig/main/dns.c
    team/may/ooh323_qsig/main/features.c
    team/may/ooh323_qsig/main/stasis_channels.c
    team/may/ooh323_qsig/res/res_http_websocket.c
    team/may/ooh323_qsig/res/res_sip_exten_state.c
    team/may/ooh323_qsig/res/res_sip_session.c
    team/may/ooh323_qsig/res/res_stasis_http.c
    team/may/ooh323_qsig/res/stasis_http/ari_websockets.c
    team/may/ooh323_qsig/res/stasis_http/cli.c
    team/may/ooh323_qsig/res/stasis_http/config.c
    team/may/ooh323_qsig/res/stasis_http/internal.h
    team/may/ooh323_qsig/tests/test_json.c

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug 27 10:18:39 2013
@@ -1,1 +1,1 @@
-/trunk:1-380157,380165-391000,391012,391016-393400,393410-393530,393542-393834,393843-394050,394065-394089
+/trunk:1-380157,380165-391000,391012,391016-393400,393410-393530,393542-393834,393843-394050,394065-394089,394103-394600

Modified: team/may/ooh323_qsig/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/CHANGES?view=diff&rev=397706&r1=397705&r2=397706
==============================================================================
--- team/may/ooh323_qsig/CHANGES (original)
+++ team/may/ooh323_qsig/CHANGES Tue Aug 27 10:18:39 2013
@@ -14,10 +14,23 @@
 Applications
 ------------------
 
+AgentLogin
+------------------
+ * The application no longer does agent authentication.  The dialplan needs to
+   perform this function before running AgentLogin.  If the agent is already
+   logged in, dialplan will continue with the AGENT_STATUS channel variable
+   set to ALREADY_LOGGED_IN.
+
 AgentMonitorOutgoing
 ------------------
- * The 'c' option has been removed. It is not possible to modify the name of a
-   channel involved in a CDR.
+ * Application removed.  It was a holdover from when AgentCallbackLogin was
+   removed.
+
+ConfBridge
+------------------
+ * All participants in a bridge can now be kicked out of a conference room
+   by specifying the channel parameter as 'all' in the ConfBridge kick CLI
+   command, i.e., "confbridge kick <conference> all"
 
 ForkCDR
 ------------------
@@ -260,8 +273,8 @@
    of "CallerID" and "ConnectedID" to avoid confusion with similarly named
    parameters in the channel snapshot.
 
- * The "Agentlogin" and "Agentlogoff" events have been renamed "AgentLogin" and
-   "AgentLogoff" respectively.
+ * The AMI events "Agentlogin" and "Agentlogoff" have been renamed
+   "AgentLogin" and "AgentLogoff" respectively.
 
  * The "Channel" key used in the "AlarmClear", "Alarm", and "DNDState" has been
    renamed "DAHDIChannel" since it does not convey an Asterisk channel name.
@@ -453,6 +466,21 @@
    and pretending otherwise helps no one.
  * The AGENTUPDATECDR channel variable has also been removed, for the same
    reason as the updatecdr option.
+ * The driver is no longer a Data retrieval API data provider for the
+   AMI DataGet action.
+ * The endcall and enddtmf configuration options are removed.  Use the
+   dialplan function CHANNEL(dtmf-features) to set DTMF features on the agent
+   channel before calling AgentLogin.
+ * chan_agent is removed and replaced with AgentLogin and AgentRequest dialplan
+   applications.  Agents are connected with callers using the new AgentRequest
+   dialplan application.  The Agents:<agent-id> device state is available to
+   monitor the status of an agent.  See agents.conf.sample for valid
+   configuration options.
+
+chan_bridge
+------------------
+ * chan_bridge is removed and its functionality is incorporated into ConfBridge
+   itself.
 
 chan_local
 ------------------

Modified: team/may/ooh323_qsig/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/UPGRADE.txt?view=diff&rev=397706&r1=397705&r2=397706
==============================================================================
--- team/may/ooh323_qsig/UPGRADE.txt (original)
+++ team/may/ooh323_qsig/UPGRADE.txt Tue Aug 27 10:18:39 2013
@@ -22,8 +22,8 @@
 ===========================================================
 
 AgentMonitorOutgoing
- - The 'c' option has been removed. It is not possible to modify the name of a
-   channel involved in a CDR.
+ - Application removed.  It was a holdover from when AgentCallbackLogin was
+   removed.
 
 NoCDR:
  - This application is deprecated. Please use the CDR_PROP function instead.
@@ -140,6 +140,15 @@
    and pretending otherwise helps no one.
  - The AGENTUPDATECDR channel variable has also been removed, for the same
    reason as the updatecdr option.
+ - chan_agent is removed and replaced with AgentLogin and AgentRequest dialplan
+   applications.  Agents are connected with callers using the new AgentRequest
+   dialplan application.  The Agents:<agent-id> device state is available to
+   monitor the status of an agent.  See agents.conf.sample for valid
+   configuration options.
+
+chan_bridge
+ - chan_bridge is removed and its functionality is incorporated into ConfBridge
+   itself.
 
 chan_dahdi:
  - Analog port dialing and deferred DTMF dialing for PRI now distinguishes

Modified: team/may/ooh323_qsig/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_confbridge.c?view=diff&rev=397706&r1=397705&r2=397706
==============================================================================
--- team/may/ooh323_qsig/apps/app_confbridge.c (original)
+++ team/may/ooh323_qsig/apps/app_confbridge.c Tue Aug 27 10:18:39 2013
@@ -2069,6 +2069,7 @@
 
 static int kick_conference_participant(struct confbridge_conference *conference, const char *channel)
 {
+	int res = -1;
 	struct confbridge_user *user = NULL;
 
 	SCOPED_AO2LOCK(bridge_lock, conference);
@@ -2077,6 +2078,10 @@
 			user->kicked = 1;
 			ast_bridge_remove(conference->bridge, user->chan);
 			return 0;
+		} else if (!strcasecmp("all", channel)) {
+			user->kicked = 1;
+			ast_bridge_remove(conference->bridge, user->chan);
+			res = 0;
 		}
 	}
 	AST_LIST_TRAVERSE(&conference->waiting_list, user, list) {
@@ -2084,10 +2089,14 @@
 			user->kicked = 1;
 			ast_bridge_remove(conference->bridge, user->chan);
 			return 0;
-		}
-	}
-
-	return -1;
+		} else if (!strcasecmp("all", channel)) {
+			user->kicked = 1;
+			ast_bridge_remove(conference->bridge, user->chan);
+			res = 0;
+		}
+	}
+
+	return res;
 }
 
 static char *complete_confbridge_name(const char *line, const char *word, int pos, int state)

Modified: team/may/ooh323_qsig/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_queue.c?view=diff&rev=397706&r1=397705&r2=397706
==============================================================================
--- team/may/ooh323_qsig/apps/app_queue.c (original)
+++ team/may/ooh323_qsig/apps/app_queue.c Tue Aug 27 10:18:39 2013
@@ -413,7 +413,7 @@
 	</application>
 	<application name="UnpauseQueueMember" language="en_US">
 		<synopsis>
-			Unpauses a queue member.		
+			Unpauses a queue member.
 		</synopsis>
 		<syntax>
 			<parameter name="queuename" />
@@ -1358,8 +1358,8 @@
  *  q_next links ALL defined callattempt structures into a linked list. call_next is
  *  a link which allows for a subset of the callattempts to be traversed. This subset
  *  is used in wait_for_answer so that irrelevant callattempts are not traversed. This
- *  also is helpful so that queue logs are always accurate in the case where a call to 
- *  a member times out, especially if using the ringall strategy. 
+ *  also is helpful so that queue logs are always accurate in the case where a call to
+ *  a member times out, especially if using the ringall strategy.
 */
 
 struct callattempt {
@@ -1565,7 +1565,7 @@
 	int rrpos;                          /*!< Round Robin - position */
 	int memberdelay;                    /*!< Seconds to delay connecting member to caller */
 	int autofill;                       /*!< Ignore the head call status and ring an available agent */
-	
+
 	struct ao2_container *members;             /*!< Head of the list of members */
 	struct queue_ent *head;             /*!< Head of the list of callers */
 	AST_LIST_ENTRY(call_queue) list;    /*!< Next call queue */
@@ -1780,7 +1780,7 @@
 
 		ao2_unlock(q);
 
-		pbx_builtin_setvar_multiple(chan, interfacevar); 
+		pbx_builtin_setvar_multiple(chan, interfacevar);
 	} else {
 		ao2_unlock(q);
 	}
@@ -2304,7 +2304,7 @@
 		return 0;
 	} else if (c > 96) {
 		return c - 64;
-	} 
+	}
 	return c - 32;
 }
 
@@ -2466,7 +2466,7 @@
 	}
 
 	contentdup = ast_strdupa(content);
-	
+
 	if (!(maxstr = strchr(contentdup, ','))) {
 		ast_log(LOG_WARNING, "Improperly formatted penaltychange rule at line %d. Ignoring.\n", linenum);
 		ast_free(rule);
@@ -2487,7 +2487,7 @@
 	if ((minstr = strchr(maxstr,','))) {
 		*minstr++ = '\0';
 	}
-	
+
 	/* The last check will evaluate true if either no penalty change is indicated for a given rule
 	 * OR if a min penalty change is indicated but no max penalty change is */
 	if (*maxstr == '+' || *maxstr == '-' || *maxstr == '\0') {
@@ -2519,7 +2519,7 @@
 			}
 		}
 		AST_LIST_TRAVERSE_SAFE_END;
-	
+
 		if (!inserted) {
 			AST_LIST_INSERT_TAIL(&rl_iter->rules, rule, list);
 			inserted = 1;
@@ -2572,7 +2572,7 @@
 }
 
 /*! \brief Configure a queue parameter.
- * 
+ *
  * The failunknown flag is set for config files (and static realtime) to show
  * errors for unknown parameters. It is cleared for dynamic realtime to allow
  *  extra fields in the tables.
@@ -2581,7 +2581,7 @@
 */
 static void queue_set_param(struct call_queue *q, const char *param, const char *val, int linenum, int failunknown)
 {
-	if (!strcasecmp(param, "musicclass") || 
+	if (!strcasecmp(param, "musicclass") ||
 		!strcasecmp(param, "music") || !strcasecmp(param, "musiconhold")) {
 		ast_string_field_set(q, moh, val);
 	} else if (!strcasecmp(param, "announce")) {
@@ -2980,7 +2980,7 @@
 				ao2_unlock(q);
 				queue_t_unref(q, "Queue is dead; can't return it");
 				return NULL;
-			} 
+			}
 			ast_log(LOG_WARNING, "Static queue '%s' already exists. Not loading from realtime\n", q->name);
 			ao2_unlock(q);
 			return q;
@@ -3555,7 +3555,7 @@
 }
 
 /*! \brief Caller leaving queue.
- * 
+ *
  * Search the queue to find the leaving client, if found remove from queue
  * create manager event, move others up the queue.
 */
@@ -3866,11 +3866,11 @@
 	return 1;
 }
 
-/*! 
+/*!
  * \brief Part 2 of ring_one
  *
- * Does error checking before attempting to request a channel and call a member. 
- * This function is only called from ring_one(). 
+ * Does error checking before attempting to request a channel and call a member.
+ * This function is only called from ring_one().
  * Failure can occur if:
  * - Agent on call
  * - Agent is paused
@@ -3941,7 +3941,7 @@
 		} else if (!ast_strlen_zero(ast_channel_dialed(qe->chan)->number.str)) {
 			ast_set_callerid(tmp->chan, ast_channel_dialed(qe->chan)->number.str, NULL, NULL);
 		} else if (!ast_strlen_zero(S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)))) {
-			ast_set_callerid(tmp->chan, S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)), NULL, NULL); 
+			ast_set_callerid(tmp->chan, S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)), NULL, NULL);
 		}
 		tmp->dial_callerid_absent = 1;
 	}
@@ -4017,7 +4017,7 @@
 	return best;
 }
 
-/*! 
+/*!
  * \brief Place a call to a queue member.
  *
  * Once metrics have been calculated for each member, this function is used
@@ -4051,7 +4051,7 @@
 			ast_debug(1, "Trying '%s' with metric %d\n", best->interface, best->metric);
 			ret = ring_entry(qe, best, busies);
 		}
-		
+
 		/* If we have timed out, break out */
 		if (qe->expire && (time(NULL) >= qe->expire)) {
 			ast_debug(1, "Queue timed out while ringing members.\n");
@@ -4133,14 +4133,14 @@
 	}
 
 	ast_verb(3, "Playing periodic announcement\n");
-	
+
 	if (qe->parent->randomperiodicannounce && qe->parent->numperiodicannounce) {
 		qe->last_periodic_announce_sound = ((unsigned long) ast_random()) % qe->parent->numperiodicannounce;
-	} else if (qe->last_periodic_announce_sound >= qe->parent->numperiodicannounce || 
+	} else if (qe->last_periodic_announce_sound >= qe->parent->numperiodicannounce ||
 		ast_str_strlen(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]) == 0) {
 		qe->last_periodic_announce_sound = 0;
 	}
-	
+
 	/* play the announcement */
 	res = play_file(qe->chan, ast_str_buffer(qe->parent->sound_periodicannounce[qe->last_periodic_announce_sound]));
 
@@ -4785,7 +4785,7 @@
  	if (qe->parent->periodicannouncefrequency && qe->parent->announce_to_first_user) {
  		say_periodic_announcement(qe, ringing);
  	}
- 
+
 	if (!*to) {
 		for (o = start; o; o = o->call_next) {
 			rna(orig, qe, o->chan, o->interface, o->member->membername, 1);
@@ -4805,7 +4805,7 @@
 	return peer;
 }
 
-/*! 
+/*!
  * \brief Check if we should start attempting to call queue members.
  *
  * A simple process, really. Count the number of members who are available
@@ -4835,11 +4835,11 @@
 		if (!ch->pending) {
 			idx++;
 		}
-		ch = ch->next;			
+		ch = ch->next;
 	}
 
 	ao2_unlock(qe->parent);
-	/* If the queue entry is within avl [the number of available members] calls from the top ... 
+	/* If the queue entry is within avl [the number of available members] calls from the top ...
 	 * Autofill and position check added to support autofill=no (as only calls
 	 * from the front of the queue are valid when autofill is disabled)
 	 */
@@ -4864,7 +4864,7 @@
 {
 	int max_penalty = qe->pr->max_relative ? qe->max_penalty + qe->pr->max_value : qe->pr->max_value;
 	int min_penalty = qe->pr->min_relative ? qe->min_penalty + qe->pr->min_value : qe->pr->min_value;
-	char max_penalty_str[20], min_penalty_str[20]; 
+	char max_penalty_str[20], min_penalty_str[20];
 	/* a relative change to the penalty could put it below 0 */
 	if (max_penalty < 0) {
 		max_penalty = 0;
@@ -4939,7 +4939,7 @@
 		if (qe->parent->periodicannouncefrequency &&
 			(res = say_periodic_announcement(qe,ringing)))
 			break;
-		
+
 		/* see if we need to move to the next penalty level for this queue */
 		while (qe->pr && ((time(NULL) - qe->start) >= qe->pr->time)) {
 			update_qe_rule(qe);
@@ -4950,7 +4950,7 @@
 			*reason = QUEUE_TIMEOUT;
 			break;
 		}
-		
+
 		/* Wait a second before checking again */
 		if ((res = ast_waitfordigit(qe->chan, RECHECK * 1000))) {
 			if (res > 0 && !valid_exit(qe, res)) {
@@ -4959,7 +4959,7 @@
 				break;
 			}
 		}
-		
+
 		/* If we have timed out, break out */
 		if (qe->expire && (time(NULL) >= qe->expire)) {
 			*reason = QUEUE_TIMEOUT;
@@ -5003,7 +5003,7 @@
 		member->calls++;
 		member->lastqueue = q;
 		ao2_unlock(q);
-	}	
+	}
 	ao2_lock(q);
 	q->callscompleted++;
 	if (callcompletedinsl) {
@@ -5187,7 +5187,7 @@
 				(long) (time(NULL) - callstart), qe->opos);
 
 	update_queue(qe->parent, member, callcompletedinsl, (time(NULL) - callstart));
-	
+
 	/* No need to lock the channels because they are already locked in ast_do_masquerade */
 	if ((datastore = ast_channel_datastore_find(old_chan, &queue_transfer_info, NULL))) {
 		ast_channel_datastore_remove(old_chan, datastore);
@@ -5320,7 +5320,7 @@
  * \param[in] qe the queue_ent structure which corresponds to the caller attempting to reach members
  * \param[in] opts the options passed as the third parameter to the Queue() application
  * \param[in] opt_args the options passed as the third parameter to the Queue() application
- * \param[in] announceoverride filename to play to user when waiting 
+ * \param[in] announceoverride filename to play to user when waiting
  * \param[in] url the url passed as the fourth parameter to the Queue() application
  * \param[in,out] tries the number of times we have tried calling queue members
  * \param[out] noption set if the call to Queue() has the 'n' option set.
@@ -5423,7 +5423,7 @@
 		ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_PARKCALL);
 	}
 	if (ast_test_flag(&opts, OPT_NO_RETRY)) {
-		if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_LINEAR 
+		if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_LINEAR
 			|| qe->parent->strategy == QUEUE_STRATEGY_RRORDERED) {
 			(*tries)++;
 		} else {
@@ -5504,7 +5504,7 @@
 		AST_LIST_LOCK(dialed_interfaces);
 		AST_LIST_TRAVERSE(dialed_interfaces, di, list) {
 			if (!strcasecmp(cur->interface, di->interface)) {
-				ast_debug(1, "Skipping dialing interface '%s' since it has already been dialed\n", 
+				ast_debug(1, "Skipping dialing interface '%s' since it has already been dialed\n",
 					di->interface);
 				break;
 			}
@@ -5559,7 +5559,7 @@
 			   XXX If we're forcibly removed, these outgoing calls won't get
 			   hung up XXX */
 			tmp->q_next = outgoing;
-			outgoing = tmp;		
+			outgoing = tmp;
 			/* If this line is up, don't try anybody else */
 			if (outgoing->chan && (ast_channel_state(outgoing->chan) == AST_STATE_UP))
 				break;
@@ -5748,7 +5748,7 @@
 		 	pbx_builtin_setvar_multiple(qe->chan, interfacevar);
 			pbx_builtin_setvar_multiple(peer, interfacevar);
 		}
-		
+
 		/* if setqueueentryvar is defined, make queue entry (i.e. the caller) variables available to the channel */
 		/* use  pbx_builtin_setvar to set a load of variables with one call */
 		if (qe->parent->setqueueentryvar) {
@@ -5757,7 +5757,7 @@
 			pbx_builtin_setvar_multiple(qe->chan, interfacevar);
 			pbx_builtin_setvar_multiple(peer, interfacevar);
 		}
-	
+
 		ao2_unlock(qe->parent);
 
 		/* try to set queue variables if configured to do so*/
@@ -5798,7 +5798,7 @@
 				}
 			} else {
 				mixmonapp = pbx_findapp("MixMonitor");
-				
+
 				if (mixmonapp) {
 					ast_debug(1, "Starting MixMonitor as requested.\n");
 					if (!monitorfilename) {
@@ -5865,7 +5865,7 @@
 
 						pbx_substitute_variables_helper(qe->chan, meid2, meid, sizeof(meid) - 1);
 					}
-	
+
 					snprintf(tmpid2, sizeof(tmpid2), "%s.%s", tmpid, qe->parent->monfmt);
 
 					if (!ast_strlen_zero(monitor_exec)) {
@@ -5873,7 +5873,7 @@
 					} else {
 						snprintf(mixmonargs, sizeof(mixmonargs), "%s,b%s", tmpid2, monitor_options);
 					}
-					
+
 					ast_debug(1, "Arguments being passed to MixMonitor: %s\n", mixmonargs);
 					/* BUGBUG
 					 * This needs to be done differently. We need to start a MixMonitor on
@@ -5890,12 +5890,12 @@
 			}
 		}
 		/* Drop out of the queue at this point, to prepare for next caller */
-		leave_queue(qe);			
+		leave_queue(qe);
 		if (!ast_strlen_zero(url) && ast_channel_supports_html(peer)) {
 			ast_debug(1, "app_queue: sendurl=%s.\n", url);
 			ast_channel_sendurl(peer, url);
 		}
-		
+
 		/* run a macro for this connection if defined. The macro simply returns, no action is taken on the result */
 		/* use macro from dialplan if passed as a option, otherwise use the default queue macro */
 		if (!ast_strlen_zero(macro)) {
@@ -6026,7 +6026,7 @@
 					(long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
 				send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
 			}
-			if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {	
+			if ((tds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL))) {
 				ast_channel_datastore_remove(qe->chan, tds);
 			}
 			ast_channel_unlock(qe->chan);
@@ -6139,7 +6139,7 @@
 	ast_free(value);
 }
 
-/*! \brief Remove member from queue 
+/*! \brief Remove member from queue
  * \retval RES_NOT_DYNAMIC when they aren't a RT member
  * \retval RES_NOSUCHQUEUE queue does not exist
  * \retval RES_OKAY removed member from queue
@@ -6191,7 +6191,7 @@
 	return res;
 }
 
-/*! \brief Add member to queue 
+/*! \brief Add member to queue
  * \retval RES_NOT_DYNAMIC when they aren't a RT member
  * \retval RES_NOSUCHQUEUE queue does not exist
  * \retval RES_OKAY added member from queue
@@ -6575,7 +6575,7 @@
 				ast_log(LOG_WARNING, "Error converting penalty: %s: Out of range.\n", penalty_tok);
 				break;
 			}
-			
+
 			if (!paused_tok) {
 				ast_log(LOG_WARNING, "Error parsing persistent member string for '%s' (paused)\n", queue_name);
 				break;
@@ -6587,7 +6587,7 @@
 			}
 
 			ast_debug(1, "Reload Members: Queue: %s  Member: %s  Name: %s  Penalty: %d  Paused: %d\n", queue_name, interface, membername, penalty, paused);
-			
+
 			if (add_to_queue(queue_name, interface, membername, penalty, paused, 0, state_interface) == RES_OUTOFMEMORY) {
 				ast_log(LOG_ERROR, "Out of Memory when reloading persistent queue member\n");
 				break;
@@ -6842,7 +6842,7 @@
 		return -1;
 	}
 
-	ast_queue_log(args.queuename, args.uniqueid, args.membername, args.event, 
+	ast_queue_log(args.queuename, args.uniqueid, args.membername, args.event,
 		"%s", args.params ? args.params : "");
 
 	return 0;
@@ -6880,14 +6880,14 @@
 
 /*!\brief The starting point for all queue calls
  *
- * The process involved here is to 
+ * The process involved here is to
  * 1. Parse the options specified in the call to Queue()
  * 2. Join the queue
  * 3. Wait in a loop until it is our turn to try calling a queue member
  * 4. Attempt to call a queue member
  * 5. If 4. did not result in a bridged call, then check for between
  *    call options such as periodic announcements etc.
- * 6. Try 4 again unless some condition (such as an expiration time) causes us to 
+ * 6. Try 4 again unless some condition (such as an expiration time) causes us to
  *    exit the queue.
  */
 static int queue_exec(struct ast_channel *chan, const char *data)
@@ -7072,7 +7072,7 @@
 			record_abandoned(&qe);
 			reason = QUEUE_TIMEOUT;
 			res = 0;
-			ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", 
+			ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld",
 				qe.pos, qe.opos, (long) time(NULL) - qe.start);
 			break;
 		}
@@ -7091,7 +7091,7 @@
 				goto stop;
 			}
 		}
-	
+
 		/* Leave if we have exceeded our queuetimeout */
 		if (qe.expire && (time(NULL) >= qe.expire)) {
 			record_abandoned(&qe);
@@ -7133,7 +7133,7 @@
 			break;
 		}
 
-		
+
 		/* Leave if we have exceeded our queuetimeout */
 		if (qe.expire && (time(NULL) >= qe.expire)) {
 			record_abandoned(&qe);
@@ -7182,12 +7182,12 @@
 
 	/* Don't allow return code > 0 */
 	if (res >= 0) {
-		res = 0;	
+		res = 0;
 		if (ringing) {
 			ast_indicate(chan, -1);
 		} else {
 			ast_moh_stop(chan);
-		}			
+		}
 		ast_stopstream(chan);
 	}
 
@@ -7362,6 +7362,9 @@
 			   ((m = interface_exists(q, args.interface)))) {
 			count = m->ringinuse;
 			ao2_ref(m, -1);
+		} else if (!ast_strlen_zero(args.interface)) {
+			ast_log(LOG_ERROR, "Queue member interface %s not in queue %s\n",
+				args.interface, args.queuename);
 		} else {
 			ast_log(LOG_ERROR, "Unknown option %s provided to %s, valid values are: "
 				"logged, free, ready, count, penalty, paused, ringinuse\n", args.option, cmd);
@@ -7476,7 +7479,7 @@
 		ast_log(LOG_ERROR, "%s requires an argument: queuename\n", cmd);
 		return -1;
 	}
-	
+
 	if ((q = find_load_queue_rt_friendly(data))) {
 		ao2_lock(q);
 		mem_iter = ao2_iterator_init(q->members, 0);

[... 4255 lines stripped ...]



More information about the asterisk-commits mailing list