Can not hangup the call

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Can not hangup the call

Postby thomaslly » Sat Nov 01, 2008 3:50 am

in the same system of my another post,

http://www.eflo.net/VICIDIALforum/viewtopic.php?t=6390

Sometimes, we can not hangup the call , u can refer the below screen capture


http://194.42.137.141/pic/can_not_hangup.jpg

we modified the codes, when user click hot key, the front end will enumerate
all channels in the current conference, and issue hangup command, the snippets are posted here,

var live_conf_calls ; // added by thomas
var conf_chan_array ; // added by thomas


--------------------------------------

Code: Select all

   function check_for_conf_calls(taskconfnum,taskforce)
      {
      if (typeof(xmlhttprequestcheckconf) == "undefined") {
         //alert (xmlhttprequestcheckconf == xmlhttpSendConf);
         custchannellive--;
         if ( (agentcallsstatus == '1') || (callholdstatus == '1') )
            {
            campagentstatct++;
            if (campagentstatct > campagentstatctmax)
               {
               campagentstatct=0;
               var campagentstdisp = 'YES';
               }
            else
               {
               var campagentstdisp = 'NO';
               }
            }
         else
            {
            var campagentstdisp = 'NO';
            }

         xmlhttprequestcheckconf=false;
         /*@cc_on @*/
         /*@if (@_jscript_version >= 5)
         // JScript gives us Conditional compilation, we can cope with old IE versions.
         // and security blocked creation of the objects.
          try {
           xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
           try {
            xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP");
           } catch (E) {
            xmlhttprequestcheckconf = false;
           }
          }
         @end @*/
         //alert ("1");
         if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined')
            {
            xmlhttprequestcheckconf = new XMLHttpRequest();
            }
         if (xmlhttprequestcheckconf)
            {
            checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp;
            xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php');
            xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
            xmlhttprequestcheckconf.send(checkconf_query);
            xmlhttprequestcheckconf.onreadystatechange = function()
               {
               if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200)
                  {
                  var check_conf = null;
                  var LMAforce = taskforce;
                  check_conf = xmlhttprequestcheckconf.responseText;
               //   alert(checkconf_query);
               //   alert(xmlhttprequestcheckconf.responseText);
                  var check_ALL_array=check_conf.split("\n");
                  var check_time_array=check_ALL_array[0].split("|");
                  var Time_array = check_time_array[1].split("UnixTime: ");
                   UnixTime = Time_array[1];
                   UnixTime = parseInt(UnixTime);
                   UnixTimeMS = (UnixTime * 1000);
                  t.setTime(UnixTimeMS);
                  if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') )
                     {
                     var Alogin_array = check_time_array[2].split("Logged-in: ");
                     var AGLogiN = Alogin_array[1];
                     var CamPCalLs_array = check_time_array[3].split("CampCalls: ");
                     var CamPCalLs = CamPCalLs_array[1];

                     var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: ");
                     var DiaLCalLs = DiaLCalLs_array[1];

                     if (AGLogiN != 'N')
                        {
                        document.getElementById("AgentStatusStatus").innerHTML = AGLogiN;
                        }
                     if (CamPCalLs != 'N')
                        {
                        document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs;
                        }
                     if (DiaLCalLs != 'N')
                        {
                        document.getElementById("AgentStatusDiaLs").innerHTML = DiaLCalLs;

                        }
                     if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) )
                        {
                        showDiv('AgenTDisablEBoX');
                        }
                     if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) )
                        {
                        showDiv('AgenTDisablEBoX');
                        }
                     }
                  var VLAStatuS_array = check_time_array[4].split("Status: ");
                  var VLAStatuS = VLAStatuS_array[1];
                  if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) )
                     {
                     if (PausENotifYCounTer > 10)
                        {
                        alert('鎮ㄧ殑浼氳瘽宸叉殏鍋?);
                        AutoDial_ReSume_PauSe('VDADpause');
                        PausENotifYCounTer=0;
                        }
                     else {PausENotifYCounTer++;}
                     }
                  else {PausENotifYCounTer=0;}

                  var check_conf_array=check_ALL_array[1].split("|");
// modified by thomas, move definition of live_conf_calls, conf_chan_array to the head of this file, so to make it the global variables
//                  var live_conf_calls = check_conf_array[0];
//                  var conf_chan_array = check_conf_array[1].split(" ~");
                  live_conf_calls = check_conf_array[0];
                  conf_chan_array = check_conf_array[1].split(" ~");
// end                   
                  if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) )
                     {
                     if (live_conf_calls > 0)
                        {
                        var loop_ct=0;
                        var ARY_ct=0;
                        var LMAalter=0;
                        var LMAcontent_change=0;
                        var LMAcontent_match=0;
                        var conv_start=-1;
                        var live_conf_HTML = "<TABLE WIDTH=\"800px\"><TR BGCOLOR=#E6E6E6><TD><font class=\"log_title\">#</font></TD><TD><font class=\"log_title\">杩滅▼棰戦亾</font></TD><TD><font class=\"log_title\">鎸傛柇</font></TD><TD><font class=\"log_title\">闊抽噺</font></TD></TR>";
                        if ( (LMAcount > live_conf_calls)  || (LMAcount < live_conf_calls) || (LMAforce > 0))
                           {
                           LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]='';
                           LMAcount=0;   LMAcontent_change++;
                           }
                        while (loop_ct < live_conf_calls)
                           {
                           loop_ct++;
                           loop_s = loop_ct.toString();
                           if (loop_s.match(/1$|3$|5$|7$|9$/))
                              {var row_color = '#DDDDFF';}
                           else
                              {var row_color = '#CCCCFF';}
                           var conv_ct = (loop_ct + conv_start);
                           var channelfieldA = conf_chan_array[conv_ct];
                           
                           var regXFcred = new RegExp(flag_string,"g");
                           if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) )
                              {
                              var chan_name_color = 'log_text_red';
                              }
                           else
                              {
                              var chan_name_color = 'log_text';
                              }
                           if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) )
                           
                              {
                              var hide_channel=1;
                              }
                           else
                              {
                              if (volumecontrol_active!=1)
                                 {
                                 live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">鎸傛柇</a></td><td></td></tr>";
                                 }
                              else
                                 {
                                 live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">鎸傛柇</a></td><td><a href=\"#\" onclick=\"volume_control('UP','" + channelfieldA + "','');return false;\"><IMG SRC=\"./style/default/images/vdc_volume_up.gif\" BORDER=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('DOWN','" + channelfieldA + "','');return false;\"><IMG SRC=\"./style/default/images/vdc_volume_down.gif\" BORDER=0></a> &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"volume_control('MUTING','" + channelfieldA + "','');return false;\"><IMG SRC=\"./style/default/images/vdc_volume_MUTE.gif\" BORDER=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('UNMUTE','" + channelfieldA + "','');return false;\"><IMG SRC=\"./style/default/images/vdc_volume_UNMUTE.gif\" BORDER=0></a></td></tr>";
                                 }
                              }
            //      var debugspan = document.getElementById("debugbottomspan").innerHTML;

                           if (channelfieldA == lastcustchannel) {custchannellive++;}
                           else
                              {
                              if(customerparked == 1)
                                 {custchannellive++;}
                              // allow for no customer hungup errors if call from another server
                              if(server_ip == lastcustserverip)
                                 {var nothing='';}
                              else
                                 {custchannellive++;}
                              }

                           if (volumecontrol_active > 0)
                              {
                              if (protocol != 'EXTERNAL')
                                 {
                                 var regAGNTchan = new RegExp(protocol + '/' + extension,"g");
                                 if  ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) )
                                    {
                                    agentchannel = channelfieldA;

                                    document.getElementById("AgentMuteSpan").innerHTML = "<a href=\"#CHAN-" + agentchannel + "\" onclick=\"volume_control('MUTING','" + agentchannel + "','AgenT');return false;\"><IMG SRC=\"./style/default/images/vdc_volume_MUTE.gif\" BORDER=0></a>";
                                    }
                                 }
                              else
                                 {
                                 if (agentchannel.length < 3)
                                    {
                                    agentchannel = channelfieldA;

                                    document.getElementById("AgentMuteSpan").innerHTML = "<a href=\"#CHAN-" + agentchannel + "\" onclick=\"volume_control('MUTING','" + agentchannel + "','AgenT');return false;\"><IMG SRC=\"./style/default/images/vdc_volume_MUTE.gif\" BORDER=0></a>";
                                    }
                                 }
                              }

            //      document.getElementById("debugbottomspan").innerHTML = debugspan + '<BR>' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter;

                           if (!LMAe[ARY_ct])
                              {LMAe[ARY_ct] = channelfieldA;   LMAcontent_change++;  LMAalter++;}
                           else
                              {
                              if (LMAe[ARY_ct].length < 1)
                                 {LMAe[ARY_ct] = channelfieldA;   LMAcontent_change++;  LMAalter++;}
                              else
                                 {
                                 if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;}
                                  else {LMAcontent_change++;   LMAe[ARY_ct] = channelfieldA;}
                                 }
                              }
                           if (LMAalter > 0) {LMAcount++;}
                           
                           ARY_ct++;
                           }
      //   var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5];
      //                     document.getElementById("confdebug").innerHTML = debug_LMA + "<BR>";

                        live_conf_HTML = live_conf_HTML + "</table>";

                        if (LMAcontent_change > 0)
                           {
                           if (conf_channels_xtra_display == 1)
                              {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;}
                           }
                        nochannelinsession=0;
                        }
                     else
                        {
                        LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]='';
                        LMAcount=0;
                        if (conf_channels_xtra_display == 1)
                           {
                           if (document.getElementById("outboundcallsspan").innerHTML.length > 2)
                              {
                              document.getElementById("outboundcallsspan").innerHTML = '';
                              }
                           }
                        custchannellive = -99;
                        nochannelinsession++;
                        }
                     }
                     xmlhttprequestcheckconf = undefined;
                     delete xmlhttprequestcheckconf;                  
                  }
               }
            }
         }
      }


