Commit Graph

191 Commits

Author SHA1 Message Date
François b182a0ce34 FS-9516 refactor loopback agent on mod_callcenter and fix multiple minor issues 2016-11-14 13:28:11 +01:00
Mike Jerris e1b3ee1efd FS-9652: improve sql sanitization 2016-11-11 11:27:35 -06:00
Italo Rossi d998325bca FS-9707 - [mod_callcenter] Fixing external_calls_count order in select for top-down and ring-all strategies, removing unneeded log on presence 2016-11-07 17:41:23 -03:00
Italo Rossi 15a232b5bb FS-9609 - [mod_callcenter] BLF for Queues, callcenter_track app, EXIT_WITH_KEY reason and xml_curl improvements
This change implements a few new features, there's no behavior change at all.

1 - BLF for queues

You can now use BLF for knowing when there are callers waiting on a queue,
the pattern to be subscribed is callcenter+queuename@default or @domain name.

2 - callcenter_track app

Now every agent has an external_calls_count column that will be read upon
selecting agent to offer new calls.
If you start an external call (inbound or outbound) and don't wan't
mod_callcenter to offer new calls for this agent just call this app
passing the agent name as argument:

<action application="callcenter_track" data="agent1"/>

This will increment the external calls count, and to make mod_callcenter look to this variable you need to set this queue parameter:

<param name="skip-agents-with-external-calls" value="true"/>

3 - EXIT_WITH_KEY reason

If the member press a key to exit the queue the cc_cancel_reason will be this now.

4 - xml_curl config loading improvements

