Fix for multiple filter_clean_cid_number actions in the DID routing AGI script, also added 'T' filter action, Issue #1247

git-svn-id: svn://192.168.202.10@3381 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-03-15 15:44:29 +00:00
parent 85b58a48ad
commit 599760e4df
2 changed files with 24 additions and 7 deletions
+22 -5
View File
@@ -13,7 +13,7 @@
# ;inbound DID catch-all:
#exten => _X.,1,AGI(agi-DID_route.agi)
#
# Copyright (C) 2020 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# changes:
# 81007-0324 - First Build
@@ -47,6 +47,7 @@
# 190216-0814 - Fix for user-group, in-group and campaign settings matching issues
# 200623-2258 - Added Answer Signal options
# 201112-0834 - Fix for AGENT routing, check for availability, issue #1211
# 210315-1132 - Fix for multiple filter_clean_cid_number actions, added 'T' filter action, Issue #1247
#
@@ -290,7 +291,7 @@ if ($SSdid_system_filter > 0)
{
$original_callerid = $callerid;
$filter_number_altered=0;
if ($filter_clean_cid_number =~ /^R\d/)
if ($filter_clean_cid_number =~ /R\d/)
{
@filter_rule = split(/R/,$filter_clean_cid_number);
$filter_rule[1] =~ s/ .*//gi;
@@ -299,7 +300,7 @@ if ($SSdid_system_filter > 0)
if (length($callerid) != length($original_callerid))
{$filter_number_altered++;}
}
if ($filter_clean_cid_number =~ /^L\d/)
if ($filter_clean_cid_number =~ /L\d/)
{
@filter_rule = split(/L/,$filter_clean_cid_number);
$filter_rule[1] =~ s/ .*//gi;
@@ -308,6 +309,14 @@ if ($SSdid_system_filter > 0)
if (length($callerid) != length($original_callerid))
{$filter_number_altered++;}
}
if ($filter_clean_cid_number =~ /T\d/)
{
@filter_rule = split(/T/,$filter_clean_cid_number);
$filter_rule[1] =~ s/ .*//gi;
$callerid = substr($callerid, 0, $filter_rule[1]);
if (length($callerid) != length($original_callerid))
{$filter_number_altered++;}
}
}
### END temp clean caller id number ###
@@ -904,7 +913,7 @@ if (length($filter_clean_cid_number) > 1)
{
$original_callerid = $callerid;
$filter_number_altered=0;
if ($filter_clean_cid_number =~ /^R\d/)
if ($filter_clean_cid_number =~ /R\d/)
{
@filter_rule = split(/R/,$filter_clean_cid_number);
$filter_rule[1] =~ s/ .*//gi;
@@ -913,7 +922,7 @@ if (length($filter_clean_cid_number) > 1)
if (length($callerid) != length($original_callerid))
{$filter_number_altered++;}
}
if ($filter_clean_cid_number =~ /^L\d/)
if ($filter_clean_cid_number =~ /L\d/)
{
@filter_rule = split(/L/,$filter_clean_cid_number);
$filter_rule[1] =~ s/ .*//gi;
@@ -922,6 +931,14 @@ if (length($filter_clean_cid_number) > 1)
if (length($callerid) != length($original_callerid))
{$filter_number_altered++;}
}
if ($filter_clean_cid_number =~ /T\d/)
{
@filter_rule = split(/T/,$filter_clean_cid_number);
$filter_rule[1] =~ s/ .*//gi;
$callerid = substr($callerid, 0, $filter_rule[1]);
if (length($callerid) != length($original_callerid))
{$filter_number_altered++;}
}
if ($filter_number_altered > 0)
{
$newcallerid = "\"$calleridname <$callerid>\"";
@@ -1,4 +1,4 @@
# version: 20210314105801
# version: 20210315114001
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
@@ -650,7 +650,7 @@ inbound_dids-list_id In-Group List ID <QXZ>If IN_GROUP is selected as the DID Ro
inbound_dids-entry_list_id In-Group Entry List ID <QXZ>If IN_GROUP is selected as the DID Route, then this is the Entry List ID that a new lead will be populated with if a new lead is added. Default is 0 for disabled.</QXZ>
inbound_dids-campaign_id In-Group Campaign ID <QXZ>If IN_GROUP is selected as the DID Route, then this is the Campaign ID that leads may be searched for in if the call handle method is CIDLOOKUPRC.</QXZ>
inbound_dids-phone_code In-Group Phone Code <QXZ>If IN_GROUP is selected as the DID Route, then this is the Phone Code used if a new lead is created.</QXZ>
inbound_dids-filter_clean_cid_number Clean CID Number <QXZ>This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L.</QXZ>
inbound_dids-filter_clean_cid_number Clean CID Number <QXZ>This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. The T option which will trim the end number to a specific number of digits from the left for example T3 on 12345 will return 123. Default is empty. If more than one rule is specified make sure you separate them with a space and they will be executed in the following order R L T.</QXZ>
inbound_dids-no_agent_ingroup_redirect No-Agent In-Group Redirect <QXZ>This setting allows you to redirect calls on this DID if there are no logged-in agents set to take calls from a specific In-Group. If this field is set to Y or NO_PAUSED and there are no agents logged in to take calls from the specific In-Group the calls will go to the No Agent In-Group Extension set below. The NO_PAUSED option will only send the call to the defined Extension if there are only paused agents in the in-group. The READY_ONLY option will send the call to the defined Extension if there are no agents waiting for calls right now in the in-group. Default is DISABLED. See the No Agent In-Group Extension setting below for more information.</QXZ>
inbound_dids-no_agent_ingroup_id No-Agent In-Group ID <QXZ>For the No-Agent In-Group Redirect feature above to work properly, an in-Group must be selected from this menu. Default is blank.</QXZ>
inbound_dids-no_agent_ingroup_extension No-Agent In-Group Extension <QXZ>For the No-Agent In-Group Redirect feature above to work properly, an Extension must be set in this field. Default is 9998811112. Below you will see some examples of default extensions that you can use in the system to terminate calls to,</QXZ><BR>- <QXZ>9998811112 - ANSWERED, This number is not in service</QXZ><BR>- <QXZ>9993333333 - UNANSWERED, signal 1, unallocated number, immediate hangup</QXZ><BR>- <QXZ>9998888888 - UNANSWERED, signal 17, busy signal, immediate hangup</QXZ><BR>- <QXZ>9994444444 - UNANSWERED, signal 27, out of order, immediate hangup</QXZ><BR>- <QXZ>9995555555 - UNANSWERED, ring for 120 seconds then hangup</QXZ>