switch_lead api function only works once per session

All installation and configuration problems and questions

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

switch_lead api function only works once per session

Postby matthewmalk248 » Sun Jul 04, 2021 4:00 pm

I get a success from the API and the lead switches perfectly the first time, but on the 2nd attempt I get the success response but the agent's lead doesnt change. They have to log out and log back in for it to work again.

I seem to be having the same issues originally posted 4 years ago here.. viewtopic.php?f=4&t=37766
The last reply was suggesting to update their SVN but I'm on the latest myself.

Vicibox 9.0.3
Version: 2.14-817a
SVN Version: 3470
DB Schema Version: 1637
Build: 200310-1801
matthewmalk248
 
Posts: 10
Joined: Sat Jan 04, 2020 1:48 pm

Re: switch_lead api function only works once per session

Postby mflorell » Mon Jul 05, 2021 8:08 am

Are there any errors on the web browser console when this happens?
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: switch_lead api function only works once per session

Postby matthewmalk248 » Wed Jul 07, 2021 6:16 pm

Sorry for delayed response, just got back into the office.

Not during the failed switch. Actually nothing happens in console during the second attempt. But we do get this during the first initial switch that does work...


sip.js:2900 Wed Jul 07 2021 19:13:08 GMT-0400 (Eastern Daylight Time) | sip.transaction.nist | Timer J expired for non-INVITE server transaction z9hG4bK0f6d5b6c

vicidial.php:4705 Uncaught ReferenceError: CalL_ScripT_id_TWO is not defined
at XMLHttpRequest.LeaDSearcHSelecT.xmlhttprequestselectupdate.onreadystatechange (vicidial.php:4705)
matthewmalk248
 
Posts: 10
Joined: Sat Jan 04, 2020 1:48 pm

Re: switch_lead api function only works once per session

Postby matthewmalk248 » Wed Jul 07, 2021 6:24 pm

well I was able to resolve that error by changing line 9384 in vicidial.php from
Code: Select all
if ( (CalL_ScripT_id_TWO.length > 0) && (SSenable_second_script > 0) )
to
Code: Select all
if ( (CalL_ScripT_id_two.length > 0) && (SSenable_second_script > 0) )


But sadly that did not seem to fix my switch_lead api :(
matthewmalk248
 
Posts: 10
Joined: Sat Jan 04, 2020 1:48 pm

Re: switch_lead api function only works once per session

Postby matthewmalk248 » Wed Jul 07, 2021 6:29 pm

aaaaaand it WORKS. Just had to switch from the latest version of Edge to a slightly outdated Chrome install! Should I submit that fix somewhere for that "Uncaught ReferenceError: CalL_ScripT_id_TWO is not defined
at XMLHttpRequest.LeaDSearcHSelecT.xmlhttprequestselectupdate.onreadystatechange " error?
matthewmalk248
 
Posts: 10
Joined: Sat Jan 04, 2020 1:48 pm

Re: switch_lead api function only works once per session

Postby mflorell » Wed Jul 07, 2021 8:01 pm

That specific error was fixed in svn/trunk a few days ago as I was trying to fix another issue.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: switch_lead api function only works once per session

Postby matthewmalk248 » Thu Jul 08, 2021 2:23 pm

It looks like it works 'most' of the time, but I tried doing multiple scenario testing and it seems when I click "hangup customer" and intiate killing the call, the switch_lead will no longer work and it does the same behavior as before. (No console output and have to logout to get it working again)
matthewmalk248
 
Posts: 10
Joined: Sat Jan 04, 2020 1:48 pm

Re: switch_lead api function only works once per session

Postby mflorell » Mon Jul 12, 2021 7:57 am

The Agent API "switch_lead" function should return an "ERROR: agent_user does not have a live call..." response if you are trying to use it after hanging up the customer.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: switch_lead api function only works once per session

Postby matthewmalk248 » Sat Jul 17, 2021 9:54 am

That works as expected, the problem is that when the agent is on the next call it doesn't work. (If the agent uses the hangup customer button)
matthewmalk248
 
Posts: 10
Joined: Sat Jan 04, 2020 1:48 pm

Re: switch_lead api function only works once per session

Postby martinch » Tue Aug 03, 2021 2:47 am

I did see this typo last year but I just changed it rather than reporting on Mantis. My bad. JavaScript is case sensitive so two and TWO are treated differently.

Thanks for patching that @Matt! And glad it's working for you matthewmalk248.
Project Lead @ mDial -> https://github.com/TheBlode/mDial
martinch
 
Posts: 273
Joined: Thu Nov 15, 2018 9:14 am
Location: England, UK


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 55 guests