Prior to this mod_callcenter query your web server a LOT of times,
this will make it only query once per queue, just watch for CC-Queue
request param and build your xml with everything related to that queue,
including tiers (tiers wasn't loaded before this).
2016-10-04 23:07:42 -03:00
Italo Rossi 1080016986 FS-7706 [mod_callcenter] Hangup agent channel if we failed to bridge it with member channel.
The member can hangup the call while we are playing the outbound announce audio to the agent, this
patch detects this and properly hangup the agent channel to avoid keeping it up with
just a silence call since there's no active bridge.

The agent-bridge-end event now has CC-Agent-Bridged: true if the bridge successfully happens,
variable cc_agent_bridged was added so we can track this in the agent and member CDRs.

If you want to play an audio to the agent to indicate the member hangup the call before the bridge
set the variable cc_bridge_failed_outbound_announce, for example:
<action application="set" data="cc_bridge_failed_outbound_announce=tone_stream://%(250,250,425);loops=3"/>
or
<action application="set" data="cc_bridge_failed_outbound_announce=your-caller-has-gone-away-audio"/>
prior to calling callcenter application.

These variables are documented at https://freeswitch.org/confluence/display/FREESWITCH/mod_callcenter
2016-08-24 00:03:16 -03:00
Italo Rossi 0f3204feb3 FS-9248 [mod_callcenter] Adding truncate-tiers-on-load and truncate-agents-on-load options. 2016-06-09 16:53:21 -03:00
Italo Rossi 8b6f40f967 FS-8584 - [mod_callcenter] Requesting agents and tiers when reloading queue
Before this callcenter_config queue reload [queuename] only reloads the queue
parameters and now it'll include a CC-Queue header with the queuename when using
mod_xml_curl and request a new config for updating agents and tiers related to the
queue.

If you are using mod_xml_curl please make sure to return the raw xml config file
with all the settings, queues, agents and tiers tags when we request the config
without a CC-Queue specified. If this header is present you can build the xml with
items only related to the queue requested.
2016-05-13 22:21:04 -03:00
Italo Rossi 8e112294bf Merge pull request #816 in FS/freeswitch from ~FLOKR/freeswitch:feature/FS-9079-adding-new-strategy-to-mod_callcenter to master
* commit '8b42c77c3b63abd0f75819cc183150663cc58a1d':
  FS-9079: [mod_callcenter] Add ring-progressively strategy
2016-05-02 12:42:10 -05:00
Florent Krieg 8b42c77c3b FS-9079: [mod_callcenter] Add ring-progressively strategy
A new strategy is now available through mod_callcenter, which aim
is to provide a mix between top-down and ring-all strategies.

If set to ring-progressively, the strategy will call an agent, and
then a second agent, and then a third agent, without cancelling
previous calls.

The delay between each call is 10 sec by default, but it can be
changed using the queue variable ring-progressively-delay.
2016-05-02 10:26:20 +02:00
Italo Rossi 96e963d3eb Merge pull request #691 in FS/freeswitch from ~RAJESH.VAYA/freeswitch:feature/mod_callcenter-json-api to master
* commit '23e53df7211aaaa8168b185411c85d0a35be2d33':
  FS-8799 [mod_callcenter] Add JSON API interface for mod_callcenter
2016-05-01 20:40:35 -05:00
Italo Rossi 3f5af35fd3 FS-9025 - [mod_callcenter] bypass_media_after_bridge working for member channel 2016-04-07 17:54:28 -03:00
Italo Rossi e95da7a80f FS-8856 - [mod_callcenter] Inserting member as a new one when restoring action fails because our agent_dispatch_thread removed the members just before we tried to update him. 2016-02-22 09:54:53 -03:00
Rodrigo Ramírez Norambuena 1661fc6a51 FS-8822 - [mod_callcenter] Realtime counter for calls in a queue
Added counters for answered and abandoned calls for a queue.

Create two vars for cc_queue struct
    - calls_answered
    - calls_abandoned

These increases when the call is hangup.

This change also :
 - refactor long lines of header and body to  print the queue information.
 - Update year in copyright
2016-02-08 01:22:37 -03:00
Italo Rossi fe5fd7667a FS-8768 - [mod_callcenter] Releasing db handle after reserving agent 2016-01-30 22:35:32 -03:00
rajeshvaya 23e53df721 FS-8799 [mod_callcenter] Add JSON API interface for mod_callcenter
Adding a JSON API interface to fetch data in the JSON format. It abides with the JSON command and its implementations by other modules like mod_verto.
It outputs the exactly same column names as the data in CLI.
Various listing of mod_callcenter data such as agents, queues, members, tiers are as follows below.

- Listing of agents
Command: `json {"command": "callcenter_config", "format": "pretty", "data": {"arguments":"agent list"}}`

- Listing of queues
Command: `json {"command": "callcenter_config", "format": "pretty", "data": {"arguments":"queue list"}}`

- Listing of agents for a queue
Command: `json {"command": "callcenter_config", "data": {"arguments":"queue list agents", "queue_name":"support@default"}}`
(`queue_name` is a required)

- Listing of members(callers) for a queue
Command: `json {"command": "callcenter_config", "data": {"arguments":"queue list members", "queue_name":"support@default"}}`

- Listing of tiers for a queue
Command: `json {"command": "callcenter_config","data": {"arguments":"queue list tiers", "queue_name":"support@default"}}`

- Listing of members(callers)
Command: `json {"command": "callcenter_config","data": {"arguments":"member list"}}`

- Listing of tiers
Command: `json {"command": "callcenter_config","data": {"arguments":"tier list"}}`

It handles various errors and also returns back response in JSON as follow
E.g. Send a command without a required field (`queue_name`)
Command: `json {"command": "callcenter_config", "data": {"arguments":"queue list agents"}}`
Output: `{"command":"callcenter_config","data":{"arguments":"queue list agents"},"status":"error","message":"The command returned an error","response":{"error":"Missing data attribute: queue_name"}}`
2016-01-30 12:25:57 +04:00
Anthony Minessale f8b19b7485 FS-8190 #resolve [When using nixevent, freeswitch stops sending us certain custom event that were NOT part of the nixevent command] 2015-09-21 18:00:32 -05:00
Mike Jerris 5c59a0159d FS-7966: fix more msvc 2015 warnings. 2015-08-31 17:08:52 -04:00
Italo Rossi be3c868655 FS-7467: mod_callcenter - Fixing uuid-standby agents. 2015-06-22 17:51:08 -03:00
Italo Rossi bebd4c4e3e FS-7138 - new mod_callcenter param: reserve-agents
Sets the agent state to Reserved before calling him. In this case,
the Agent is first updated to state Reserved ONLY if his previous
state was Waiting and status was Available/Available (On Demand).
The purpose is to avoid possible race conditions when external
applications are manipulating `agents` table.

Disabled by default.
2015-06-08 14:38:51 -03:00
Ítalo Rossi 6f057b795e Merge pull request #249 in FS/freeswitch from ~SAFAROV/freeswitch-mod-radius-cdr_improvement:origin/FS-7524 to master
* commit '7e1f8bc4c7795451ee6140f65588e590cc4af024':
  FS-7524: mod_callcenter - Fixing tiers, level and position should default to 1 instead of 0
2015-06-05 13:08:58 -05:00
Sergey Safarov 7e1f8bc4c7 FS-7524: mod_callcenter - Fixing tiers, level and position should default to 1 instead of 0 2015-06-05 19:35:04 +03:00
Ítalo Rossi 0c45bee409 Merge pull request #257 in FS/freeswitch from ~ITALOROSSI/freeswitch:bugfix/FS-7569-mod_callcenter_strategy to master
* commit '890991cd28bb2b2860c988476f8641d7b32f02c8':
  FS-7569 mod_callcenter - Tracking queue strategy changes to avoid stuck members
2015-06-02 17:48:46 -05:00
Ítalo Rossi e6bb3ed434 Merge pull request #246 in FS/freeswitch from ~ITALOROSSI/freeswitch:bugfix/FS-7464-callcenter-cannot-play-us-ring-tone_stream to master
* commit '1bc241922e3136dda8067723a4d4c9ebdd51f101':
  FS-7464 mod_callcenter moh-sound needs to be expanded when containing variables.
2015-06-02 17:33:29 -05:00
Italo Rossi 890991cd28 FS-7569 mod_callcenter - Tracking queue strategy changes to avoid stuck members 2015-05-25 15:00:14 -03:00
Italo Rossi 1bc241922e FS-7464 mod_callcenter moh-sound needs to be expanded when containing variables. 2015-05-03 20:25:42 -03:00
Victor Torres 69d5333bfc FS-7445 fixes cc_outbound_cid_name_prefix 2015-04-17 18:50:16 -03:00
Artur Zaprzała 0df4085c3d Fix race condition when callcenter member cancels the call. 2015-02-18 14:26:02 +01:00
Marc Olivier Chouinard e1cb0e8632 Merge pull request #127 in FS/freeswitch from ~ITALOROSSI/freeswitch:mod_callcenter-queue-list-count-by-state to master
* commit 'f63f8686bc8da391b3c46b24e10571215c8b377f':
  FS-7049 - Documentation for state optional paramenter in callcenter_config queue list and count
  fix FS-7049 - Count and list agents based on their state
2014-12-11 21:01:03 -06:00
Italo Rossi f63f8686bc FS-7049 - Documentation for state optional paramenter in callcenter_config queue list and count 2014-12-11 23:43:03 -03:00
Humberto Diógenes 1bcdb49bce Fix JIRA (FS-7018): mod_callcenter's longest-idle-agent strategy is unfair 2014-12-04 16:12:20 -03:00
Italo Rossi 80649df65c fix FS-7049 - Count and list agents based on their state 2014-12-02 22:57:43 -03:00
Italo Rossi f87c335e8a Only waiting for agent channel to hangup.
If the member do an attended transfer this loop stops and
the agent is set to Available state again, when in fact he still
busy with other channel.

This was happening, for example, when a member calls support queue, then
the support operator do an attended transfer to sales queue, while the sales
operator is talking the member that was transferred, the sales queue will
send calls to the operator, which is not expected.
2014-11-03 12:02:03 -03:00
Brian West 07f4c6204e FS-6646 --resolve 2014-07-11 11:03:22 -05:00
Marc Olivier Chouinard 29e2263442 CID:1210789 Make return value of a function available from the another calling function. Also add a small status check. 2014-05-16 17:18:17 -04:00
Marc Olivier Chouinard 8fa7398760 CID:1025868 Simplified a function arguments never called. 2014-05-16 17:03:59 -04:00
Anthony Minessale 7151d6acea FS-6402 part 2 2014-04-02 03:21:37 +05:00
Anthony Minessale 5c0cff70b3 FS-6402 --resolve 2014-04-02 01:20:19 +05:00
Anthony Minessale 804ef7709d change from sqlite hash to newly added one 2014-03-09 00:37:17 +05:00
Marc Olivier Chouinard 365f81b412 FS-4898 --resolve 2014-02-24 08:52:36 -05:00
Marc Olivier Chouinard 295796d831 FS-3743 --resolve 2014-02-24 08:38:31 -05:00
Marc Olivier Chouinard 8dab4f358a FS-6236 --resolve 2014-02-20 16:20:17 -05:00
Ken Rice 6e7d5d0897 update copyright header for 2014 2014-02-12 12:08:56 -06:00
Peter Olsson 084e245085 Lots of trivial tweaks to minimize compiler warnings, especially on 64-bit platform: Added missing type casts, changed types, added missing NULL checks. 2014-01-22 22:30:23 +01:00
Marc Olivier Chouinard cc8a8c5198 FS-6095 --resolve modified to protect against memory leak and make it more consistant with other modules 2014-01-14 09:34:20 -05:00
Marc Olivier Chouinard 8f73c4ef44 FS-6062 --resolve 2013-12-23 07:34:34 -05:00
Marc Olivier Chouinard 9ecbb54061 FS-5850 --resolve Thanks 2013-11-28 01:28:00 -05:00
Marc Olivier Chouinard a19d013d3e FS-5993 --resolve 2013-11-27 19:19:31 -05:00
Marc Olivier Chouinard a34095a4b7 FS-5843 Give this a try 2013-10-04 15:47:19 -04:00
Marc Olivier Chouinard 9104aab9de FS-5843 --resolve Thanks 2013-10-04 15:21:27 -04:00
Marc Olivier Chouinard c613c65446 --resolve FS-5478 2013-07-08 00:55:48 -04:00
Jeff Lenk 82292cced7 FS-3127 --resolve please reopen if not fixed 2013-07-06 12:52:21 -05:00
Nathan Neulinger 32adc789f6 make noexpandtab explicit in all vim modelines other than xml files 2013-06-25 11:50:17 -05:00
William King f04842d4c8 Cleaning up logically dead code. 2013-05-25 07:02:49 -07:00
Marc Olivier Chouinard 74401ed00b FS-3924 --resolve 2013-01-27 15:06:43 -05:00
Marc Olivier Chouinard da1f3c380e FS-3924 --resolve 2013-01-13 01:00:38 -05:00
Marc Olivier Chouinard 026da2b33d FS-4890 --resolve
I've also added the CC-Agent-Called-Time and CC-Agent-Aborted-Time in case you find this useful also.
2012-11-29 15:42:46 -05:00
Marc Olivier Chouinard 7448b075b7 FS-4760 --resolve 2012-11-16 14:30:00 -05:00
Anthony Minessale e1fe289672 refactor db stuff to use single string dsn to avoid code duplication and introduce switch_sql_queue_manager api to create transactional sql queues to aggregate a bunch of sql stmts into transactions 2012-10-09 20:20:32 -05:00
Anthony Minessale 464155c5cd more priority tweaks 2012-10-01 10:20:48 -05:00
Anthony Minessale 8bb55ed4bf abstract out originate_signal_bond to a function to avoid confustion and regressions 2012-05-29 13:10:15 -05:00
Marc Olivier Chouinard 09bef08b83 FS-4254 --resolve
I've changed the variable name from cc_export to cc_export_vars to be more consistant from the original patch
2012-05-25 13:45:02 -04:00
Ken Rice c5554eb939 Copyright date update. 2012-04-18 11:52:02 -05:00
Travis Cross 9fca678d84 mod_callcenter: add cc_outbound_cid_name_prefix
Prefixes the displayed caller_id_name when calling outbound agents
without affecting the caller_id_name of the underlying member channel.
2012-03-14 05:08:23 +00:00
Travis Cross 6cd86c5628 mod_callcenter: implement cc_outbound_announce
Playback one or more things to the agent based on a channel variable
of the member.  cc_outbound_announce may contain an array.
2012-03-14 05:08:23 +00:00
Travis Cross b2aa332090 mod_callcenter: set cc_exit_key channel variable
If a member of a queue presses a digit specified in cc_exit_keys, the
caller will exit the queue and the variable cc_exit_key will be set to
the digit the caller pressed.
2012-03-14 05:08:22 +00:00
Travis Cross bf5df02c7a mod_callcenter: support cc_exit_keys channel variable
If any digit in cc_exit_keys is pressed, the member will exit the
queue and the callcenter application.
2012-03-14 05:08:22 +00:00
Travis Cross e0d235f59c mod_callcenter: style 2012-03-14 05:08:22 +00:00
Marc Olivier Chouinard ce4256971b mod_callcenter: Small fix 2012-01-29 15:50:14 -05:00
Marc Olivier Chouinard 415d077941 FS-3823 --resolve 2012-01-22 11:50:27 -05:00
Marc Olivier Chouinard 9be51d5265 FS-3823 --resolve 2012-01-21 13:45:21 -05:00
Marc Olivier Chouinard 8e9dfba276 mod_callcenter: Bring up to date the max-wait-time-with-no-agent and max-wait-time-with-no-agent-time-reached param. I'll probably rename the param max-wait-time-with-no-agent-time-reached to something that actually make sense in the future 2011-12-10 20:45:25 -05:00
Marc Olivier Chouinard d32ba761c9 --resolve FS-3657
mod_callcenter: Adapt mod_callcenter loopback agent fix to work with commit 2eae19e6
2011-11-02 17:49:46 -04:00
Marc Olivier Chouinard 4192195b80 FS-3503 --resolve mod_callcenter: add DNIS in some event, and add a few API like get uuid and get state for agent 2011-08-16 19:39:06 -04:00
Marc Olivier Chouinard db5f504678 mod_callcenter: Quick fix againt major loop in wait time is set to 0 and the phone is not registred. 2011-07-17 17:00:38 -04:00
Michael S Collins 06fa4eee78 Make mod_callcenter API syntax WAY more readable 2011-07-15 18:53:57 -07:00
Marc Olivier Chouinard b53fd77108 mod_callcenter: More changes to be more friendly/compliant/respectful with loopback channels. Brought to you by François Delawarde 2011-07-08 19:28:30 -04:00
Travis Cross 8a8b70b7a4 comment cleanup 2011-06-26 13:30:05 +00:00
Jeff Lenk 86d757d61b FS-3297 --resolve 2011-05-17 22:51:47 -05:00
Jeff Lenk d495124f64 windows permanent fix for %I64d problems - all versions after vs2003 support %lld 2011-05-08 13:10:01 -05:00
Marc Olivier Chouinard 9ff8f53f05 mod_callcenter: Fix member been switch as abandoned when he was pickup by an agent FS-3281 2011-05-03 12:13:52 -04:00
Jeff Lenk 3829e2fda5 FS-3272 --resolve moc we need to discuss this with anthm catch me on irc thanks 2011-04-28 00:29:28 -05:00
Marc Olivier Chouinard 3484874f58 mod_callcenter: Apparently, it by design that only 1 of the 2 leg can continue the dialplan. So member are always A leg and agent are B leg. If you want to continue after hangup a call for the agent like in uuid standby mode, use the transfer_after_bridge feature. Sample example usage is on the mod_callcenter wiki page. 2011-04-26 00:15:15 -04:00
Marc Olivier Chouinard debab81ce9 it the other way arround ! 2011-04-25 15:06:32 -04:00
Marc Olivier Chouinard a2a09fb1d9 mod_callcenter: Try to make uuid-standby continue the dialplan. Let me know if this helped 2011-04-25 14:22:57 -04:00
Marc Olivier Chouinard 37b14c9a31 mod_callcenter: Display an warning when MOH is invalid and resume wait with silence. FS-2740 2011-04-23 22:37:47 -04:00
Marc Olivier Chouinard d3e3b39739 mod_callcenter: More temporary attempt to make it 32bit friendly 2011-04-23 17:01:35 -04:00
Marc Olivier Chouinard 568fa83642 mod_callcenter: Decided to take the easy way for portability for the moment. We expect time_t to be an integral anyway in the core, so I'll expect the same here. Should fix the problem with the partial change I did on i386 system 2011-04-23 11:55:56 -04:00
Marc Olivier Chouinard cf1494f773 mod_callcenter: Fix for -Wunused-but-set-variable required compiler 2011-04-22 21:55:56 -04:00
Marc Olivier Chouinard f7e268a1c7 mod_callcenter: Quick changes to try to make it more multi platform friendly. Still need to find the best way to convert a string to time_t that is multi platform. 2011-04-22 19:40:14 -04:00
Marc Olivier Chouinard 6fbfff0f91 mod_callcenter: Should resolve problem when agent transfered a call to another queue. FS-2888 2011-04-22 03:01:08 -04:00
Marc Olivier Chouinard 366f7ca677 mod_callcenter: Changes lot of log file to include the uuid of the member. Also added a bunch of debug log entry to help debug an issue 2011-04-22 02:22:30 -04:00
Marc Olivier Chouinard ac619fd0e8 mod_callcenter: Possible fix on unload module freeze when an member uuid changed or is gone 2011-04-22 01:42:47 -04:00
Marc Olivier Chouinard f17e962636 mod_callcenter: Small fix for strategy top-down 2011-04-19 03:05:32 -04:00
Marc Olivier Chouinard bee247ca7b mod_callcenter: Another strategy 'top-down' (Name might change). This will call the agent one after the other by order... And every member start at position 1. 2011-04-19 01:25:09 -04:00
Marc Olivier Chouinard 2b4b23aac1 mod_callcenter: Ok we have round-robin and random strategy... Keep them comming ;) 2011-04-19 00:21:31 -04:00
Marc Olivier Chouinard 6432d63f00 mod_callcenter: Fix an SQL param errors ! Wish the compiler catched stuff like this 2011-04-18 23:17:58 -04:00
Marc Olivier Chouinard 0315d32076 mod_callcenter: More SQL changes to make the new strategy work on postgresql 2011-04-18 17:16:51 -04:00
Marc Olivier Chouinard e5739b3932 mod_callcenter: SQL error in the new proto (and might not still be working) strategy 2011-04-18 15:10:40 -04:00
Marc Olivier Chouinard bef6f0f40d mod_callcenter: Add a very prototype (and maybe not functional) strategy called : sequentially-by-next-agent-order.
It will try to find the last agent we tried to reach, and start calling more agent after that one based on position.
It will use the level for the next agent, but once that level is done, it start back at the lowest level
2011-04-17 12:46:32 -04:00
Marc Olivier Chouinard c5ae5de0a0 FS-3250 --resolve mod_callcenter: Reload a queue wont delete all the currently waiting members. Only a reload of the module will. 2011-04-15 13:53:04 -04:00