From 884aad2b2103fe02c1ee956b1d47edafda059b76 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 30 Jan 2012 22:15:01 +0000 Subject: [PATCH] Fixed ring agent EXTERNAL protocol issue updated non-agent-api doc git-svn-id: svn://192.168.202.10@1781 3d104415-ff17-0410-8863-d5cf3c621b8a --- agi/agi-VDAD_ALL_inbound.agi | 14 ++++++++++++-- docs/NON-AGENT_API.txt | 22 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index 0785a401..e6f77498 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -82,7 +82,7 @@ #exten => _99909*.,2,AGI(agi-VDAD_ALL_inbound.agi) #exten => _99909*.,3,Hangup # -# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # changes: # 70828-0924 - First Build @@ -173,6 +173,7 @@ # 111201-1457 - Added grade-random next-agent-call option for inbound # 111219-2124 - Added max stats updating # 111229-1726 - Changed call time overflow to look at previous day stop time +# 120130-1708 - Fix for ring agent EXTERNAL protocol phone issue # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -2611,8 +2612,17 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override $phone_protocol = $ARextension[$ragp]; $phone_extension =~ s/.*\///gi; $phone_protocol =~ s/\/.*//gi; + if ($phone_protocol =~ /Local/) + {$phone_protocol = 'EXTERNAL';} + if ($phone_extension =~ /\@default/) + { + $phone_extension =~ s/\@default//gi; + $extensionSQL = "dialplan_number='$phone_extension'"; + } + else + {$extensionSQL = "extension='$phone_extension'";} $dialplan_number=''; - $stmtA = "SELECT dialplan_number FROM phones where extension='$phone_extension' and protocol='$phone_protocol' and server_ip='$ARserver_ip[$ragp]';"; + $stmtA = "SELECT dialplan_number FROM phones where $extensionSQL and protocol='$phone_protocol' and server_ip='$ARserver_ip[$ragp]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; diff --git a/docs/NON-AGENT_API.txt b/docs/NON-AGENT_API.txt index 38a3d7e8..91809e86 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 Updated: 2011-11-06 +NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2012-01-30 This document describes the functions of an API(Application Programming Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. @@ -200,6 +200,8 @@ ERROR: NO FUNCTION SPECIFIED -------------------------------------------------------------------------------- agent_ingroup_info - shows in-group and outbound auto-dial info for logged-in agent +NOTE: api user for this function must have user_level set to 7 or higher + REQUIRED FIELDS- agent_user - 2-20 characters source - description of what originated the API call (maximum 20 characters) @@ -221,6 +223,8 @@ ERROR: agent_ingroup_info INVALID USER ID - 1255|6666 -------------------------------------------------------------------------------- recording_lookup - looks up recordings based upon user and date or lead_id +NOTE: api user for this function must have user_level set to 7 or higher and "view reports" enabled + REQUIRED FIELDS- agent_user - 2-20 characters lead_id - 1-10 digits @@ -253,6 +257,8 @@ start_time|user|recording_id|lead_id|location -------------------------------------------------------------------------------- did_log_export - exports all calls inbound to a DID for one day +NOTE: api user for this function must have user_level set to 7 or higher and "view reports" enabled + REQUIRED FIELDS- phone_number - 2-20 characters, the DID that you want to pull logs for date - date of the calls to pull (must be in YYYY-MM-DD format) @@ -547,6 +553,8 @@ ERROR: update_lead USER DOES NOT HAVE PERMISSION TO UPDATE LEADS IN THE SYSTEM - -------------------------------------------------------------------------------- add_user - adds a user to the system +NOTE: api user for this function must have user_level set to 8 or higher and "modify users" enabled + REQUIRED FIELDS- agent_user - 2-20 characters (for auto-generated send 'AUTOGENERATED') agent_pass - 1-20 characters @@ -587,6 +595,8 @@ SUCCESS: add_user USER HAS BEEN ADDED - 6666|1000|1234|8|Testing+Person|AGENTS -------------------------------------------------------------------------------- add_phone - adds a phone to the system +NOTE: api user for this function must have user_level set to 8 or higher and "ast admin access" enabled + REQUIRED FIELDS- extension - 2-100 characters dialplan_number - 1-20 digits @@ -625,6 +635,8 @@ SUCCESS: add_phone PHONE HAS BEEN ADDED - 6666|cc100|10.0.9.8|SIP|100 -------------------------------------------------------------------------------- update_phone - updates or deletes a phone entry already in the system +NOTE: api user for this function must have user_level set to 8 or higher and "ast admin access" enabled + REQUIRED FIELDS- extension - 2-100 characters server_ip - 7-15 characters, must be a valid server_ip @@ -676,6 +688,8 @@ SUCCESS: update_phone PHONE HAS BEEN DELETED - 6666|cc100|10.0.9.8| -------------------------------------------------------------------------------- add_phone_alias - adds a phone alias entry to the system +NOTE: api user for this function must have user_level set to 8 or higher and "ast admin access" enabled + REQUIRED FIELDS- alias_id - 2-20 characters phone_logins - 2-255 characters (phone logins separated by commas) @@ -698,6 +712,8 @@ SUCCESS: add_phone_alias PHONE ALIAS HAS BEEN ADDED - 6666|x100|testing_x100|cc1 -------------------------------------------------------------------------------- update_phone_alias - updates or deletes a phone alias entry already in the system +NOTE: api user for this function must have user_level set to 8 or higher and "ast admin access" enabled + REQUIRED FIELDS- alias_id - 2-20 characters phone_logins - 2-255 characters (phone logins separated by commas) @@ -726,6 +742,8 @@ SUCCESS: update_phone_alias PHONE ALIAS HAS BEEN DELETED - 6666|x100| -------------------------------------------------------------------------------- add_list - adds a list to the system +NOTE: api user for this function must have user_level set to 8 or higher and "modify lists" enabled + REQUIRED FIELDS- list_id - 2-14 digits list_name - 6-30 characters @@ -763,6 +781,8 @@ SUCCESS: add_list LIST HAS BEEN ADDED - 6666|1101|TESTCAMP -------------------------------------------------------------------------------- update_list - updates list information in the vicidial_lists table +NOTE: api user for this function must have user_level set to 8 or higher and "modify lists" enabled + REQUIRED FIELDS- list_id - must be all numbers, 2-14 digits source - description of what originated the API call (maximum 20 characters)