So here's my results generally.... Using the below extensions.conf and JS file. It's based entirely on the example monkeys playback demo
I originate the call...
0fa669f1fad8*CLI> channel originate LOCAL/123@inbound application wait 1
-- Called 123@inbound
-- Executing [123@inbound:1] NoOp("Local/123@inbound-00000010;2", "Inbound call") in new stack
-- Executing [123@inbound:2] Answer("Local/123@inbound-00000010;2", "") in new stack
-- Local/123@inbound-00000010;1 answered
-- Executing [123@inbound:3] Stasis("Local/123@inbound-00000010;2", "inbound") in new stack
-- <Local/123@inbound-00000010;2> Playing 'tt-monkeys.ulaw' (language 'en')
[Apr 7 17:46:28] WARNING[459][C-00000011]: res_stasis_playback.c:277 playback_final_update: 1491587187.65: Playback failed for sound:tt-monkeys
[Apr 7 17:46:28] WARNING[455]: res_http_websocket.c:519 ws_safe_read: Web socket closed abruptly
[Apr 7 17:46:28] WARNING[455]: ari/ari_websockets.c:128 ast_ari_websocket_session_read: WebSocket read error: Success
Deactivating Stasis app 'inbound'
Shutting down application 'inbound'
== WebSocket connection from '172.19.0.1:57720' closed
Destroying Stasis app inbound
And you can see the javascript application totally fails...
$ node check.js
[ 'This API is using a deprecated version of Swagger! Please see http://github.com/wordnik/swagger-core/wiki for more info' ]
Monkeys! Attack Local/123@inbound-00000010;2!
Monkeys successfully vanquished Local/123@inbound-00000010;2; hanging them up
Channel Local/123@inbound-00000010;2 just left our application
/home/doug/codebase/vnf-asterisk-controller/node_modules/ari-client/node_modules/bluebird/js/main/async.js:43
fn = function () { throw arg; };
^
Error: {"message":"Channel not found"}
at SwaggerRequest.swaggerError [as errorCallback] (/home/doug/codebase/vnf-asterisk-controller/node_modules/ari-client/lib/resources.js:944:19)
at Object.error (/home/doug/codebase/vnf-asterisk-controller/node_modules/swagger-client/lib/swagger.js:1077:24)
at EventEmitter.error (/home/doug/codebase/vnf-asterisk-controller/node_modules/swagger-client/lib/swagger.js:1296:19)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7)
at emit (/home/doug/codebase/vnf-asterisk-controller/node_modules/shred/lib/shred/request.js:454:21)
at /home/doug/codebase/vnf-asterisk-controller/node_modules/shred/lib/shred/request.js:473:9
at setBodyAndFinish (/home/doug/codebase/vnf-asterisk-controller/node_modules/shred/lib/shred/response.js:103:7)
at IncomingMessage.<anonymous> (/home/doug/codebase/vnf-asterisk-controller/node_modules/shred/lib/shred/response.js:120:7)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
If you originate the call with say application wait 120
-- it works. It's just when the channel is no longer available because the calling party hung up first.
How does one properly handle this case?