Page 1 of 1
switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Sun Jul 04, 2021 4:00 pm
by matthewmalk248
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=37766The 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
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Mon Jul 05, 2021 8:08 am
by mflorell
Are there any errors on the web browser console when this happens?
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Wed Jul 07, 2021 6:16 pm
by matthewmalk248
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)
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Wed Jul 07, 2021 6:24 pm
by matthewmalk248
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
![Sad :(](./images/smilies/icon_sad.gif)
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Wed Jul 07, 2021 6:29 pm
by matthewmalk248
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?
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Wed Jul 07, 2021 8:01 pm
by mflorell
That specific error was fixed in svn/trunk a few days ago as I was trying to fix another issue.
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Thu Jul 08, 2021 2:23 pm
by matthewmalk248
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)
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Mon Jul 12, 2021 7:57 am
by mflorell
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.
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Sat Jul 17, 2021 9:54 am
by matthewmalk248
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)
Re: switch_lead api function only works once per session
![Post Post](./styles/vicidial/imageset/icon_post_target.gif)
Posted:
Tue Aug 03, 2021 2:47 am
by martinch
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.