I have a simple js script that answers to an extension and calls operator on ext 1000:
session.answer();
// code that asks for user pin, checks credit, plays error messages, etc…, hangsup on error
// if it gets here, all ok
var sessOp = new Session("user/1000");
if (sessOp.ready()) {
bridge(session, sessOp);
while(session.ready()) {
}
}
session.hangup();
sessOp.hangup();
SO FAR SO SIMPLE!
Now from ESL (I’m currently testing issuing commands on fs_cli), I need to:
THE PROBLEM
As SOON as I park the customer-operator call at point(2) with
uuid_transfer <customer sessionid> -both park inline
the js script considers the call terminated and hangs up..
what can I put in the js loop (currently while(session.ready() {} )
To keep the script running until the customer finally hangs up???
Could I use uuid_hold to achieve the same? I tried but when I hold the customer’s leg, it’s the OPERATOR that gets the music,
I tried to originate call in fs_cli and then bridge to customer, but silence on both ends…