From 1374bcc9b4b5c93ca55d22fd752f60918c327b0f Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 14 Jun 2009 12:43:49 +0000 Subject: [PATCH] Added Call Menu call routing of calls directly to In-Groups git-svn-id: svn://192.168.202.10@1152 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl | 12 +++ .../TO_BE_TRANSLATED_2.2.0.txt | 2 +- agc_2-X/trunk/www/vicidial/admin.php | 80 ++++++++++++++++--- agc_2-X/trunk/www/vicidial/admin_header.php | 75 +++++++++++++++-- 4 files changed, 152 insertions(+), 17 deletions(-) diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index bcb70610..63552440 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -23,6 +23,7 @@ # 90513-0449 - Added audio store sync functionality # 90519-1018 - Added upload file trigger for prompt recording if defined as voicemail server and voicemail/prompt recording extensions auto-generated # 90529-0652 - Added phone_context and fixed calledid and voicemail for phones entries +# 90614-0753 - Added in-group routing to call menu feature # $DB=0; # Debug flag @@ -1066,6 +1067,17 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r { $call_menu_line .= "exten => $option_value[$j],$PRI,Goto(trunkinbound,$option_route_value[$j],1)\n"; } + if ($option_route[$j] =~ /INGROUP/) + { + @IGoption_route_value_context = split(/,/,$option_route_value_context[$j]); + $IGhandle_method = $IGoption_route_value_context[0]; + $IGsearch_method = $IGoption_route_value_context[1]; + $IGlist_id = $IGoption_route_value_context[2]; + $IGcampaign_id = $IGoption_route_value_context[3]; + $IGphone_code = $IGoption_route_value_context[4]; + + $call_menu_line .= "exten => $option_value[$j],$PRI,AGI(agi-VDAD_ALL_inbound.agi,$IGhandle_method-----$IGsearch_method-----$option_route_value[$j]-----$menu_id[$i]--------------------$IGlist_id-----$IGphone_code-----$IGcampaign_id)\n"; + } if ($option_route[$j] =~ /EXTENSION/) { if (length($option_route_value_context[$j])>0) {$option_route_value_context[$j] = "$option_route_value_context[$j],";} diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt index cac2e68e..ef5a5677 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt @@ -72,7 +72,7 @@ Option Route Value Context|| This field is optional and only used for EXTENSION Option Routes|| ADD A NEW CALL MENU|| COPY CALL MENU|| -For CALLMENU, the Route Value should be the Menu ID of the Call Menu that you want the call sent to. For HANGUP, the Route Value can be the name of an audio file to play before hanging up the call. For DID, the Route Value needs to be the DID pattern that you want to send the call to. For EXTENSION, the Route Value needs to be the dialplan extension you want to send the call to, and the Route Value Context is the context that extension is located in, if left blank the context will default to default. For PHONE, the Route Value needs to be the phone login value for the phones entry that you want to send the call to. For VOICEMAIL, the Route Value needs to be the voicemail box number, the unavailable mesage will be played. For AGI, the Route Value needs to be the agi script and any values taht need to be passed to it.|| +This menu contains the options for where to send the call if this option is selected: CALLMENU,INGROUP,DID,HANGUP,EXTENSION,PHONE. For CALLMENU, the Route Value should be the Menu ID of the Call Menu that you want the call sent to. For INGROUP, the In-Group that you want the call to be sent to needs to be selected as well as the other 5 options that need to be set to properly route a call to an Inbound Group. For DID, the Route Value needs to be the DID pattern that you want to send the call to. For HANGUP, the Route Value can be the name of an audio file to play before hanging up the call. For EXTENSION, the Route Value needs to be the dialplan extension you want to send the call to, and the Route Value Context is the context that extension is located in, if left blank the context will default to default. For PHONE, the Route Value needs to be the phone login value for the phones entry that you want to send the call to. For VOICEMAIL, the Route Value needs to be the voicemail box number, the unavailable mesage will be played. For AGI, the Route Value needs to be the agi script and any values taht need to be passed to it.|| Option Description|| This field is where you can describe the option, this description will be put into the dialplan as a comment above the option|| Source Menu|| diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index d2f68d11..ae0fd361 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -1796,11 +1796,12 @@ else # 90607-1716 - Changed drop percent limit to allow for 0.1 steps under 3% # 90608-0944 - Added Drop Lockout Time feature to Campaign Detail Modification screen # 90612-0909 - Added audio prompt selection feature to survey screen +# 90614-0827 - Added In-Group routing to Call Menu screen, Added pull-down Call Menu option to DID screen # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-195'; -$build = '90612-0909'; +$admin_version = '2.2.0-196'; +$build = '90614-0827'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -4136,7 +4137,7 @@ if ($SSqc_features_active > 0)