----------------------------------------------------------------------------



// ################################################################################
// Send Hangups command for all channels connected to the conference now to Manager
// except for the agent channel , which start with SIP/250
//   function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo)
   function send_hangup_to_all_channels(dispowindow,hotkeysused,altdispo)
      {
      var form_cust_channel = document.vicidial_form.callchannel.value;
      var form_cust_serverip = document.vicidial_form.callserverip.value;
      var customer_channel = lastcustchannel;
      var customer_server_ip = lastcustserverip;
      AgaiNHanguPChanneL = lastcustchannel;
      AgaiNHanguPServeR = lastcustserverip;
      AgainCalLSecondS = VD_live_call_secondS;
      AgaiNCalLCID = CalLCID;
      var process_post_hangup=0;
      if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) )
         {
         MD_channel_look=0;
         DialTimeHangup();
         }
      if (form_cust_channel.length > 3)
         {
//added by thomas
var loop_ct=0;
var conv_start=-1;               
while (loop_ct < live_conf_calls)
{
      loop_ct++;
      var conv_ct = (loop_ct + conv_start);
      var channelfieldA = conf_chan_array[conv_ct];
     if (! channelfieldA.match(/SIP\/s250/))
     {
// end       
         var xmlhttp=false;
         /*@cc_on @*/
         /*@if (@_jscript_version >= 5)
         // JScript gives us Conditional compilation, we can cope with old IE versions.
         // and security blocked creation of the objects.
          try {
           xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
           try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
           } catch (E) {
            xmlhttp = false;
           }
          }
         @end @*/
         if (!xmlhttp && typeof XMLHttpRequest!='undefined')
            {
            xmlhttp = new XMLHttpRequest();
            }
         if (xmlhttp)
            {
            var queryCID = "HLvdcW" + epoch_sec + user_abb;
// modified by thomas
//            var hangupvalue =  customer_channel;
            var hangupvalue = channelfieldA;
// end            
            //      alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS);
            custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id;
            xmlhttp.open('POST', 'manager_send.php');
            xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
            xmlhttp.send(custhangup_query);
            xmlhttp.onreadystatechange = function()
               {
               if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
                  {
                  Nactiveext = null;
                  Nactiveext = xmlhttp.responseText;
               //      alert(xmlhttp.responseText);
               //   var HU_debug = xmlhttp.responseText;
               //   var HU_debug_array=HU_debug.split(" ");
               //   if (HU_debug_array[0] == 'Call')
               //      {
               //      alert(xmlhttp.responseText);
               //      }

                  }
               }
            process_post_hangup=1;
            delete xmlhttp;
            }
// added by thomas            
     }
}
// end
         }
         else {process_post_hangup=1;}
         
         if (process_post_hangup==1)
         {
         VD_live_customer_call = 0;
         VD_live_call_secondS = 0;
         MD_ring_secondS = 0;
         CalLCID = '';

      //   UPDATE VICIDIAL_LOG ENTRY FOR THIS CALL PROCESS
         DialLog("end");
         if (dispowindow == 'NO')
            {
            open_dispo_screen=0;
            }
         else
            {
            if (auto_dial_level == 0)         
               {
               if (document.vicidial_form.DiaLAltPhonE.checked==true)
                  {
                  reselect_alt_dial = 1;
                  open_dispo_screen=0;
                  }
               else
                  {
                  reselect_alt_dial = 0;
                  open_dispo_screen=1;
                  }
               }
            else
               {
               if (document.vicidial_form.DiaLAltPhonE.checked==true)
                  {
                  reselect_alt_dial = 1;
                  open_dispo_screen=0;
                  auto_dial_level=0;
                  manual_dial_in_progress=1;
                  auto_dial_alt_dial=1;
                  }
               else
                  {
                  reselect_alt_dial = 0;
                  open_dispo_screen=1;
                  }
               }
            }

      //  DEACTIVATE CHANNEL-DEPENDANT BUTTONS AND VARIABLES
         document.vicidial_form.callchannel.value = '';
         document.vicidial_form.callserverip.value = '';
         lastcustchannel='';
         lastcustserverip='';

         if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
         document.getElementById("WebFormSpan").innerHTML = "<IMG SRC=\"./style/default/images/vdc_LB_webform_OFF.gif\" border=0 alt=\"WEB表单\">";
         document.getElementById("ParkControl").innerHTML = "<IMG SRC=\"./style/default/images/vdc_LB_parkcall_OFF.gif\" border=0 alt=\"保留通话\">";
         document.getElementById("HangupControl").innerHTML = "<IMG SRC=\"./style/default/images/vdc_LB_hangupcustomer_OFF.gif\" border=0 alt=\"挂断\">";
         document.getElementById("XferControl").innerHTML = "<IMG SRC=\"./style/default/images/vdc_LB_transferconf_OFF.gif\" border=0 alt=\"通话转移\">";
         document.getElementById("LocalCloser").innerHTML = "<IMG SRC=\"./style/default/images/vdc_XB_localcloser_OFF.gif\" border=0 alt=\"本地终结员\">";
         document.getElementById("DialBlindTransfer").innerHTML = "<IMG SRC=\"./style/default/images/vdc_XB_blindtransfer_OFF.gif\" border=0 alt=\"拨打盲转话路\">";
         document.getElementById("DialBlindVMail").innerHTML = "<IMG SRC=\"./style/default/images/vdc_XB_ammessage_OFF.gif\" border=0 alt=\"盲转语音留言\">";
         document.getElementById("VolumeUpSpan").innerHTML = "<IMG SRC=\"./style/default/images/vdc_volume_up_off.gif\" BORDER=0>";
         document.getElementById("VolumeDownSpan").innerHTML = "<IMG SRC=\"./style/default/images/vdc_volume_down_off.gif\" BORDER=0>";

         document.vicidial_form.custdatetime.value= '';

         if (auto_dial_level == 0)
            {
            if (document.vicidial_form.DiaLAltPhonE.checked==true)
               {
               reselect_alt_dial = 1;
               if (altdispo == 'ALTPH2')
                  {
                  ManualDialOnly('ALTPhoneE');
                  }
               else
                  {
                  if (altdispo == 'ADDR3')
                     {
                     ManualDialOnly('AddresS3');
                     }
                  else
                     {
                     if (hotkeysused == 'YES')
                        {
                        reselect_alt_dial = 0;
                        manual_auto_hotkey = 1;
                        }
                     }
                  }
               }
            else
               {
               if (hotkeysused == 'YES')
                  {
                  manual_auto_hotkey = 1;
                  }
               else
                  {
                  document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./style/default/images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"拨打下一个号码\"></a>";
                  }
               reselect_alt_dial = 0;
               }
            }
         else
            {
            if (document.vicidial_form.DiaLAltPhonE.checked==true)
               {
               reselect_alt_dial = 1;
               if (altdispo == 'ALTPH2')
                  {
                  ManualDialOnly('ALTPhoneE');
                  }
               else
                  {
                  if (altdispo == 'ADDR3')
                     {
                     ManualDialOnly('AddresS3');
                     }
                  else
                     {
                     if (hotkeysused == 'YES')
                        {
                        document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
                        document.getElementById("MainStatuSSpan").innerHTML = '';
                        document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF;
                        reselect_alt_dial = 0;
                        }
                     }
                  }
               }
            else
               {
               document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
               document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF;
               reselect_alt_dial = 0;
               }
            }

         ShoWTransferMain('OFF');
         }
      }


thomaslly
 
Posts: 20
Joined: Mon Jul 28, 2008 1:23 am

Postby mflorell » Sat Nov 01, 2008 8:18 am

There are some issues with doing this, but in SVN trunk we have already implemented something similar for ending 3way calls in sessions. Usually there is a bigger problem if you are just doin 3way calls.

I don't suppose you would want to contribute your translation files back to the community, since we clearly do not have any Asian languages in the standard distribution and it would be great if we could offer your translation.
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby thomaslly » Sat Nov 01, 2008 4:17 pm

We'd like to contribute some translations, this is a customized application, not all translations can apply to the standard releases.

For the screen capture link, it's when the before hangup can not hangup callee channel, and new callee channel get in! We have not utilized 3-ways call for this customer.

I've posted a task for this issue on GAF, who can help me on this will take that bonus.

https://www.getafreelancer.com/projects ... idial.html
thomaslly
 
Posts: 20
Joined: Mon Jul 28, 2008 1:23 am

Postby mflorell » Sat Nov 01, 2008 6:33 pm

Do you ever see Javascript errors showing up when this happens?
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: No registered users and 77 guests