Added check of reserved_extensions against dialplan numbers when creating/modifying phones

Fixes for non-agent API, agent_stats_export
Added CRM_log_manage.pl script in extras

git-svn-id: svn://192.168.202.10@3967 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2026-01-26 19:53:03 +00:00
parent 402243b158
commit 498642ee6e
6 changed files with 1051 additions and 627 deletions
File diff suppressed because it is too large Load Diff
+12 -3
View File
@@ -137,6 +137,9 @@ $browser_alert_sounds_list = 'bark_dog,beep_double,beep_five,beep_up,bell_double
$HTMLcolors = 'IndianRed,CD5C5C|LightCoral,F08080|Salmon,FA8072|DarkSalmon,E9967A|LightSalmon,FFA07A|Crimson,DC143C|Red,FF0000|FireBrick,B22222|DarkRed,8B0000|Pink,FFC0CB|LightPink,FFB6C1|HotPink,FF69B4|DeepPink,FF1493|MediumVioletRed,C71585|PaleVioletRed,DB7093|LightSalmon,FFA07A|Coral,FF7F50|Tomato,FF6347|OrangeRed,FF4500|DarkOrange,FF8C00|Orange,FFA500|Gold,FFD700|Yellow,FFFF00|LightYellow,FFFFE0|LemonChiffon,FFFACD|LightGoldenrodYellow,FAFAD2|PapayaWhip,FFEFD5|Moccasin,FFE4B5|PeachPuff,FFDAB9|PaleGoldenrod,EEE8AA|Khaki,F0E68C|DarkKhaki,BDB76B|Lavender,E6E6FA|Thistle,D8BFD8|Plum,DDA0DD|Violet,EE82EE|Orchid,DA70D6|Fuchsia,FF00FF|Magenta,FF00FF|MediumOrchid,BA55D3|MediumPurple,9370DB|RebeccaPurple,663399|BlueViolet,8A2BE2|DarkViolet,9400D3|DarkOrchid,9932CC|DarkMagenta,8B008B|Purple,800080|Indigo,4B0082|SlateBlue,6A5ACD|DarkSlateBlue,483D8B|MediumSlateBlue,7B68EE|GreenYellow,ADFF2F|Chartreuse,7FFF00|LawnGreen,7CFC00|Lime,00FF00|LimeGreen,32CD32|PaleGreen,98FB98|LightGreen,90EE90|MediumSpringGreen,00FA9A|SpringGreen,00FF7F|MediumSeaGreen,3CB371|SeaGreen,2E8B57|ForestGreen,228B22|Green,008000|DarkGreen,006400|YellowGreen,9ACD32|OliveDrab,6B8E23|Olive,808000|DarkOliveGreen,556B2F|MediumAquamarine,66CDAA|DarkSeaGreen,8FBC8B|LightSeaGreen,20B2AA|DarkCyan,008B8B|Teal,008080|Aqua,00FFFF|Cyan,00FFFF|LightCyan,E0FFFF|PaleTurquoise,AFEEEE|Aquamarine,7FFFD4|Turquoise,40E0D0|MediumTurquoise,48D1CC|DarkTurquoise,00CED1|CadetBlue,5F9EA0|SteelBlue,4682B4|LightSteelBlue,B0C4DE|PowderBlue,B0E0E6|LightBlue,ADD8E6|SkyBlue,87CEEB|LightSkyBlue,87CEFA|DeepSkyBlue,00BFFF|DodgerBlue,1E90FF|CornflowerBlue,6495ED|MediumSlateBlue,7B68EE|RoyalBlue,4169E1|Blue,0000FF|MediumBlue,0000CD|DarkBlue,00008B|Navy,000080|MidnightBlue,191970|Cornsilk,FFF8DC|BlanchedAlmond,FFEBCD|Bisque,FFE4C4|NavajoWhite,FFDEAD|Wheat,F5DEB3|BurlyWood,DEB887|Tan,D2B48C|RosyBrown,BC8F8F|SandyBrown,F4A460|Goldenrod,DAA520|DarkGoldenrod,B8860B|Peru,CD853F|Chocolate,D2691E|SaddleBrown,8B4513|Sienna,A0522D|Brown,A52A2A|Maroon,800000|White,FFFFFF|Snow,FFFAFA|HoneyDew,F0FFF0|MintCream,F5FFFA|Azure,F0FFFF|AliceBlue,F0F8FF|GhostWhite,F8F8FF|WhiteSmoke,F5F5F5|SeaShell,FFF5EE|Beige,F5F5DC|OldLace,FDF5E6|FloralWhite,FFFAF0|Ivory,FFFFF0|AntiqueWhite,FAEBD7|Linen,FAF0E6|LavenderBlush,FFF0F5|MistyRose,FFE4E1|Gainsboro,DCDCDC|LightGray,D3D3D3|Silver,C0C0C0|DarkGray,A9A9A9|Gray,808080|DimGray,696969|LightSlateGray,778899|SlateGray,708090|DarkSlateGray,2F4F4F|Black,000000';
$reserved_extensions = '8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8320,8352,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8500,8501,138300,138301,138302,138303,138304,138305,138306,138307,138308,138309,138310,138311,138312,138313,138314,138315,138316,138317,138318,138319,138320,138321,138322,138323,138324,138325,138326,138327,138328,138329,138330,138331,138332,138333,138334,138335,138336,138337,138338,138339,138340,138341,138342,138343,138344,138345,138346,138347,138348,138349,138350,138351,138352,138353,138354,138355,138356,138357,138358,138359,138360,138361,138362,138363,138364,138365,138366,138367,138368,138369,138370,138371,138372,138373,138374,138375,138376,138377,138378,138379,138380,138381,138382,138383,138384,138385,138386,138387,138388,138389,138390,138391,138392,138393,138394,138395,138396,138397,138398,138399';
$reserved_extensions = ",$reserved_extensions,";
### BEGIN housecleaning of old static report files, if not done before ###
if (!file_exists('old_clear'))
{
@@ -6305,12 +6308,13 @@ if ($SSscript_remove_js > 0)
# 251204-0757 - Added SERVER DRIVE PARTITIONS display
# 251211-1134 - Added ADAPT_PERCENTMAX dial_method and adaptive_percentmax_percentage campaign setting
# 260106-1438 - Fixes for PHP8, 2026 date change
# 260126-1335 - Added check of reserved_extensions against dialplan numbers when creating/modifying phones
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
$admin_version = '2.14-951a';
$build = '260106-1438';
$admin_version = '2.14-952a';
$build = '260126-1335';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -41413,6 +41417,11 @@ if ($ADD==31111111111)
$rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt);
$tempdp = $row[1];
$reserved_dialplan_warning='';
if (preg_match("/,$tempdp,/",$reserved_extensions))
{$reserved_dialplan_warning="<font color=red><b> &nbsp; "._QXZ("WARNING: Reserved Dialplan Number")."!</b></font>\n";}
echo "<br>"._QXZ("MODIFY A PHONE RECORD").": $row[1]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41111111111>\n";
echo "<input type=hidden name=old_extension value=\"$row[0]\">\n";
@@ -41422,7 +41431,7 @@ if ($ADD==31111111111)
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Phone Extension").": </td><td align=left><input type=text name=extension size=20 maxlength=100 value=\"$row[0]\">$NWB#phones-extension$NWE <i></i></td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Dial Plan Number").": </td><td align=left><input type=text name=dialplan_number size=15 maxlength=20 value=\"$row[1]\"> ("._QXZ("digits only").")$NWB#phones-dialplan_number$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Dial Plan Number").": </td><td align=left><input type=text name=dialplan_number size=15 maxlength=20 value=\"$row[1]\"> ("._QXZ("digits only").")$NWB#phones-dialplan_number$NWE$reserved_dialplan_warning</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Voicemail Box").": </td><td align=left><input type=text name=voicemail_id size=10 maxlength=10 value=\"$row[2]\"> ("._QXZ("digits only").")$NWB#phones-voicemail_id$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Outbound CallerID").": </td><td align=left><input type=text name=outbound_cid size=10 maxlength=20 value=\"$row[65]\"> ("._QXZ("digits only").")$NWB#phones-outbound_cid$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Outbound Alt CallerID").": </td><td align=left><input type=text name=outbound_alt_cid size=10 maxlength=20 value=\"$row[100]\"> <i>"._QXZ("optional")."</i> ("._QXZ("digits only").")$NWB#phones-outbound_alt_cid$NWE</td></tr>\n";
+2 -2
View File
@@ -1,4 +1,4 @@
# version: 20251205193301
# version: 20260126143901
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. 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>
@@ -936,7 +936,7 @@ list_loader-state_conversion State Abbreviation Lookup <QXZ>If your lead file ha
list_loader-required_phone_length Required Phone Number Length <QXZ>If enabled, this is the length in digits that phone numbers must be in order to be loaded into the system.</QXZ>
list_loader-invalid_phone_override Invalid Phone Number Replacement <QXZ>If enabled, this option will try to replace an invalid phone_number lead value with either the alt_phone or address3 value in the same lead. This can be made active only in cases where the number is INVALID, and-or the number is a DUPLICATE, and-or the number is an International DNC match. The -empty-rep-value- options will set the replacement field to blank if it has been used to replace the phone_number for a lead. For example, if the phone_number is invalid and is replaced with a valid alt_phone, then the alt_phone field will be blank if one of the -empty-rep-value- options is used. Default is DISABLED.</QXZ>
phones-extension Phone Extension <QXZ>This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone. For SIP, PJSIP and IAX phones, this field should not contain any dashes.</QXZ>
phones-dialplan_number Dial Plan Number <QXZ>This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server</QXZ>
phones-dialplan_number Dial Plan Number <QXZ>This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server. If you get a Reserved Dialplan Number warning here, then you will not be able to dial this phone, so you should use another dialplan number. The reserved dialplan numbers are: <font size=1>8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8320 8352 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8500 8501 138300 138301 138302 138303 138304 138305 138306 138307 138308 138309 138310 138311 138312 138313 138314 138315 138316 138317 138318 138319 138320 138321 138322 138323 138324 138325 138326 138327 138328 138329 138330 138331 138332 138333 138334 138335 138336 138337 138338 138339 138340 138341 138342 138343 138344 138345 138346 138347 138348 138349 138350 138351 138352 138353 138354 138355 138356 138357 138358 138359 138360 138361 138362 138363 138364 138365 138366 138367 138368 138369 138370 138371 138372 138373 138374 138375 138376 138377 138378 138379 138380 138381 138382 138383 138384 138385 138386 138387 138388 138389 138390 138391 138392 138393 138394 138395 138396 138397 138398 138399</font></QXZ>
phones-voicemail_id Voicemail Box <QXZ>This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app.</QXZ>
phones-voicemail_timezone Voicemail Zone <QXZ>This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings.</QXZ>
phones-voicemail_options Voicemail Options <QXZ>This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing.</QXZ>
+6 -2
View File
@@ -226,6 +226,7 @@
# 250620-1007 - Added apinewlead_url requests for add_lead when new leads are inserted
# 250720-1841 - Added hopper_bulk_insert function
# 251205-1456 - Added ADAPT_PERCENTMAX dial_method
# 260123-1020 - pause_sec fix in agent_stats_export
#
$version = '2.14-202';
@@ -12442,6 +12443,7 @@ if ($function == 'agent_stats_export')
$talk_sec = 0;
$dead_sec = 0;
$dispo_sec = 0;
$pause_sec = 0;
}
else
{
@@ -12450,6 +12452,7 @@ if ($function == 'agent_stats_export')
$talk_sec = $AStalk_sec[$k];
$dead_sec = $ASdead_sec[$k];
$dispo_sec = $ASdispo_sec[$k];
$pause_sec = $ASpause_sec[$k];
}
$avg_session_sec = round($avg_session_sec);
$avg_pause_sec = round($avg_pause_sec);
@@ -12466,16 +12469,17 @@ if ($function == 'agent_stats_export')
$talk_sec = sec_convert($talk_sec,$time_format);
$dead_sec = sec_convert($dead_sec,$time_format);
$dispo_sec = sec_convert($dispo_sec,$time_format);
$pause_sec = sec_convert($pause_sec,$time_format);
$avg_cust_sec = sec_convert($avg_cust_sec,$time_format);
$avg_wait_sec = sec_convert($avg_wait_sec,$time_format);
if ($group_by_campaign == 'YES')
{
$output .= "$AScampaign[$k]$DL$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
$output .= "$AScampaign[$k]$DL$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$pause_sec$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
}
else
{
$output .= "$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
$output .= "$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$pause_sec$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
}
$k++;
}