Add a missing file sip_profile_copy.php to the dev branch.

This commit is contained in:
Mark Crane
2012-06-04 14:58:40 +00:00
commit af103e9c41
1240 changed files with 164946 additions and 0 deletions
+457
View File
@@ -0,0 +1,457 @@
<?php
//application details
$apps[$x]['name'] = "Call Center";
$apps[$x]['uuid'] = '95788e50-9500-079e-2807-fd530b0ea370';
$apps[$x]['category'] = 'Switch';;
$apps[$x]['subcategory'] = '';
$apps[$x]['version'] = '';
$apps[$x]['license'] = 'Mozilla Public License 1.1';
$apps[$x]['url'] = 'http://www.fusionpbx.com';
$apps[$x]['description']['en'] = 'Queues for managing inbound calls and routing those calls to available agents.';
//menu details
$apps[$x]['menu'][0]['title']['en'] = 'Call Center';
$apps[$x]['menu'][0]['uuid'] = '6c072b29-5b6c-49fc-008e-95e24c77de99';
$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
$apps[$x]['menu'][0]['category'] = 'internal';
$apps[$x]['menu'][0]['path'] = '/app/call_center/v_call_center_queue.php';
$apps[$x]['menu'][0]['groups'][] = 'agent';
$apps[$x]['menu'][0]['groups'][] = 'admin';
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
$apps[$x]['menu'][1]['title']['en'] = 'Agent Status';
$apps[$x]['menu'][1]['uuid'] = '597c483a-51a9-f95a-8d54-ea7d87ada2b8';
$apps[$x]['menu'][1]['parent_uuid'] = '0438b504-8613-7887-c420-c837ffb20cb1';
$apps[$x]['menu'][1]['category'] = 'internal';
$apps[$x]['menu'][1]['path'] = '/app/call_center/v_call_center_agent_status.php';
$apps[$x]['menu'][1]['groups'][] = 'agent_admin';
$apps[$x]['menu'][1]['groups'][] = 'admin';
$apps[$x]['menu'][1]['groups'][] = 'superadmin';
//permission details
$apps[$x]['permissions'][0]['name'] = 'call_center_queues_view';
$apps[$x]['permissions'][0]['groups'][] = 'agent';
$apps[$x]['permissions'][0]['groups'][] = 'admin';
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
$apps[$x]['permissions'][1]['name'] = 'call_center_queues_add';
$apps[$x]['permissions'][1]['groups'][] = 'admin';
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
$apps[$x]['permissions'][2]['name'] = 'call_center_queues_edit';
$apps[$x]['permissions'][2]['groups'][] = 'admin';
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
$apps[$x]['permissions'][3]['name'] = 'call_center_queues_delete';
$apps[$x]['permissions'][3]['groups'][] = 'admin';
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
$apps[$x]['permissions'][4]['name'] = 'call_center_agents_view';
$apps[$x]['permissions'][0]['groups'][] = 'agent';
$apps[$x]['permissions'][4]['groups'][] = 'admin';
$apps[$x]['permissions'][4]['groups'][] = 'superadmin';
$apps[$x]['permissions'][5]['name'] = 'call_center_agents_add';
$apps[$x]['permissions'][5]['groups'][] = 'admin';
$apps[$x]['permissions'][5]['groups'][] = 'superadmin';
$apps[$x]['permissions'][6]['name'] = 'call_center_agents_edit';
$apps[$x]['permissions'][6]['groups'][] = 'admin';
$apps[$x]['permissions'][6]['groups'][] = 'superadmin';
$apps[$x]['permissions'][7]['name'] = 'call_center_agents_delete';
$apps[$x]['permissions'][7]['groups'][] = 'admin';
$apps[$x]['permissions'][7]['groups'][] = 'superadmin';
$apps[$x]['permissions'][8]['name'] = 'call_center_tiers_view';
$apps[$x]['permissions'][0]['groups'][] = 'agent';
$apps[$x]['permissions'][8]['groups'][] = 'admin';
$apps[$x]['permissions'][8]['groups'][] = 'superadmin';
$apps[$x]['permissions'][9]['name'] = 'call_center_tiers_add';
$apps[$x]['permissions'][9]['groups'][] = 'admin';
$apps[$x]['permissions'][9]['groups'][] = 'superadmin';
$apps[$x]['permissions'][10]['name'] = 'call_center_tiers_edit';
$apps[$x]['permissions'][10]['groups'][] = 'admin';
$apps[$x]['permissions'][10]['groups'][] = 'superadmin';
$apps[$x]['permissions'][11]['name'] = 'call_center_tiers_delete';
$apps[$x]['permissions'][11]['groups'][] = 'admin';
$apps[$x]['permissions'][11]['groups'][] = 'superadmin';
//schema details
$y = 0; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_call_center_agents';
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'call_center_agent_id';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_center_agent_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_type';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_call_timeout';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_contact';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_status';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_logout';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_max_no_answer';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_wrap_up_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_reject_delay_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_busy_delay_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_no_answer_delay_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$y = 1; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_call_center_logs';
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'cc_id';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_queue';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_action';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_count';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent_system';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent_status';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent_state';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_selection';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_cause';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_wait_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_talk_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_total_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_epoch';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_date';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamp';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'timestamp';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent_type';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_member_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_member_session_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_member_cid_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_member_cid_number';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent_called_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_agent_answered_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_member_joined_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_member_leaving_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_bridge_terminated_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'cc_hangup_cause';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$y = 2; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_call_center_queues';
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'call_center_queue_id';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_center_queue_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'dialplan_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_dialplans';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'dialplan_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_extension';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_strategy';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_moh_sound';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_record_template';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_time_base_score';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_max_wait_time';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_max_wait_time_with_no_agent';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_tier_rules_apply';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_tier_rule_wait_second';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_tier_rule_no_agent_no_wait';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_timeout_action';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_discard_abandoned_after';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_abandoned_resume_allowed';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_tier_rule_wait_multiply_level';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_cid_prefix';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$y = 3; //table array index
$z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_call_center_tiers';
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'call_center_tier_id';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_center_tier_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'agent_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'queue_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'tier_level';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'tier_position';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
?>
+50
View File
@@ -0,0 +1,50 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
// make sure the PATH_SEPARATOR is defined
if (!defined("PATH_SEPARATOR")) {
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
}
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
// if the project directory exists then add it to the include path otherwise add the document root to the include path
if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
}
else {
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
}
?>
+190
View File
@@ -0,0 +1,190 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_agents_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "includes/header.php";
require_once "includes/paging.php";
//get http values and set them to php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//show content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br>";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Call Center Agent List</b></td>\n";
echo "<td width='50%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_call_center_agent_status.php'\" value='Status'>\n";
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_call_center_queue.php'\" value='Back'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "List of call center agents.<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</tr></table>\n";
$sql = "";
$sql .= "select * from v_call_center_agents ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by) == 0) {
$order_by = 'agent_name';
$order = 'asc';
}
else {
$sql .= "order by $order_by $order ";
}
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$num_rows = count($result);
unset ($prep_statement, $result, $sql);
$rows_per_page = 100;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
$sql = "";
$sql .= " select * from v_call_center_agents ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by) == 0) {
$order_by = 'agent_name';
$order = 'asc';
}
else {
$sql .= "order by $order_by $order ";
}
$sql .= " limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
//echo th_order_by('domain_uuid', 'domain_uuid', $order_by, $order);
echo th_order_by('agent_name', 'Agent Name', $order_by, $order);
echo th_order_by('agent_type', 'Type', $order_by, $order);
echo th_order_by('agent_call_timeout', 'Call Timeout', $order_by, $order);
echo th_order_by('agent_contact', 'Contact', $order_by, $order);
echo th_order_by('agent_max_no_answer', 'Max No Answer', $order_by, $order);
echo th_order_by('agent_status', 'Status', $order_by, $order);
//echo th_order_by('agent_wrap_up_time', 'Wrap Up Time', $order_by, $order);
//echo th_order_by('agent_reject_delay_time', 'Reject Delay Time', $order_by, $order);
//echo th_order_by('agent_busy_delay_time', 'Busy Delay Time', $order_by, $order);
echo "<td align='right' width='42'>\n";
if (permission_exists('call_center_agents_add')) {
echo " <a href='v_call_center_agent_edit.php' alt='add'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
if ($result_count == 0) { //no results
}
else { //received results
foreach($result as $row) {
echo "<tr >\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[domain_uuid]."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_name]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_type]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_call_timeout]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_contact]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_max_no_answer]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_status]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_wrap_up_time]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_reject_delay_time]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_busy_delay_time]."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('call_center_agents_edit')) {
echo " <a href='v_call_center_agent_edit.php?id=".$row[call_center_agent_uuid]."' alt='edit'>$v_link_label_edit</a>\n";
}
if (permission_exists('call_center_agents_delete')) {
echo " <a href='v_call_center_agent_delete.php?id=".$row[call_center_agent_uuid]."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
}
//echo " <input type='button' class='btn' name='' alt='edit' onclick=\"window.location='v_call_center_agent_edit.php?id=".$row[call_center_agent_uuid]."'\" value='e'>\n";
//echo " <input type='button' class='btn' name='' alt='delete' onclick=\"if (confirm('Are you sure you want to delete this?')) { window.location='v_call_center_agent_delete.php?id=".$row[call_center_agent_uuid]."' }\" value='x'>\n";
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='11' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('call_center_agents_add')) {
echo " <a href='v_call_center_agent_edit.php' alt='add'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br><br>";
echo "<br><br>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br><br>";
//show the footer
require_once "includes/footer.php";
?>
@@ -0,0 +1,85 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_agents_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
}
//get the agent details
$sql = "";
$sql .= "select * from v_call_center_agents ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_agent_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$agent_name = $row["agent_name"];
break; //limit to 1 row
}
unset ($prep_statement);
//delete the agent from the freeswitch
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//delete the agent over event socket
if ($fp) {
$cmd = "api callcenter_config agent del ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name'];
$response = event_socket_request($fp, $cmd);
}
//delete the agent from the db
if (strlen($id)>0) {
$sql = "";
$sql .= "delete from v_call_center_agents ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_agent_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
//redirect the user
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_agent.php\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
?>
@@ -0,0 +1,513 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_agents_add') || permission_exists('call_center_agents_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$call_center_agent_uuid = check_str($_REQUEST["id"]);
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (count($_POST)>0) {
$agent_name = check_str($_POST["agent_name"]);
$agent_type = check_str($_POST["agent_type"]);
$agent_call_timeout = check_str($_POST["agent_call_timeout"]);
$agent_contact = check_str($_POST["agent_contact"]);
$agent_status = check_str($_POST["agent_status"]);
$agent_logout = check_str($_POST["agent_logout"]);
$agent_no_answer_delay_time = check_str($_POST["agent_no_answer_delay_time"]);
$agent_max_no_answer = check_str($_POST["agent_max_no_answer"]);
$agent_wrap_up_time = check_str($_POST["agent_wrap_up_time"]);
$agent_reject_delay_time = check_str($_POST["agent_reject_delay_time"]);
$agent_busy_delay_time = check_str($_POST["agent_busy_delay_time"]);
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
if ($action == "update") {
$call_center_agent_uuid = check_str($_POST["call_center_agent_uuid"]);
}
//check for all required data
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($agent_name) == 0) { $msg .= "Please provide: Agent Name<br>\n"; }
//if (strlen($agent_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
//if (strlen($agent_call_timeout) == 0) { $msg .= "Please provide: Call Timeout<br>\n"; }
//if (strlen($agent_contact) == 0) { $msg .= "Please provide: Contact<br>\n"; }
//if (strlen($agent_status) == 0) { $msg .= "Please provide: Status<br>\n"; }
//if (strlen($agent_logout) == 0) { $msg .= "Please provide: Logout<br>\n"; }
//if (strlen($agent_no_answer_delay_time) == 0) { $msg .= "Please provide: No Answer Delay Time<br>\n"; }
//if (strlen($agent_max_no_answer) == 0) { $msg .= "Please provide: Max No Answer<br>\n"; }
//if (strlen($agent_wrap_up_time) == 0) { $msg .= "Please provide: Wrap Up Time<br>\n"; }
//if (strlen($agent_reject_delay_time) == 0) { $msg .= "Please provide: Reject Delay Time<br>\n"; }
//if (strlen($agent_busy_delay_time) == 0) { $msg .= "Please provide: Busy Delay Time<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "includes/footer.php";
return;
}
//get and then set the complete agent_contact with the call_timeout and when necessary confirm
$tmp_confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1";
if(strstr($agent_contact, '}') === FALSE) {
//not found
if(stristr($agent_contact, 'sofia/gateway') === FALSE) {
//add the call_timeout
$tmp_agent_contact = "{call_timeout=".$agent_call_timeout."}".$agent_contact;
}
else {
//add the call_timeout and confirm
$tmp_agent_contact = $tmp_first.',call_timeout='.$agent_call_timeout.$tmp_last;
$tmp_agent_contact = "{".$tmp_confirm.",call_timeout=".$agent_call_timeout."}".$agent_contact;
}
}
else {
//found
if(stristr($agent_contact, 'sofia/gateway') === FALSE) {
//not found
if(stristr($agent_contact, 'call_timeout') === FALSE) {
//add the call_timeout
$tmp_pos = strrpos($agent_contact, "}");
$tmp_first = substr($agent_contact, 0, $tmp_pos);
$tmp_last = substr($agent_contact, $tmp_pos);
$tmp_agent_contact = $tmp_first.',call_timeout='.$agent_call_timeout.$tmp_last;
}
else {
//the string has the call timeout
$tmp_agent_contact = $agent_contact;
}
}
else {
//found
$tmp_pos = strrpos($agent_contact, "}");
$tmp_first = substr($agent_contact, 0, $tmp_pos);
$tmp_last = substr($agent_contact, $tmp_pos);
if(stristr($agent_contact, 'call_timeout') === FALSE) {
//add the call_timeout and confirm
$tmp_agent_contact = $tmp_first.','.$tmp_confirm.',call_timeout='.$agent_call_timeout.$tmp_last;
}
else {
//add confirm
$tmp_agent_contact = $tmp_first.','.$tmp_confirm.$tmp_last;
}
}
}
//set the user_status
$sql = "update v_users set ";
$sql .= "user_status = '".$agent_status."' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and username = '".$agent_name."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
//add the agent
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//add the agent using event socket
if ($fp) {
//add the agent
$cmd = "api callcenter_config agent add ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$agent_type;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set contact
$cmd = "api callcenter_config agent set contact ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$tmp_agent_contact;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set status
$cmd = "api callcenter_config agent set status ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." '".$agent_status."'";
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set reject_delay_time
$cmd = "api callcenter_config agent set reject_delay_time ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$agent_reject_delay_time;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set busy_delay_time
$cmd = "api callcenter_config agent set busy_delay_time ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name']." ".$agent_busy_delay_time;
$response = event_socket_request($fp, $cmd);
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add") {
//add the agent to the database
$call_center_agent_uuid = uuid();
$sql = "insert into v_call_center_agents ";
$sql .= "(";
$sql .= "domain_uuid, ";
$sql .= "call_center_agent_uuid, ";
$sql .= "agent_name, ";
$sql .= "agent_type, ";
$sql .= "agent_call_timeout, ";
$sql .= "agent_contact, ";
$sql .= "agent_status, ";
$sql .= "agent_logout, ";
$sql .= "agent_no_answer_delay_time, ";
$sql .= "agent_max_no_answer, ";
$sql .= "agent_wrap_up_time, ";
$sql .= "agent_reject_delay_time, ";
$sql .= "agent_busy_delay_time ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'$domain_uuid', ";
$sql .= "'$call_center_agent_uuid', ";
$sql .= "'$agent_name', ";
$sql .= "'$agent_type', ";
$sql .= "'$agent_call_timeout', ";
$sql .= "'$agent_contact', ";
$sql .= "'$agent_status', ";
$sql .= "'$agent_logout', ";
$sql .= "'$agent_no_answer_delay_time', ";
$sql .= "'$agent_max_no_answer', ";
$sql .= "'$agent_wrap_up_time', ";
$sql .= "'$agent_reject_delay_time', ";
$sql .= "'$agent_busy_delay_time' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
//syncrhonize configuration
save_call_center_xml();
//redirect the user
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_agent.php\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "add")
if ($action == "update") {
$sql = "update v_call_center_agents set ";
$sql .= "agent_name = '$agent_name', ";
$sql .= "agent_type = '$agent_type', ";
$sql .= "agent_call_timeout = '$agent_call_timeout', ";
$sql .= "agent_contact = '$agent_contact', ";
$sql .= "agent_status = '$agent_status', ";
$sql .= "agent_logout = '$agent_logout', ";
$sql .= "agent_no_answer_delay_time = '$agent_no_answer_delay_time', ";
$sql .= "agent_max_no_answer = '$agent_max_no_answer', ";
$sql .= "agent_wrap_up_time = '$agent_wrap_up_time', ";
$sql .= "agent_reject_delay_time = '$agent_reject_delay_time', ";
$sql .= "agent_busy_delay_time = '$agent_busy_delay_time' ";
$sql .= "where domain_uuid = '$domain_uuid'";
$sql .= "and call_center_agent_uuid = '$call_center_agent_uuid'";
$db->exec(check_sql($sql));
unset($sql);
//syncrhonize configuration
save_call_center_xml();
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_agent.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$call_center_agent_uuid = $_GET["id"];
$sql = "";
$sql .= "select * from v_call_center_agents ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_agent_uuid = '$call_center_agent_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$agent_name = $row["agent_name"];
$agent_type = $row["agent_type"];
$agent_call_timeout = $row["agent_call_timeout"];
$agent_contact = $row["agent_contact"];
$agent_status = $row["agent_status"];
$agent_logout = $row["agent_logout"];
$agent_no_answer_delay_time = $row["agent_no_answer_delay_time"];
$agent_max_no_answer = $row["agent_max_no_answer"];
$agent_wrap_up_time = $row["agent_wrap_up_time"];
$agent_reject_delay_time = $row["agent_reject_delay_time"];
$agent_busy_delay_time = $row["agent_busy_delay_time"];
break; //limit to 1 row
}
unset ($prep_statement);
}
//set default values
if (strlen($agent_type) == 0) { $agent_type = "callback"; }
if (strlen($agent_call_timeout) == 0) { $agent_call_timeout = 10; }
if (strlen($agent_max_no_answer) == 0) { $agent_max_no_answer = "3"; }
if (strlen($agent_wrap_up_time) == 0) { $agent_wrap_up_time = "10"; }
if (strlen($agent_no_answer_delay_time) == 0) { $agent_no_answer_delay_time = "10"; }
if (strlen($agent_reject_delay_time) == 0) { $agent_reject_delay_time = "10"; }
if (strlen($agent_busy_delay_time) == 0) { $agent_busy_delay_time = "60"; }
//show the header
require_once "includes/header.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
if ($action == "add") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>Call Center Agent Add</b></td>\n";
}
if ($action == "update") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>Call Center Agent Edit</b></td>\n";
}
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_call_center_agent.php'\" value='Back'></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
//echo "Call Center agents settings.<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Agent Name:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//---- Begin Select List --------------------
$sql = "SELECT * FROM v_users ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "order by username asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
echo "<select id=\"agent_name\" name=\"agent_name\" class='formfld'>\n";
echo "<option value=\"\"></option>\n";
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
//$catcount = count($result);
foreach($result as $field) {
if ($field[username] == $agent_name) {
echo "<option value='".$field[username]."' selected='selected'>".$field[username]."</option>\n";
}
else {
echo "<option value='".$field[username]."'>".$field[username]."</option>\n";
}
}
echo "</select>";
unset($sql, $result);
//---- End Select List --------------------
echo "<br />\n";
echo "Select the agents name.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Type:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_type' maxlength='255' value=\"$agent_type\">\n";
echo "<br />\n";
echo "Enter the agent type.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Call Timeout:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_call_timeout' maxlength='255' value='$agent_call_timeout'>\n";
echo "<br />\n";
echo "Enter the call timeout.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Contact:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//switch_select_destination(select_type, select_label, select_name, select_value, select_style, action);
switch_select_destination("call_center_contact", "", "agent_contact", $agent_contact, "", "");
echo "<br />\n";
echo "Select the contact number.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Status:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='agent_status'>\n";
echo " <option value=''></option>\n";
if ($agent_status == "Logged Out") {
echo " <option value='Logged Out' SELECTED >Logged Out</option>\n";
}
else {
echo " <option value='Logged Out'>Logged Out</option>\n";
}
if ($agent_status == "Available") {
echo " <option value='Available' SELECTED >Available</option>\n";
}
else {
echo " <option value='Available'>Available</option>\n";
}
if ($agent_status == "Available (On Demand)") {
echo " <option value='Available (On Demand)' SELECTED >Available (On Demand)</option>\n";
}
else {
echo " <option value='Available (On Demand)'>Available (On Demand)</option>\n";
}
if ($agent_status == "On Break") {
echo " <option value='On Break' SELECTED >On Break</option>\n";
}
else {
echo " <option value='On Break'>On Break</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Select the agent status.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " No Answer Delay Time:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_no_answer_delay_time' maxlength='255' value='$agent_no_answer_delay_time'>\n";
echo "<br />\n";
echo "Enter the agent no answer delay time in seconds.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Max No Answer:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_max_no_answer' maxlength='255' value='$agent_max_no_answer'>\n";
echo "<br />\n";
echo "Enter max no answer.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Wrap Up Time:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_wrap_up_time' maxlength='255' value='$agent_wrap_up_time'>\n";
echo "<br />\n";
echo "Enter the wrap up time.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Reject Delay Time:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_reject_delay_time' maxlength='255' value='$agent_reject_delay_time'>\n";
echo "<br />\n";
echo "Enter the reject delay time.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Busy Delay Time:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_busy_delay_time' maxlength='255' value='$agent_busy_delay_time'>\n";
echo "<br />\n";
echo "Enter the agent busy delay time.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Agent Logout:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='agent_logout' maxlength='255' value='$agent_logout'>\n";
echo "<br />\n";
echo "Enter the auto agent logout time in 00:00 format. Requires a service to enforce the logout time.\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='call_center_agent_uuid' value='$call_center_agent_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
//footer
require_once "includes/footer.php";
?>
@@ -0,0 +1,235 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_agents_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "includes/header.php";
require_once "includes/paging.php";
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//get the http post values and set them as php variables
if (count($_POST)>0) {
//include the dnd php class
include "includes/classes/do_not_disturb.php";
foreach($_POST['agents'] as $row) {
if (strlen($row['status']) > 0) {
//agent set status
if ($fp) {
//set the user_status
$sql = "update v_users set ";
$sql .= "user_status = '".$row['status']."' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and username = '".$row['name']."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
//set the call center status
if ($row['status'] == "Do Not Disturb") {
//set the default dnd action
$dnd_action = "add";
//set the call center status to Logged Out
$cmd = "api callcenter_config agent set status ".$row['name']."@".$_SESSION['domains'][$domain_uuid]['domain_name']." 'Logged Out'";
}
else {
$cmd = "api callcenter_config agent set status ".$row['name']."@".$_SESSION['domains'][$domain_uuid]['domain_name']." '".$row['status']."'";
}
//echo $cmd."<br />\n";
$response = event_socket_request($fp, $cmd);
usleep(200);
}
//loop through the list of assigned extensions
foreach ($_SESSION['user']['extension'] as &$sub_row) {
$extension = $sub_row["user"];
//hunt_group information used to determine if this is an add or an update
$sql = "select * from v_hunt_groups ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and hunt_group_extension = '$extension' ";
$prep_statement_2 = $db->prepare(check_sql($sql));
$prep_statement_2->execute();
$result2 = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
foreach ($result2 as &$row2) {
if ($row2["hunt_group_type"] == 'dnd') {
$dnd_action = "update";
$dnd_uuid = $row2["hunt_group_uuid"];
}
}
unset ($prep_statement_2, $result2, $row2);
//add or update dnd
$dnd = new do_not_disturb;
//$dnd->debug = false;
$dnd->domain_uuid = $domain_uuid;
$dnd->dnd_uuid = $dnd_uuid;
$dnd->domain_name = $_SESSION['domain_name'];
$dnd->extension = $extension;
if ($row['status'] == "Do Not Disturb") {
$dnd->dnd_enabled = "true";
if ($dnd_action == "add") {
$dnd->dnd_add();
}
if ($dnd_action == "update") {
$dnd->dnd_update();
}
}
else {
//for other status disable dnd
if ($dnd_action == "update") {
$dnd->dnd_enabled = "false";
$dnd->dnd_update();
}
}
unset($dnd);
}
unset ($prep_statement);
}
}
}
//get the agent list from event socket
$switch_cmd = 'callcenter_config agent list';
$event_socket_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
$agent_array = csv_to_named_array($event_socket_str, '|');
//set the status on the user_array by using the extension as the key
foreach ($agent_array as $row) {
if (count($_SESSION['domains']) == 1) {
//get the extension status from the call center agent list
preg_match('/user\/(\d{2,7})/', $row['contact'], $matches);
$extension = $matches[1];
$user_array[$extension]['username'] = $tmp[0];
if ($user_array[$extension]['user_status'] != "Do Not Disturb") {
$user_array[$extension]['user_status'] = $row['status'];
}
} else {
$tmp = explode('@',$row["name"]);
if ($tmp[1] == $_SESSION['domain_name']) {
//get the extension status from the call center agent list
preg_match('/user\/(\d{2,7})/', $row['contact'], $matches);
$extension = $matches[1];
$user_array[$extension]['username'] = $tmp[0];
if ($user_array[$extension]['user_status'] != "Do Not Disturb") {
$user_array[$extension]['user_status'] = $row['status'];
}
}
}
}
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br>";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Call Center Agent Status</b></td>\n";
echo "<td width='50%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_call_center_agent_status.php'\" value='Refresh'>\n";
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_call_center_queue.php'\" value='Back'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "List all the call center agents with the option to change the status of one or more agents.<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</tr></table>\n";
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>Agent</th>\n";
echo "<th>Status</th>\n";
echo "<th>Options</th>\n";
echo "<tr>\n";
$x = 0;
foreach($agent_array as $row) {
$tmp = explode('@',$row["name"]);
$agent_name = $tmp[0];
if ($tmp[1] == $_SESSION['domain_name']) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['status']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
echo " <input type='hidden' name='agents[".$x."][name]' id='agent_".$x."_name' value='".$agent_name."'>\n";
echo " <input type='radio' name='agents[".$x."][status]' id='agent_".$x."_status_no_change' value='' checked='checked'><label for='agent_".$x."_status_no_change'>No Change</label>\n";
echo " <input type='radio' name='agents[".$x."][status]' id='agent_".$x."_status_available' value='Available'><label for='agent_".$x."_status_available'>Available</label>\n";
echo " <input type='radio' name='agents[".$x."][status]' id='agent_".$x."_status_logged_out' value='Logged Out'><label for='agent_".$x."_status_logged_out'>Logged Out</label>\n";
echo " <input type='radio' name='agents[".$x."][status]' id='agent_".$x."_status_on_break' value='On Break'><label for='agent_".$x."_status_on_break'>On Break</label>\n";
echo " <input type='radio' name='agents[".$x."][status]' id='agent_".$x."_status_dnd' value='Do Not Disturb'><label for='agent_".$x."_status_dnd'>DND</label>\n";
echo " </td>\n";
echo "</tr>\n";
}
if ($c==0) { $c=1; } else { $c=0; }
$x++;
} //end foreach
unset($sql, $result, $row_count);
echo "<tr>\n";
echo "<td colspan='11' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
echo " <br />\n";
echo " <input type='submit' name='submit' class='btn' value='Update Status'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br><br>";
echo "<br><br>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "</form>\n";
echo "<br><br>";
//show the footer
require_once "includes/footer.php";
?>
+194
View File
@@ -0,0 +1,194 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_queues_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "includes/header.php";
require_once "includes/paging.php";
//get http variables and set as php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br>";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Call Center Queue</b></td>\n";
echo "<td width='50%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_call_center_agent.php'\" value='Agents'>\n";
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_call_center_tier.php'\" value='Tiers'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "List of queues for the call center.<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</tr></table>\n";
$sql = "";
$sql .= "select * from v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by) == 0) {
$order_by = 'queue_name';
$order = 'asc';
}
else {
$sql .= "order by $order_by $order ";
}
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$num_rows = count($result);
unset ($prep_statement, $result, $sql);
$rows_per_page = 100;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
$sql = "";
$sql .= "select * from v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by) == 0) {
$order_by = 'queue_name';
$order = 'asc';
}
else {
$sql .= "order by $order_by $order ";
}
$sql .= " limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('queue_name', 'Queue Name', $order_by, $order);
echo th_order_by('queue_extension', 'Extension', $order_by, $order);
echo th_order_by('queue_strategy', 'Strategy', $order_by, $order);
//echo th_order_by('queue_moh_sound', 'Music On Hold', $order_by, $order);
//echo th_order_by('queue_record_template', 'Record Template', $order_by, $order);
//echo th_order_by('queue_time_base_score', 'Time Base Score', $order_by, $order);
//echo th_order_by('queue_max_wait_time', 'Max Wait Time', $order_by, $order);
//echo th_order_by('queue_max_wait_time_with_no_agent', 'Max Wait Time With No Agent', $order_by, $order);
echo th_order_by('queue_tier_rules_apply', 'Tier Rules Apply', $order_by, $order);
//echo th_order_by('queue_tier_rule_wait_second', 'Tier Rule Wait Second', $order_by, $order);
//echo th_order_by('queue_tier_rule_no_agent_no_wait', 'Tier Rule No Agent No Wait', $order_by, $order);
//echo th_order_by('queue_discard_abandoned_after', 'Discard Abandoned After', $order_by, $order);
//echo th_order_by('queue_abandoned_resume_allowed', 'Abandoned Resume Allowed', $order_by, $order);
//echo th_order_by('queue_tier_rule_wait_multiply_level', 'Tier Rule Wait Multiply Level', $order_by, $order);
echo th_order_by('queue_description', 'Description', $order_by, $order);
echo "<td align='right' width='42'>\n";
if (permission_exists('call_center_queues_add')) {
echo " <a href='v_call_center_queue_edit.php' alt='add'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
if ($result_count > 0) {
foreach($result as $row) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_name]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_extension]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_strategy]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_moh_sound]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_record_template]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_time_base_score]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_max_wait_time]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_max_wait_time_with_no_agent]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_tier_rules_apply]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_tier_rule_wait_second]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_tier_rule_no_agent_no_wait]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_discard_abandoned_after]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_abandoned_resume_allowed]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_tier_rule_wait_multiply_level]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_description]."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('call_center_queues_edit')) {
echo " <a href='v_call_center_queue_edit.php?id=".$row[call_center_queue_uuid]."' alt='edit'>$v_link_label_edit</a>\n";
}
if (permission_exists('call_center_queues_delete')) {
echo " <a href='v_call_center_queue_delete.php?id=".$row[call_center_queue_uuid]."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='17' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('call_center_queues_add')) {
echo " <a href='v_call_center_queue_edit.php' alt='add'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br><br>";
echo "<br><br>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br><br>";
//show the footer
require_once "includes/footer.php";
?>
@@ -0,0 +1,93 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_queues_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
if (count($_GET) > 0) {
$id = check_str($_GET["id"]);
}
if (strlen($id) > 0) {
//get the dialplan uuid
$sql = "select * from v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_queue_uuid = '$id' ";
$prep_statement = $db->prepare($sql);
$prep_statement->execute();
while($row = $prep_statement->fetch(PDO::FETCH_ASSOC)) {
$dialplan_uuid = $row['dialplan_uuid'];
}
//delete the call center queue
$sql = "delete from v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
//delete the dialplan entry
$sql = "delete from v_dialplans ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
//echo $sql."<br>\n";
$db->query($sql);
unset($sql);
//delete the dialplan details
$sql = "delete from v_dialplan_details ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
//echo $sql."<br>\n";
$db->query($sql);
unset($sql);
//syncrhonize configuration
save_dialplan_xml();
//apply settings reminder
$_SESSION["reload_xml"] = true;
}
//redirect the browser
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_queue.php\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
?>
@@ -0,0 +1,633 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_queues_add') || permission_exists('call_center_queues_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$call_center_queue_uuid = check_str($_REQUEST["id"]);
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (count($_POST)>0) {
//$domain_uuid = check_str($_POST["domain_uuid"]);
$queue_name = check_str($_POST["queue_name"]);
$queue_extension = check_str($_POST["queue_extension"]);
$queue_strategy = check_str($_POST["queue_strategy"]);
$queue_moh_sound = check_str($_POST["queue_moh_sound"]);
$queue_record_template = check_str($_POST["queue_record_template"]);
$queue_time_base_score = check_str($_POST["queue_time_base_score"]);
$queue_max_wait_time = check_str($_POST["queue_max_wait_time"]);
$queue_max_wait_time_with_no_agent = check_str($_POST["queue_max_wait_time_with_no_agent"]);
$queue_tier_rules_apply = check_str($_POST["queue_tier_rules_apply"]);
$queue_tier_rule_wait_second = check_str($_POST["queue_tier_rule_wait_second"]);
$queue_tier_rule_wait_multiply_level = check_str($_POST["queue_tier_rule_wait_multiply_level"]);
$queue_tier_rule_no_agent_no_wait = check_str($_POST["queue_tier_rule_no_agent_no_wait"]);
$queue_timeout_action = check_str($_POST["queue_timeout_action"]);
$queue_discard_abandoned_after = check_str($_POST["queue_discard_abandoned_after"]);
$queue_abandoned_resume_allowed = check_str($_POST["queue_abandoned_resume_allowed"]);
$queue_cid_prefix = check_str($_POST["queue_cid_prefix"]);
$queue_description = check_str($_POST["queue_description"]);
//remove invalid characters
$queue_cid_prefix = str_replace(":", "-", $queue_cid_prefix);
$queue_cid_prefix = str_replace("\"", "", $queue_cid_prefix);
$queue_cid_prefix = str_replace("@", "", $queue_cid_prefix);
$queue_cid_prefix = str_replace("\\", "", $queue_cid_prefix);
$queue_cid_prefix = str_replace("/", "", $queue_cid_prefix);
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
if ($action == "update") {
$call_center_queue_uuid = check_str($_POST["call_center_queue_uuid"]);
}
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
if (strlen($queue_name) == 0) { $msg .= "Please provide: Queue Name<br>\n"; }
if (strlen($queue_extension) == 0) { $msg .= "Please provide: Extension<br>\n"; }
if (strlen($queue_strategy) == 0) { $msg .= "Please provide: Strategy<br>\n"; }
if (strlen($queue_moh_sound) == 0) { $msg .= "Please provide: Music on Hold<br>\n"; }
//if (strlen($queue_record_template) == 0) { $msg .= "Please provide: Record Template<br>\n"; }
//if (strlen($queue_time_base_score) == 0) { $msg .= "Please provide: Time Base Score<br>\n"; }
//if (strlen($queue_max_wait_time) == 0) { $msg .= "Please provide: Max Wait Time<br>\n"; }
//if (strlen($queue_max_wait_time_with_no_agent) == 0) { $msg .= "Please provide: Max Wait Time with no Agent<br>\n"; }
//if (strlen($queue_tier_rules_apply) == 0) { $msg .= "Please provide: Tier Rules Apply<br>\n"; }
//if (strlen($queue_tier_rule_wait_second) == 0) { $msg .= "Please provide: Tier Rule Wait Second<br>\n"; }
//if (strlen($queue_tier_rule_wait_multiply_level) == 0) { $msg .= "Please provide: Tier Rule Wait Multiply Level<br>\n"; }
//if (strlen($queue_tier_rule_no_agent_no_wait) == 0) { $msg .= "Please provide: Tier Rule No Agent No Wait<br>\n"; }
//if (strlen($queue_timeout_action) == 0) { $msg .= "Please provide: Timeout Action<br>\n"; }
//if (strlen($queue_discard_abandoned_after) == 0) { $msg .= "Please provide: Discard Abandoned After<br>\n"; }
//if (strlen($queue_abandoned_resume_allowed) == 0) { $msg .= "Please provide: Abandoned Resume Allowed<br>\n"; }
//if (strlen($queue_cid_prefix) == 0) { $msg .= "Please provide: Caller ID Prefix<br>\n"; }
//if (strlen($queue_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "includes/footer.php";
return;
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add") {
//add the call center queue
$call_center_queue_uuid = uuid();
$sql = "insert into v_call_center_queues ";
$sql .= "(";
$sql .= "domain_uuid, ";
$sql .= "call_center_queue_uuid, ";
$sql .= "queue_name, ";
$sql .= "queue_extension, ";
$sql .= "queue_strategy, ";
$sql .= "queue_moh_sound, ";
$sql .= "queue_record_template, ";
$sql .= "queue_time_base_score, ";
$sql .= "queue_max_wait_time, ";
$sql .= "queue_max_wait_time_with_no_agent, ";
$sql .= "queue_tier_rules_apply, ";
$sql .= "queue_tier_rule_wait_second, ";
$sql .= "queue_tier_rule_wait_multiply_level, ";
$sql .= "queue_tier_rule_no_agent_no_wait, ";
$sql .= "queue_timeout_action, ";
$sql .= "queue_discard_abandoned_after, ";
$sql .= "queue_abandoned_resume_allowed, ";
$sql .= "queue_cid_prefix, ";
$sql .= "queue_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'$domain_uuid', ";
$sql .= "'$call_center_queue_uuid', ";
$sql .= "'$queue_name', ";
$sql .= "'$queue_extension', ";
$sql .= "'$queue_strategy', ";
$sql .= "'$queue_moh_sound', ";
$sql .= "'$queue_record_template', ";
$sql .= "'$queue_time_base_score', ";
$sql .= "'$queue_max_wait_time', ";
$sql .= "'$queue_max_wait_time_with_no_agent', ";
$sql .= "'$queue_tier_rules_apply', ";
$sql .= "'$queue_tier_rule_wait_second', ";
$sql .= "'$queue_tier_rule_wait_multiply_level', ";
$sql .= "'$queue_tier_rule_no_agent_no_wait', ";
$sql .= "'$queue_timeout_action', ";
$sql .= "'$queue_discard_abandoned_after', ";
$sql .= "'$queue_abandoned_resume_allowed', ";
$sql .= "'$queue_cid_prefix', ";
$sql .= "'$queue_description' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
//syncrhonize the configuration
save_call_center_xml();
//redirect the user
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_queue.php\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "add")
if ($action == "update") {
//update the call center queue
$sql = "update v_call_center_queues set ";
$sql .= "queue_name = '$queue_name', ";
$sql .= "queue_extension = '$queue_extension', ";
$sql .= "queue_strategy = '$queue_strategy', ";
$sql .= "queue_moh_sound = '$queue_moh_sound', ";
$sql .= "queue_record_template = '$queue_record_template', ";
$sql .= "queue_time_base_score = '$queue_time_base_score', ";
$sql .= "queue_max_wait_time = '$queue_max_wait_time', ";
$sql .= "queue_max_wait_time_with_no_agent = '$queue_max_wait_time_with_no_agent', ";
$sql .= "queue_tier_rules_apply = '$queue_tier_rules_apply', ";
$sql .= "queue_tier_rule_wait_second = '$queue_tier_rule_wait_second', ";
$sql .= "queue_tier_rule_wait_multiply_level = '$queue_tier_rule_wait_multiply_level', ";
$sql .= "queue_tier_rule_no_agent_no_wait = '$queue_tier_rule_no_agent_no_wait', ";
$sql .= "queue_timeout_action = '$queue_timeout_action', ";
$sql .= "queue_discard_abandoned_after = '$queue_discard_abandoned_after', ";
$sql .= "queue_abandoned_resume_allowed = '$queue_abandoned_resume_allowed', ";
$sql .= "queue_cid_prefix = '$queue_cid_prefix', ";
$sql .= "queue_description = '$queue_description' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_queue_uuid = '$call_center_queue_uuid'";
$db->exec(check_sql($sql));
unset($sql);
//syncrhonize the configuration
save_call_center_xml();
//redirect the user
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_queue.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$call_center_queue_uuid = $_GET["id"];
$sql = "";
$sql .= "select * from v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_queue_uuid = '$call_center_queue_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$queue_name = $row["queue_name"];
$queue_extension = $row["queue_extension"];
$queue_strategy = $row["queue_strategy"];
$queue_moh_sound = $row["queue_moh_sound"];
$queue_record_template = $row["queue_record_template"];
$queue_time_base_score = $row["queue_time_base_score"];
$queue_max_wait_time = $row["queue_max_wait_time"];
$queue_max_wait_time_with_no_agent = $row["queue_max_wait_time_with_no_agent"];
$queue_timeout_action = $row["queue_timeout_action"];
$queue_tier_rules_apply = $row["queue_tier_rules_apply"];
$queue_tier_rule_wait_second = $row["queue_tier_rule_wait_second"];
$queue_tier_rule_wait_multiply_level = $row["queue_tier_rule_wait_multiply_level"];
$queue_tier_rule_no_agent_no_wait = $row["queue_tier_rule_no_agent_no_wait"];
$queue_discard_abandoned_after = $row["queue_discard_abandoned_after"];
$queue_abandoned_resume_allowed = $row["queue_abandoned_resume_allowed"];
$queue_cid_prefix = $row["queue_cid_prefix"];
$queue_description = $row["queue_description"];
break; //limit to 1 row
}
unset ($prep_statement);
}
//set default values
if (strlen($queue_strategy) == 0) { $queue_strategy = "longest-idle-agent"; }
if (strlen($queue_moh_sound) == 0) { $queue_moh_sound = "\$\${hold_music}"; }
if (strlen($queue_time_base_score) == 0) { $queue_time_base_score = "system"; }
if (strlen($queue_max_wait_time) == 0) { $queue_max_wait_time = "0"; }
if (strlen($queue_max_wait_time_with_no_agent) == 0) { $queue_max_wait_time_with_no_agent = "0"; }
if (strlen($queue_tier_rules_apply) == 0) { $queue_tier_rules_apply = "false"; }
if (strlen($queue_tier_rule_wait_second) == 0) { $queue_tier_rule_wait_second = "300"; }
if (strlen($queue_tier_rule_wait_multiply_level) == 0) { $queue_tier_rule_wait_multiply_level = "true"; }
if (strlen($queue_tier_rule_no_agent_no_wait) == 0) { $queue_tier_rule_no_agent_no_wait = "false"; }
if (strlen($queue_discard_abandoned_after) == 0) { $queue_discard_abandoned_after = "60"; }
if (strlen($queue_abandoned_resume_allowed) == 0) { $queue_abandoned_resume_allowed = "false"; }
//show the header
require_once "includes/header.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
if ($action == "add") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>Call Center Queue Add</b></td>\n";
}
if ($action == "update") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>Call Center Queue Edit</b></td>\n";
}
echo "<td width='70%' align='right'>\n";
if ($action == "update") {
echo " <input type='button' class='btn' value='View' onclick=\"document.location.href='".PROJECT_PATH."/app/call_center_active/v_call_center_active.php?queue_name=$queue_name';\" />\n";
echo " <input type='button' class='btn' value='Load' onclick=\"document.location.href='cmd.php?cmd=api+callcenter_config+queue+load+$queue_name@".$_SESSION['domain_name']."';\" />\n";
echo " <input type='button' class='btn' value='Unload' onclick=\"document.location.href='cmd.php?cmd=api+callcenter_config+queue+unload+$queue_name@".$_SESSION['domain_name']."';\" />\n";
echo " <input type='button' class='btn' value='Reload' onclick=\"document.location.href='cmd.php?cmd=api+callcenter_config+queue+reload+$queue_name@".$_SESSION['domain_name']."';\" />\n";
}
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_call_center_queue.php'\" value='Back'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
//echo "Call Center queue settings.<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Queue Name:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_name' maxlength='255' value=\"$queue_name\">\n";
echo "<br />\n";
echo "Enter the queue name.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Extension:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_extension' maxlength='255' value=\"$queue_extension\">\n";
echo "<br />\n";
echo "Enter the extension number.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Strategy:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='queue_strategy'>\n";
echo " <option value=''></option>\n";
if ($queue_strategy == "ring-all") {
echo " <option value='ring-all' selected='selected' >ring-all</option>\n";
}
else {
echo " <option value='ring-all'>ring-all</option>\n";
}
if ($queue_strategy == "longest-idle-agent") {
echo " <option value='longest-idle-agent' selected='selected' >longest-idle-agent</option>\n";
}
else {
echo " <option value='longest-idle-agent'>longest-idle-agent</option>\n";
}
if ($queue_strategy == "round-robin") {
echo " <option value='round-robin' selected='selected'>round-robin</option>\n";
}
else {
echo " <option value='round-robin'>round-robin</option>\n";
}
if ($queue_strategy == "top-down") {
echo " <option value='top-down' selected='selected'>top-down</option>\n";
}
else {
echo " <option value='top-down'>top-down</option>\n";
}
if ($queue_strategy == "agent-with-least-talk-time") {
echo " <option value='agent-with-least-talk-time' selected='selected'>agent-with-least-talk-time</option>\n";
}
else {
echo " <option value='agent-with-least-talk-time'>agent-with-least-talk-time</option>\n";
}
if ($queue_strategy == "agent-with-fewest-calls") {
echo " <option value='agent-with-fewest-calls' selected='selected'>agent-with-fewest-calls</option>\n";
}
else {
echo " <option value='agent-with-fewest-calls'>agent-with-fewest-calls</option>\n";
}
if ($queue_strategy == "sequentially-by-agent-order") {
echo " <option value='sequentially-by-agent-order' selected='selected'>sequentially-by-agent-order</option>\n";
}
else {
echo " <option value='sequentially-by-agent-order'>sequentially-by-agent-order</option>\n";
}
if ($queue_strategy == "sequentially-by-next-agent-order") {
echo " <option value='sequentially-by-next-agent-order' selected='selected'>sequentially-by-next-agent-order</option>\n";
}
else {
echo " <option value='sequentially-by-next-agent-order'>sequentially-by-next-agent-order</option>\n";
}
if ($queue_strategy == "random") {
echo " <option value='random' selected='selected'>random</option>\n";
}
else {
echo " <option value='random'>random</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Enter the queue strategy.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " Music on Hold:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_moh_sound' maxlength='255' value=\"$queue_moh_sound\">\n";
echo "<br />\n";
echo "Enter the music on hold information.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Record Template:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_record_template' maxlength='255' value=\"$queue_record_template\">\n";
echo "<br />\n";
echo "Enter a record template. \$\${base_dir}/recordings/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.wav\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Time Base Score:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='queue_time_base_score'>\n";
echo " <option value=''></option>\n";
if ($queue_time_base_score == "system") {
echo " <option value='system' selected='selected' >system</option>\n";
}
else {
echo " <option value='system'>system</option>\n";
}
if ($queue_time_base_score == "queue") {
echo " <option value='queue' selected='selected' >queue</option>\n";
}
else {
echo " <option value='queue'>queue</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Enter the time base score.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Max Wait Time:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_max_wait_time' maxlength='255' value='$queue_max_wait_time'>\n";
echo "<br />\n";
echo "Enter the max wait time.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Max Wait Time with no Agent:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_max_wait_time_with_no_agent' maxlength='255' value='$queue_max_wait_time_with_no_agent'>\n";
echo "<br />\n";
echo "Enter the max wait time with no agent.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Timeout Action:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//switch_select_destination(select_type, select_label, select_name, select_value, select_style, action);
switch_select_destination("dialplan", "", "queue_timeout_action", $queue_timeout_action, "", "");
echo "<br />\n";
echo "Set the action to perform when the max wait time is reached.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Tier Rules Apply:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='queue_tier_rules_apply'>\n";
echo " <option value=''></option>\n";
if ($queue_tier_rules_apply == "true") {
echo " <option value='true' selected='selected' >true</option>\n";
}
else {
echo " <option value='true'>true</option>\n";
}
if ($queue_tier_rules_apply == "false") {
echo " <option value='false' selected='selected' >false</option>\n";
}
else {
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Set the tier rule rules apply to true or false.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Tier Rule Wait Second:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_tier_rule_wait_second' maxlength='255' value='$queue_tier_rule_wait_second'>\n";
echo "<br />\n";
echo "Enter the tier rule wait seconds.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Tier Rule Wait Multiply Level:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='queue_tier_rule_wait_multiply_level'>\n";
echo " <option value=''></option>\n";
if ($queue_tier_rule_wait_multiply_level == "true") {
echo " <option value='true' selected='selected' >true</option>\n";
}
else {
echo " <option value='true'>true</option>\n";
}
if ($queue_tier_rule_wait_multiply_level == "false") {
echo " <option value='false' selected='selected' >false</option>\n";
}
else {
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Set the tier rule wait multiply level to true or false.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Tier Rule No Agent No Wait:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='queue_tier_rule_no_agent_no_wait'>\n";
echo " <option value=''></option>\n";
if ($queue_tier_rule_no_agent_no_wait == "true") {
echo " <option value='true' selected='selected' >true</option>\n";
}
else {
echo " <option value='true'>true</option>\n";
}
if ($queue_tier_rule_no_agent_no_wait == "false") {
echo " <option value='false' selected='selected' >false</option>\n";
}
else {
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Enter the tier rule no agent no wait.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Discard Abandoned After:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_discard_abandoned_after' maxlength='255' value='$queue_discard_abandoned_after'>\n";
echo "<br />\n";
echo "Set the discard abandoned after seconds.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Abandoned Resume Allowed:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='queue_abandoned_resume_allowed'>\n";
echo " <option value=''></option>\n";
if ($queue_abandoned_resume_allowed == "true") {
echo " <option value='true' selected='selected' >true</option>\n";
}
else {
echo " <option value='true'>true</option>\n";
}
if ($queue_abandoned_resume_allowed == "false") {
echo " <option value='false' selected='selected' >false</option>\n";
}
else {
echo " <option value='false'>false</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Set the abandoned resume allowed to true or false.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " CID Prefix:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_cid_prefix' maxlength='255' value='$queue_cid_prefix'>\n";
echo "<br />\n";
echo "Set a prefix on the caller ID name.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Description:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_description' maxlength='255' value=\"$queue_description\">\n";
echo "<br />\n";
echo "Enter the description.\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='call_center_queue_uuid' value='$call_center_queue_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
require_once "includes/footer.php";
?>
+177
View File
@@ -0,0 +1,177 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_tiers_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "includes/header.php";
require_once "includes/paging.php";
//get http variables and set as php variables
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"center\">\n";
echo " <br>";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Call Center Tier List</b></td>\n";
echo "<td width='50%' align='right'>\n";
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_call_center_queue.php'\" value='Back'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "List all tiers. Tiers assign agents to queues.<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</tr></table>\n";
$sql = "";
$sql .= "select * from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by) == 0) {
$order_by = 'queue_name';
$order = 'asc';
}
else {
$sql .= "order by $order_by $order ";
}
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$num_rows = count($result);
unset ($prep_statement, $result, $sql);
$rows_per_page = 100;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
$sql = "";
$sql .= "select * from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by) == 0) {
$order_by = 'queue_name';
$order = 'asc';
}
else {
$sql .= "order by $order_by $order ";
}
$sql .= " limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('agent_name', 'Agent Name', $order_by, $order);
echo th_order_by('queue_name', 'Queue Name', $order_by, $order);
echo th_order_by('tier_level', 'Tier Level', $order_by, $order);
echo th_order_by('tier_position', 'Tier Position', $order_by, $order);
echo "<td align='right' width='42'>\n";
if (permission_exists('call_center_tiers_add')) {
echo " <a href='v_call_center_tier_edit.php' alt='add'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
if ($result_count == 0) { //no results
}
else { //received results
foreach($result as $row) {
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_name]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_name]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[tier_level]."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[tier_position]."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('call_center_tiers_edit')) {
echo " <a href='v_call_center_tier_edit.php?id=".$row[call_center_tier_uuid]."' alt='edit'>$v_link_label_edit</a>\n";
}
if (permission_exists('call_center_tiers_delete')) {
echo " <a href='v_call_center_tier_delete.php?id=".$row[call_center_tier_uuid]."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='6' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('call_center_tiers_add')) {
echo " <a href='v_call_center_tier_edit.php' alt='add'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
echo "</div>";
echo "<br><br>";
echo "<br><br>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br><br>";
//show the footer
require_once "includes/footer.php";
?>
@@ -0,0 +1,89 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_tiers_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
//get the id
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
}
//get the agent details
$sql = "";
$sql .= "select * from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_tier_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$agent_name = $row["agent_name"];
$queue_name = $row["queue_name"];
break; //limit to 1 row
}
unset ($prep_statement);
//delete the agent from the freeswitch
//get the domain using the $domain_uuid
$tmp_domain = $_SESSION['domains'][$domain_uuid]['domain_name'];
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//delete the agent over event socket
if ($fp) {
//callcenter_config tier del [queue_name] [agent_name]
$cmd = "api callcenter_config tier del ".$queue_name."@".$tmp_domain." ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name'];
$response = event_socket_request($fp, $cmd);
}
//delete the tier from the database
if (strlen($id)>0) {
$sql = "";
$sql .= "delete from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_tier_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
//redirect the user
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_tier.php\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
?>
+437
View File
@@ -0,0 +1,437 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_tiers_add') || permission_exists('call_center_tiers_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$call_center_tier_uuid = check_str($_REQUEST["id"]);
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (count($_POST)>0) {
$agent_name = check_str($_POST["agent_name"]);
$queue_name = check_str($_POST["queue_name"]);
$tier_level = check_str($_POST["tier_level"]);
$tier_position = check_str($_POST["tier_position"]);
}
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
if ($action == "update") {
$call_center_tier_uuid = check_str($_POST["call_center_tier_uuid"]);
}
//check for all required data
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($agent_name) == 0) { $msg .= "Please provide: Agent Name<br>\n"; }
//if (strlen($queue_name) == 0) { $msg .= "Please provide: Queue Name<br>\n"; }
//if (strlen($tier_level) == 0) { $msg .= "Please provide: Tier Level<br>\n"; }
//if (strlen($tier_position) == 0) { $msg .= "Please provide: Tier Position<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "includes/footer.php";
return;
}
//add the agent
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
//add the agent using event socket
if ($fp) {
//get the domain using the $domain_uuid
$tmp_domain = $_SESSION['domains'][$domain_uuid]['domain_name'];
//syntax
//callcenter_config tier add [queue_name] [agent_name] [level] [position]
//callcenter_config tier set state [queue_name] [agent_name] [state]
//callcenter_config tier set level [queue_name] [agent_name] [level]
//callcenter_config tier set position [queue_name] [agent_name] [position]
//add the agent
$cmd = "api callcenter_config tier add ".$queue_name."@".$tmp_domain." ".$agent_name."@".$tmp_domain." ".$tier_level." ".$tier_position;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set level
$cmd = "api callcenter_config tier set level ".$queue_name."@".$tmp_domain." ".$agent_name."@".$tmp_domain." ".$tier_level;
$response = event_socket_request($fp, $cmd);
usleep(200);
//agent set position
$cmd = "api callcenter_config tier set position ".$queue_name."@".$tmp_domain." ".$agent_name."@".$tmp_domain." ".$tier_position;
$response = event_socket_request($fp, $cmd);
usleep(200);
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add") {
$call_center_tier_uuid = uuid();
$sql = "insert into v_call_center_tiers ";
$sql .= "(";
$sql .= "domain_uuid, ";
$sql .= "call_center_tier_uuid, ";
$sql .= "agent_name, ";
$sql .= "queue_name, ";
$sql .= "tier_level, ";
$sql .= "tier_position ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'$domain_uuid', ";
$sql .= "'$call_center_tier_uuid', ";
$sql .= "'$agent_name', ";
$sql .= "'$queue_name', ";
$sql .= "'$tier_level', ";
$sql .= "'$tier_position' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
//syncrhonize configuration
save_call_center_xml();
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_tier.php\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "add")
if ($action == "update") {
$sql = "update v_call_center_tiers set ";
$sql .= "domain_uuid = '$domain_uuid', ";
$sql .= "agent_name = '$agent_name', ";
$sql .= "queue_name = '$queue_name', ";
$sql .= "tier_level = '$tier_level', ";
$sql .= "tier_position = '$tier_position' ";
$sql .= "where call_center_tier_uuid = '$call_center_tier_uuid'";
$db->exec(check_sql($sql));
unset($sql);
//syncrhonize configuration
save_call_center_xml();
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_call_center_tier.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$call_center_tier_uuid = $_GET["id"];
$sql = "";
$sql .= "select * from v_call_center_tiers ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and call_center_tier_uuid = '$call_center_tier_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$agent_name = $row["agent_name"];
$queue_name = $row["queue_name"];
$tier_level = $row["tier_level"];
$tier_position = $row["tier_position"];
break; //limit to 1 row
}
unset ($prep_statement);
}
//show the header
require_once "includes/header.php";
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
if ($action == "add") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>Call Center Tier Add</b></td>\n";
}
if ($action == "update") {
echo "<td align='left' width='30%' nowrap='nowrap'><b>Call Center Tier Edit</b></td>\n";
}
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_call_center_tier.php'\" value='Back'></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "List all tiers. Tiers assign agents to queues.<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Agent Name:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//---- Begin Select List --------------------
$sql = "SELECT * FROM v_users ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "order by username asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
echo "<select id=\"agent_name\" name=\"agent_name\" class='formfld'>\n";
echo "<option value=\"\"></option>\n";
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
//$catcount = count($result);
foreach($result as $field) {
if ($field[username] == $agent_name) {
echo "<option value='".$field['username']."' selected='selected'>".$field['username']."</option>\n";
}
else {
echo "<option value='".$field['username']."'>".$field['username']."</option>\n";
}
}
echo "</select>";
unset($sql, $result);
//---- End Select List --------------------
echo "<br />\n";
echo "Select the agent name.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Queue Name:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//---- Begin Select List --------------------
$sql = "SELECT * FROM v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "order by queue_name asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
echo "<select id=\"queue_name\" name=\"queue_name\" class='formfld'>\n";
echo "<option value=\"\"></option>\n";
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
//$catcount = count($result);
foreach($result as $field) {
if ($field[queue_name] == $queue_name) {
echo "<option value='".$field['queue_name']."' selected='selected'>".$field['queue_name']."</option>\n";
}
else {
echo "<option value='".$field['queue_name']."'>".$field['queue_name']."</option>\n";
}
}
echo "</select>";
unset($sql, $result);
//---- End Select List --------------------
echo "<br />\n";
echo "Select the queue name.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Tier Level:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='tier_level'>\n";
//echo " <option value=''></option>\n";
if ($tier_level == "1") {
echo " <option value='1' selected='selected' >1</option>\n";
}
else {
echo " <option value='1'>1</option>\n";
}
if ($tier_level == "2") {
echo " <option value='2' selected='selected' >2</option>\n";
}
else {
echo " <option value='2'>2</option>\n";
}
if ($tier_level == "3") {
echo " <option value='3' selected='selected' >3</option>\n";
}
else {
echo " <option value='3'>3</option>\n";
}
if ($tier_level == "4") {
echo " <option value='4' selected='selected' >4</option>\n";
}
else {
echo " <option value='4'>4</option>\n";
}
if ($tier_level == "5") {
echo " <option value='5' selected='selected' >5</option>\n";
}
else {
echo " <option value='5'>5</option>\n";
}
if ($tier_level == "6") {
echo " <option value='6' selected='selected' >6</option>\n";
}
else {
echo " <option value='6'>6</option>\n";
}
if ($tier_level == "7") {
echo " <option value='7' selected='selected' >7</option>\n";
}
else {
echo " <option value='7'>7</option>\n";
}
if ($tier_level == "8") {
echo " <option value='8' selected='selected' >8</option>\n";
}
else {
echo " <option value='8'>8</option>\n";
}
if ($tier_level == "9") {
echo " <option value='9' selected='selected' >9</option>\n";
}
else {
echo " <option value='9'>9</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Select the tier level.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " Tier Position:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='tier_position'>\n";
//echo " <option value=''></option>\n";
if ($tier_position == "1") {
echo " <option value='1' selected='selected' >1</option>\n";
}
else {
echo " <option value='1'>1</option>\n";
}
if ($tier_position == "2") {
echo " <option value='2' selected='selected' >2</option>\n";
}
else {
echo " <option value='2'>2</option>\n";
}
if ($tier_position == "3") {
echo " <option value='3' selected='selected' >3</option>\n";
}
else {
echo " <option value='3'>3</option>\n";
}
if ($tier_position == "4") {
echo " <option value='4' selected='selected' >4</option>\n";
}
else {
echo " <option value='4'>4</option>\n";
}
if ($tier_position == "5") {
echo " <option value='5' selected='selected' >5</option>\n";
}
else {
echo " <option value='5'>5</option>\n";
}
if ($tier_position == "6") {
echo " <option value='6' selected='selected' >6</option>\n";
}
else {
echo " <option value='6'>6</option>\n";
}
if ($tier_position == "7") {
echo " <option value='7' selected='selected' >7</option>\n";
}
else {
echo " <option value='7'>7</option>\n";
}
if ($tier_position == "8") {
echo " <option value='8' selected='selected' >8</option>\n";
}
else {
echo " <option value='8'>8</option>\n";
}
if ($tier_position == "9") {
echo " <option value='9' selected='selected' >9</option>\n";
}
else {
echo " <option value='9'>9</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Select the tier position.\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='call_center_tier_uuid' value='$call_center_tier_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
require_once "includes/footer.php";
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('call_center_queues_add') || permission_exists('call_center_queues_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
$cmd = $_GET['cmd'];
$rdr = $_GET['rdr'];
//connect to event socket
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$response = event_socket_request($fp, 'api reloadxml');
$response = event_socket_request($fp, $cmd);
fclose($fp);
}
else {
$response = '';
}
if ($rdr == "false") {
//redirect false
echo $response;
}
else {
header("Location: v_call_center_queue.php?savemsg=".urlencode($response));
}
?>