diff --git a/SugarModules/modules/Asterisk/asteriskLogger.php b/SugarModules/modules/Asterisk/asteriskLogger.php index 7417137..0df4ca7 100644 --- a/SugarModules/modules/Asterisk/asteriskLogger.php +++ b/SugarModules/modules/Asterisk/asteriskLogger.php @@ -41,7 +41,7 @@ // // Debug flags // -$dial_events_log = '/Applications/MAMP/htdocs/dial_events.html'; +$dial_events_log = 'c:/sugarcrm/htdocs/dial_events_log_ast1.html'; $mysql_loq_queries = 0; $mysql_log_results = 0; $verbose_log = 0; @@ -622,6 +622,13 @@ function call($method, $params) { mysql_checked_query($query); } + + // Had to switch to using Dial End commands because when using hangups I couldn't do calls to cell phones properly... (basically there are so many + // hangup events it killed me... + // Queues have the opposite issue... I can't detect the end of a Queue call unfortuntely... + // Queues -- Could not use Dial End, only Hangup would work. + + // // Process "Hangup" events // Yup, we really get TWO hangup events from Asterisk! (Even more with Ringgroups) @@ -629,7 +636,8 @@ function call($method, $params) { // // Asterisk Manager 1.1 /*$e['Event'] == 'Hangup'*/ - if (($e['Event'] == 'Dial' && $e['SubEvent'] == 'End') ) { + if (($e['Event'] == 'Dial' && $e['SubEvent'] == 'End') || + ($e['Event'] == 'Hangup' /*&& preg_match( '/from-queue/', $e['Channel'])*/ )) { $id = AMI_getUniqueIdFromEvent($e); logLine(" In DialEnd... $id"); $query = "SELECT call_record_id,direction,bean_module,bean_id,user_extension,inbound_extension FROM asterisk_log WHERE asterisk_dest_id = '$id' OR asterisk_id = '$id'"; @@ -1081,7 +1089,6 @@ function call($method, $params) { $result = mysql_checked_query($query); while ($call_rec_id = mysql_fetch_array($result)) { logLine("Deleting Call Record: " . $call_rec_id['call_record_id']); - //pause(30000); deleteCall($call_rec_id['call_record_id']); } } else if($direction['direction'] == "O") { @@ -1094,7 +1101,6 @@ function call($method, $params) { // Here we add support for complicated Ring Groups such as x1 ---> 615 ---> 710,722,735 // \--> 620 ---> 810,811,812 // Check if both channels are internal... Then, check the asterisk_log table to see if an entry exists where Channel matches one of them... if so then change it out. - // TBD: does answering on a cell phone and not pressing 1 to accept cause a bridge event that messes this up? if (isCallInternal($e['Channel1'], $e['Channel2'])) { logLine("Internal Bridge Event Detected\n"); if (preg_match('/(.*);(.*)/', $e['Channel1'], $matches)) { @@ -1478,7 +1484,6 @@ function dev_clearDialEventsLog() { function dev_GenericEventPrinter($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8) { global $dial_events_log; - logLine("In printer generic"); if( !empty($dial_events_log) ) { $s = getTimeStamp() . " "; $s .= str_pad($arg1, 8, " ", STR_PAD_BOTH); @@ -1840,7 +1845,6 @@ function findSugarObjectByPhoneNumber($aPhoneNumber) { $resultDecoded = $matchingContacts[0]; if(count($matchingContacts) > 1) { - $foundMultipleAccounts = FALSE; $matchingAccounts = array(); //logLine(print_r($resultDecoded,true)); for ($i = 0; $i < count($matchingContacts); $i++) { diff --git a/SugarModules/modules/Asterisk/include/javascript/callPopups.js b/SugarModules/modules/Asterisk/include/javascript/callPopups.js index 7d1feaa..80dd38f 100644 --- a/SugarModules/modules/Asterisk/include/javascript/callPopups.js +++ b/SugarModules/modules/Asterisk/include/javascript/callPopups.js @@ -274,20 +274,19 @@ var YAAI = { }) .on("mouseenter",function() { $(dropdownDiv).css( "margin-left", "50px"); // Needed in ie8 only... + clearTimeout($(dropdownDiv).data('timeoutId1')); + clearTimeout($(dropdownDiv).data('timeoutId2')); + console.log("clearing timeouts... button"); }) .on("mouseleave", function () { - setTimeout(hidepanel, 600); + var timeoutId1 = setTimeout(hidepanel, 600); + $(dropdownDiv).data('timeoutId1', timeoutId1); + console.log("set timeouts... button"); }); - - $(dropdownDiv).mouseleave(function() { setTimeout(hidepanel, 600); }); - - function hidepanel() { - // 2013-05-21: Code commented below caused issues with IE8, Safe to delete if no issues crop up with other browsers - //if ($(dropdownDiv).is(':hover') === false) { - $(dropdownDiv).slideUp(); - //} - } + // This is for mouse events over the actual dropdowns... + $(dropdownDiv).mouseleave(function() { var timeoutId2 = setTimeout(hidepanel, 600); $(dropdownDiv).data('timeoutId2', timeoutId2); console.log("set timeouts... div"); }); + $(dropdownDiv).mouseenter(function() { clearTimeout($(dropdownDiv).data('timeoutId1')); clearTimeout($(dropdownDiv).data('timeoutId2')); console.log("clearing timeouts... div"); } ); // Here we show them all... diff --git a/SugarModules/modules/Asterisk/include/tests/fake_dialer/test_ui.php b/SugarModules/modules/Asterisk/include/tests/fake_dialer/test_ui.php index 7f9f785..f592a44 100644 --- a/SugarModules/modules/Asterisk/include/tests/fake_dialer/test_ui.php +++ b/SugarModules/modules/Asterisk/include/tests/fake_dialer/test_ui.php @@ -2,12 +2,14 @@
-Instructions: click the add call button. Enter the extension it should go to and the inbound phone number it should be coming from. Then, when the box -shows up allowing you to drag the icon. You must go from ringing -> connected --> Hangup --> Closed (Don't skip steps). + Instructions: click the add call button. Enter the extension it should go to and the inbound phone number it should be coming from. Then, when the box + shows up allowing you to drag the icon. You must go from ringing -> connected --> Hangup --> Closed (Don't skip steps).
-The matching contacts setting create the number of contacts specified. A temporary contact will be created named John Doe and Jane Doe (if 2 is selected). -These contacts will be deleted once you get to the "Closed" stage. + The matching contacts setting create the number of contacts specified. A temporary contact will be created named John Doe and Jane Doe (if 2 is selected). + These contacts will be deleted once you get to the "Closed" stage.
-To simply see what will happen when someone calls you from a given number, leave it at 0.
-
+ To simply see what will happen when someone calls you from a given number, leave it at 0.
+
- +