From 63a897e3cee3f03f0c5aada6a9fb35a93fabe270 Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 29 May 2011 16:57:05 +0000 Subject: [PATCH] Added time zone information output to version function of non-agent-api git-svn-id: svn://192.168.202.10@1668 3d104415-ff17-0410-8863-d5cf3c621b8a --- docs/CROSS_CLUSTER_COMMUNICATION.txt | 90 ++++++++++++++++++++++++++++ docs/NON-AGENT_API.txt | 7 ++- www/vicidial/non_agent_api.php | 11 ++-- 3 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 docs/CROSS_CLUSTER_COMMUNICATION.txt diff --git a/docs/CROSS_CLUSTER_COMMUNICATION.txt b/docs/CROSS_CLUSTER_COMMUNICATION.txt new file mode 100644 index 00000000..a91aad80 --- /dev/null +++ b/docs/CROSS_CLUSTER_COMMUNICATION.txt @@ -0,0 +1,90 @@ +CROSS-CLUSTER COMMUNICATION 2011-05-27 + + +!!!!! THIS FEATURE DOES NOT EXIST, THIS IS FOR PLANNING PURPOSES ONLY !!!!! + + +This is a planning document for how different vicidial clusters can communicate +with each other to send various types of information between them. The overall +goal is to allow for many clusters to talk to each other. + +Some of the types of communication that we would like to achieve are: +- Setup of telco trunks(SIP/IAX) allowing for 1-way or 2-way calling +- Allowing lookup of lead information while transferring between clusters +- Allow transmission of number of calls in queue and agents available + + + +-------------------------------- + DATABASE AND ADMIN CHANGES: +-------------------------------- + +A new options in System Settings will be added: +- cross_cluster_enabled - Y/N +- local_cluster_id - the id that is used for this cluster by other clusters + +This will require a new Admin subsection for cluster configuration: +- cluster_id +- cluster_name +- active - Y/N +- cluster_primary_server +- cluster_trunk_protocall - SIP/IAX +- cluster_agent_api_url +- cluster_nonagent_api_url +- cluster_api_user +- cluster_api_pass +- cluster_api_permissions - lead_lookup, user_lookup, ingroup_lookup, etc... +- cluster_dst, cluster_tz, cluster_local_gmt_now + +There will be new options added to Servers: +- local_gmt_now - current calculated gmt offset +- cluster_id - default will be LOCAL cluster +- cluster_call_direction - IN_FROM_CLUSTER, OUT_TO_CLUSTER, BOTH, NONE +- cluster_server_ip - SERVER_IP, ALT_IP, EXTERNAL_IP + +There will be a new table added to link lead_ids on clusters: +-vicidial_list_cluster_link +- lead_id +- cluster_id +- cluster_lead_id +- call_date +- caller_code + +Some tables will have a "cluster_id" field added to them to show where the call came from +- vicidial_auto_calls +- vicidial_campaign_stats + + + +-------------------------------- + NON-AGENT API CHANGES: +-------------------------------- + +lead_id_lookup: +- REQUIRES: cluster_id, caller_code +- RETURNS: all lead and call information + +lead_notes_lookup: +- REQUIRES: cluster_id, lead_id +- RETURNS: call history for lead_id including per-call notes + +ingroup_status: +- REQUIRES: cluster_id, group_id +- RETURNS: number of agents waiting/incall/paused/total, number of calls waiting, calls today, drops today, drop % + +campaign_status: +- REQUIRES: cluster_id, campaign_id +- RETURNS: number of agents waiting/incall/paused/total, number of calls waiting, calls today, drops today, dialable leads, drop % + +cluster_server_status: +- REQUIRES: cluster_id +- RETURNS: listing of defined servers, their current times as well as PHP and DB times + + + +-------------------------------- + CALL FLOW AND TRUNK CHANGES: +-------------------------------- + +- IAX/SIP trunks would be added between every server on every active cluster(depending on direction settings) +- dialplan context would be added for each foreign cluster to route calls with proper cluster_id flag allowing for lookups of lead information diff --git a/docs/NON-AGENT_API.txt b/docs/NON-AGENT_API.txt index 42cd82ef..efe98471 100644 --- a/docs/NON-AGENT_API.txt +++ b/docs/NON-AGENT_API.txt @@ -1,4 +1,4 @@ -NON-AGENT API DOCUMENT Started: 2008-07-24 +NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2011-05-29 This document describes the functions of an API(Application Programming Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. @@ -57,6 +57,7 @@ Changes: 110404-1356 - Added uniqueid search parameter to recording_lookup function 110409-0822 - Added run_time logging of API functions 110424-0854 - Added option for time zone code lookups using owner field in add_lead function +110529-1220 - Added time zone information output to version function @@ -70,13 +71,13 @@ valid api-enabled vicidial_users account to execute actions. -------------------------------------------------------------------------------- -version - shows version and build of the API, along with the date/time +version - shows version and build of the API, along with the date/time and timezone Example URL strings for API calls: http://server/vicidial/non_agent_api.php?function=version Example responses: -VERSION: 2.0.5-4|BUILD: 80910-0020|DATE: 2008-09-10 00:26:43|EPOCH: 1221020803 +VERSION: 2.4-34|BUILD: 110424-0854|DATE: 2011-05-29 12:19:22|EPOCH: 1306685962|DST: 1|TZ: -5|TZNOW: -4| diff --git a/www/vicidial/non_agent_api.php b/www/vicidial/non_agent_api.php index 0c7c1e1d..7e01fbe4 100644 --- a/www/vicidial/non_agent_api.php +++ b/www/vicidial/non_agent_api.php @@ -47,10 +47,11 @@ # 110404-1356 - Added uniqueid search parameter to recording_lookup function # 110409-0822 - Added run_time logging of API functions # 110424-0854 - Added option for time zone code lookups using owner field +# 110529-1220 - Added time zone information output to version function # -$version = '2.4-33'; -$build = '110424-0854'; +$version = '2.4-34'; +$build = '110529-1220'; $startMS = microtime(); @@ -420,7 +421,7 @@ $gmt_recs = mysql_num_rows($rslt); if ($gmt_recs > 0) { $row=mysql_fetch_row($rslt); - $DBSERVER_GMT = "$row[0]"; + $DBSERVER_GMT = $row[0]; if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} if ($isdst) {$SERVER_GMT++;} } @@ -440,11 +441,11 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT; ################################################################################ -### version - show version and date information for the API +### version - show version, date, time and time zone information for the API ################################################################################ if ($function == 'version') { - $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime"; + $data = "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime|DST: $isdst|TZ: $DBSERVER_GMT|TZNOW: $SERVER_GMT|"; $result = 'SUCCESS'; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);