Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 44459 => {
- Answer();
- Playback(you-entered);
- WaitEventInit(); // Initialize event queue
- GRPCSTTBackground(); // Initialize background recognition
- Set(CALL_END_TIME=$[${GET_TIME_NSEC(MONOTONIC)} + 10]); // Set end time to a minute after now
- Set(SLEEP_TIME=$[${CALL_END_TIME} - ${GET_TIME_NSEC(MONOTONIC)}]); // Calculate maximum wait time
- while (${SLEEP_TIME} > 0) { // While not timed out yet
- WaitEvent(${SLEEP_TIME}); // Wait until next event or timeout
- if (${WAITEVENTSTATUS} == SUCCESS) {
- Set(CurrentUTCTime=${GET_TIME_NSEC(UTC)});
- Set(CurrentUTCTimeString=${STRFTIME(${CurrentUTCTime},GMT,%FT%T)}.${CurrentUTCTime:-9:});
- switch (${WAITEVENTNAME}) {
- case GRPCSTT_X_REQUEST_ID:
- Log(NOTICE,[${CurrentUTCTimeString}] x-request-id = ${WAITEVENTBODY});
- break;
- case GRPCSTT_UTF8:
- Log(NOTICE,[${CurrentUTCTimeString}] Phrase(UTF-8 encoded) = ${WAITEVENTBODY});
- break;
- default:
- }
- } else {
- Log(NOTICE,WaitEvent() WAITEVENTSTATUS == ${WAITEVENTSTATUS}; ${WAITEVENTBODY});
- }
- Set(SLEEP_TIME=$[${CALL_END_TIME} - ${GET_TIME_NSEC(MONOTONIC)}]); // Update maximum wait time
- }
- Hangup();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement