Please help..
I am trying to implement this scenario with js.
My problem is that once the two sessions have been bridged, I cannot collect any dtmf!
This is what I am doing:
Where AM I going wrong???
var opExt = "1000";
console_log(1,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n========================================================================");
var dtmf = new Object( );
dtmf.digits = "";
if (session.ready()) {
var dtmf = {
digits : ''
};
var uuid = session.getVariable("uuid");
console_log(1, "Session UUID: " + uuid);
console_log(1,"answering session ..");
session.answer();
var uuid = session.getVariable("uuid");
console_log(1,"calling operator ..");
var opSession = new Session("{UUIDLegA=" + uuid + "}user/" + opExt);
if (opSession.ready()) {
console_log(1,"Op session ready! ... bridging ..");
bridge(session, opSession);
console_log(1,"waiting for digit ...");
while (opSession.ready()) {
opSession.collectInput( getDigit, dtmf, 0, 0);
switch(dtmf.digits) {
case "0" : //
// etc
}
}
}
}
console_log(1,"Hanging up sessions");
session.hangup();
opSession.hangup();