-Option Route - This menu contains the options for where to send the call if this option is selected: CALLMENU,HANGUP,DID,EXTENSION,PHONE. For CALLMENU, the Route Value should be the Menu ID of the Call Menu that you want the call sent to. For HANGUP, the Route Value can be the name of an audio file to play before hanging up the call. For DID, the Route Value needs to be the DID pattern that you want to send the call to. For EXTENSION, the Route Value needs to be the dialplan extension you want to send the call to, and the Route Value Context is the context that extension is located in, if left blank the context will default to default. For PHONE, the Route Value needs to be the phone login value for the phones entry that you want to send the call to. For VOICEMAIL, the Route Value needs to be the voicemail box number, the unavailable mesage will be played. For AGI, the Route Value needs to be the agi script and any values taht need to be passed to it. +Option Route - This menu contains the options for where to send the call if this option is selected: CALLMENU,INGROUP,DID,HANGUP,EXTENSION,PHONE. For CALLMENU, the Route Value should be the Menu ID of the Call Menu that you want the call sent to. For INGROUP, the In-Group that you want the call to be sent to needs to be selected as well as the other 5 options that need to be set to properly route a call to an Inbound Group. For DID, the Route Value needs to be the DID pattern that you want to send the call to. For HANGUP, the Route Value can be the name of an audio file to play before hanging up the call. For EXTENSION, the Route Value needs to be the dialplan extension you want to send the call to, and the Route Value Context is the context that extension is located in, if left blank the context will default to default. For PHONE, the Route Value needs to be the phone login value for the phones entry that you want to send the call to. For VOICEMAIL, the Route Value needs to be the voicemail box number, the unavailable mesage will be played. For AGI, the Route Value needs to be the agi script and any values taht need to be passed to it.
@@ -11203,23 +11204,39 @@ if ($ADD==4511) $option_value=''; $option_description=''; $option_route=''; $option_route_value=''; $option_route_value_context=''; if (isset($_GET["option_value_$h"])) {$option_value=$_GET["option_value_$h"];} - elseif (isset($_POST["option_value_$h"])) {$option_value=$_POST["option_value_$h"];} + elseif (isset($_POST["option_value_$h"])) {$option_value=$_POST["option_value_$h"];} if (isset($_GET["option_description_$h"])) {$option_description=$_GET["option_description_$h"];} elseif (isset($_POST["option_description_$h"])) {$option_description=$_POST["option_description_$h"];} if (isset($_GET["option_route_$h"])) {$option_route=$_GET["option_route_$h"];} - elseif (isset($_POST["option_route_$h"])) {$option_route=$_POST["option_route_$h"];} + elseif (isset($_POST["option_route_$h"])) {$option_route=$_POST["option_route_$h"];} if (isset($_GET["option_route_value_$h"])) {$option_route_value=$_GET["option_route_value_$h"];} elseif (isset($_POST["option_route_value_$h"])) {$option_route_value=$_POST["option_route_value_$h"];} if (isset($_GET["option_route_value_context_$h"])) {$option_route_value_context=$_GET["option_route_value_context_$h"];} elseif (isset($_POST["option_route_value_context_$h"])) {$option_route_value_context=$_POST["option_route_value_context_$h"];} + if ($option_route == "INGROUP") + { + if (isset($_GET["IGhandle_method_$h"])) {$IGhandle_method=$_GET["IGhandle_method_$h"];} + elseif (isset($_POST["IGhandle_method_$h"])) {$IGhandle_method=$_POST["IGhandle_method_$h"];} + if (isset($_GET["IGsearch_method_$h"])) {$IGsearch_method=$_GET["IGsearch_method_$h"];} + elseif (isset($_POST["IGsearch_method_$h"])) {$IGsearch_method=$_POST["IGsearch_method_$h"];} + if (isset($_GET["IGlist_id_$h"])) {$IGlist_id=$_GET["IGlist_id_$h"];} + elseif (isset($_POST["IGlist_id_$h"])) {$IGlist_id=$_POST["IGlist_id_$h"];} + if (isset($_GET["IGcampaign_id_$h"])) {$IGcampaign_id=$_GET["IGcampaign_id_$h"];} + elseif (isset($_POST["IGcampaign_id_$h"])) {$IGcampaign_id=$_POST["IGcampaign_id_$h"];} + if (isset($_GET["IGphone_code_$h"])) {$IGphone_code=$_GET["IGphone_code_$h"];} + elseif (isset($_POST["IGphone_code_$h"])) {$IGphone_code=$_POST["IGphone_code_$h"];} + + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + } + if ($non_latin < 1) { $option_value = ereg_replace("[^-\_0-9A-Z]","",$option_value); $option_description = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$option_description); $option_route = ereg_replace("[^-_0-9a-zA-Z]","",$option_route); $option_route_value = ereg_replace("[^-\_\#\*\,\.\_0-9a-zA-Z]","",$option_route_value); - $option_route_value_context = ereg_replace("[^-_0-9a-zA-Z]","",$option_route_value_context); + $option_route_value_context = ereg_replace("[^,-_0-9a-zA-Z]","",$option_route_value_context); } if (strlen($option_route) > 0) @@ -17788,7 +17805,21 @@ if ($ADD==3311) echo "$servers_list"; echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - echo "Call Menu: $NWB#vicidial_inbound_dids-menu_id$NWE\n"; + + $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $rslt=mysql_query($stmt, $link); + $menus_to_print = mysql_num_rows($rslt); + $menu_list=''; + $i=0; + while ($i < $menus_to_print) + { + $row=mysql_fetch_row($rslt); + $menu_list .= ""; + $i++; + } + + echo "Call Menu: $NWB#vicidial_inbound_dids-menu_id$NWE\n"; + echo "User Agent: $NWB#vicidial_inbound_dids-user$NWE\n"; echo "User Unavailable Action: $NWB#vicidial_inbound_dids-user_unavailable_action$NWE\n"; echo "User Route Settings In-Group: Route: $call_menu_list\n"; } - if ($option_route=='HANGUP') + if ($option_route=='INGROUP') { - echo "Audio File: audio chooser\n"; + if (strlen($option_route_value_context) < 10) + {$option_route_value_context = 'CID,LB,998,TESTCAMP,1';} + $IGoption_route_value_context = explode(",",$option_route_value_context); + $IGhandle_method = $IGoption_route_value_context[0]; + $IGsearch_method = $IGoption_route_value_context[1]; + $IGlist_id = $IGoption_route_value_context[2]; + $IGcampaign_id = $IGoption_route_value_context[3]; + $IGphone_code = $IGoption_route_value_context[4]; + echo ""; + echo "In-Group:"; + echo ""; + echo " "; + echo " "; + echo "   Handle Method: \n"; + echo "
Search Method: \n"; + echo "   List ID: "; + echo "
Campaign ID: \n"; + echo "   Phone Code: "; } if ($option_route=='DID') { @@ -17977,6 +18030,10 @@ if ($ADD==3511) echo ""; echo " \n"; } + if ($option_route=='HANGUP') + { + echo "Audio File: audio chooser\n"; + } if ($option_route=='EXTENSION') { echo "Extension:   Context: \n"; @@ -18021,8 +18078,9 @@ if ($ADD==3511) Description: Route: ' + call_menu_list + "\n" + selected_value + ''; } - if (selected_route=='HANGUP') + if (selected_route=='INGROUP') { + if (value_context.length < 10) + {value_context = 'CID,LB,998,TESTCAMP,1';} + var value_context_split = value_context.split(","); + var IGhandle_method = value_context_split[0]; + var IGsearch_method = value_context_split[1]; + var IGlist_id = value_context_split[2]; + var IGcampaign_id = value_context_split[3]; + var IGphone_code = value_context_split[4]; + if (route == selected_route) { - selected_value = value; + selected_value = ''; } - new_content = "Audio File: audio chooser"; + + new_content = ''; + new_content = new_content + 'In-Group: '; + new_content = new_content + ''; + new_content = new_content + '   Handle Method: '; + new_content = new_content + '
Search Method: '; + new_content = new_content + '   List ID: '; + new_content = new_content + '
Campaign ID: '; + new_content = new_content + '   Phone Code: '; } if (selected_route=='DID') { @@ -563,6 +616,14 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 } new_content = 'DID: '; } + if (selected_route=='HANGUP') + { + if (route == selected_route) + { + selected_value = value; + } + new_content = "Audio File: audio chooser"; + } if (selected_route=='EXTENSION') { if (route == selected_route) @@ -622,11 +683,15 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511 if (route=='CALLMENU') { - new_content = "Call Menu:"; + new_content = 'Call Menu:'; + } + if (route=='INGROUP') + { + new_content = 'In-Group:'; } if (route=='DID') { - new_content = "DID:"; + new_content = 'DID:'; } if (new_content.length < 1)