Open haeferer opened 5 years ago
That's interesting -- are you calling 'destroy' on the endpoint? That should stop it. If you end the app without deleting the endpoint, then I would expect it to continue streaming that tone
deleting the endpoint should stop it, and the 'pause' api command should pause it per this:
https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools%3A+endless_playback
Ok, thx for the hint. I will try "pause".
The Endpoint is destroyed, but maybe (cause of debugging) not always.
But, if the DrachtIO/FS was in this STATE endpoint.destroy() was always called. It looks like the Endpoint was re-used, or the tone_stream() was the new default Behaviour!?
i will do more tests, stay tuned :)
Sample Case (note, only debug from fsmrf is shown)
export DEBUG=*:fsmrf; node ./dist/fs_fonial.js
drachtio:fsmrf Mrf#connect - connecting to 172.22.17.11:8021 +0ms
drachtio:fsmrf initial connection made +6ms
drachtio:fsmrf media server signaling addresses: {"ipv4":{"udp":{"address":"172.22.17.11:5038"},"dtls":{"address":"172.22.17.11:5039"}},"ipv6":{"udp":{},"dtls":{}}} +31ms
drachtio:fsmrf Mrf#connect - media server is ready for action! +1ms
drachtio:fsmrf MediaServer#createEndpoint: sending 3ppc INVITE to uri sip:drachtio@172.22.17.11:5038 with id ba145c40-3116-49e0-a24a-2e7e7d7a7e08 +42ms
drachtio:fsmrf MediaServer#createEndpoint - createUAC produced dialog for ba145c40-3116-49e0-a24a-2e7e7d7a7e08 +70ms
drachtio:fsmrf MediaServer#_onNewCall: 172.22.17.11 received new call with tracking uuid: ba145c40-3116-49e0-a24a-2e7e7d7a7e08 +9ms
drachtio:fsmrf MediaServer#createEndpoint - connectCallback invoked for ba145c40-3116-49e0-a24a-2e7e7d7a7e08 +1ms
drachtio:fsmrf MediaServer#createEndpoint - produceEndpoint for ba145c40-3116-49e0-a24a-2e7e7d7a7e08 +0ms
drachtio:fsmrf Endpoint#ctor creating endpoint with uuid 2d28f28c-f898-11e8-88e0-d753563b78ae, is3pcc: true +0ms
drachtio:fsmrf Endpoint#api uuid_set_media_stats 2d28f28c-f898-11e8-88e0-d753563b78ae +1ms
drachtio:fsmrf Endpoint#api response: [{"headers":[{"name":"Content-Type","value":"api/response"},{"name":"Content-Length","value":5}],"hPtr":null,"body":"+OK:\n"},{"Content-Type":"api/response","Content-Length":5},"+OK:\n"] +36ms
drachtio:fsmrf Endpoint#api uuid_dump 2d28f28c-f898-11e8-88e0-d753563b78ae +1ms
drachtio:fsmrf Endpoint#api response: [{"headers":[{"name":"Content-Type","value":"api/response"},{"name":"Content-Length","value":8445}],"hPtr":null,"body":"Event-Name: CHANNEL_DATA\nCore-UUID: 0d1e75ea-f87d-11e8-8891-d753563b78ae\nFreeSWITCH-Hostname: default\nFreeSWITCH-Switchname: default\nFreeSWITCH-IPv4: 172.22.17.11\nFreeSWITCH-IPv6: %3A%3A1\nEvent-Date-Local: 2018-12-05%2014%3A15%3A06\nEvent-Date-GMT: Wed,%2005%20Dec%202018%2014%3A15%3A06%20GMT\nEvent-Date-Timestamp: 1544019306876901\nEvent-Calling-File: mod_commands.c\nEvent-Calling-Fu +39ms
drachtio:fsmrf MediaServer#createEndpoint - returning endpoint for uuid ba145c40-3116-49e0-a24a-2e7e7d7a7e08 +2ms
Call sip:ich@172.22.17.9
Invite to cancel received...
ProvisionalResp... 180 Ringing
End of Workflow was reached
play file [ 'tone_stream://%(100,5000,800);loops=-1' ]
drachtio:fsmrf Endpoint#execute playback tone_stream://%(100,5000,800);loops=-1 +129ms
export DEBUG=*:fsmrf; node ./dist/fs_fonial.js
drachtio:fsmrf Mrf#connect - connecting to 172.22.17.11:8021 +0ms
drachtio:fsmrf initial connection made +5ms
drachtio:fsmrf media server signaling addresses: {"ipv4":{"udp":{"address":"172.22.17.11:5038"},"dtls":{"address":"172.22.17.11:5039"}},"ipv6":{"udp":{},"dtls":{}}} +37ms
drachtio:fsmrf Mrf#connect - media server is ready for action! +1ms
drachtio:fsmrf MediaServer#createEndpoint: sending 3ppc INVITE to uri sip:drachtio@172.22.17.11:5038 with id 6210094a-77cb-4861-a15c-a3abfab9cdc5 +44ms
drachtio:fsmrf MediaServer#createEndpoint - createUAC produced dialog for 6210094a-77cb-4861-a15c-a3abfab9cdc5 +85ms
drachtio:fsmrf MediaServer#_onNewCall: 172.22.17.11 received new call with tracking uuid: 6210094a-77cb-4861-a15c-a3abfab9cdc5 +9ms
drachtio:fsmrf MediaServer#createEndpoint - connectCallback invoked for 6210094a-77cb-4861-a15c-a3abfab9cdc5 +1ms
drachtio:fsmrf MediaServer#createEndpoint - produceEndpoint for 6210094a-77cb-4861-a15c-a3abfab9cdc5 +0ms
drachtio:fsmrf Endpoint#ctor creating endpoint with uuid ec046240-f898-11e8-88fe-d753563b78ae, is3pcc: true +1ms
drachtio:fsmrf Endpoint#api uuid_set_media_stats ec046240-f898-11e8-88fe-d753563b78ae +1ms
drachtio:fsmrf Endpoint#api response: [{"headers":[{"name":"Content-Type","value":"api/response"},{"name":"Content-Length","value":5}],"hPtr":null,"body":"+OK:\n"},{"Content-Type":"api/response","Content-Length":5},"+OK:\n"] +28ms
drachtio:fsmrf Endpoint#api uuid_dump ec046240-f898-11e8-88fe-d753563b78ae +1ms
drachtio:fsmrf Endpoint#api response: [{"headers":[{"name":"Content-Type","value":"api/response"},{"name":"Content-Length","value":8445}],"hPtr":null,"body":"Event-Name: CHANNEL_DATA\nCore-UUID: 0d1e75ea-f87d-11e8-8891-d753563b78ae\nFreeSWITCH-Hostname: default\nFreeSWITCH-Switchname: default\nFreeSWITCH-IPv4: 172.22.17.11\nFreeSWITCH-IPv6: %3A%3A1\nEvent-Date-Local: 2018-12-05%2014%3A20%3A27\nEvent-Date-GMT: Wed,%2005%20Dec%202018%2014%3A20%3A27%20GMT\nEvent-Date-Timestamp:
1544019627076904\nEvent-Calling-File: mod_commands.c\nEvent-Calling-Fu +39ms
drachtio:fsmrf MediaServer#createEndpoint - returning endpoint for uuid 6210094a-77cb-4861-a15c-a3abfab9cdc5 +2ms
Call sip:ich@172.22.17.9
Invite to cancel received...
ProvisionalResp... 180 Ringing
End of Workflow was reached
play file [ 'conference/8000/conf-welcome.wav' ]
drachtio:fsmrf Endpoint#execute playback conference/8000/conf-welcome.wav +130ms
drachtio:fsmrf Endpoint#execute_Callback playback conference/8000/conf-welcome.wav +1s
Destroy Dialog Dialog, already destroyed: false
Calling Dialog destroy
drachtio:fsmrf Endpoint#destroy: executing hangup on ec046240-f898-11e8-88fe-d753563b78ae +1s
drachtio:fsmrf Endpoint#execute hangup +0ms
drachtio:fsmrf Endpoint#_onBye: got BYE from media server +49ms
Endpoint destroyed true
drachtio:fsmrf Endpoint#destroy - received BYE for ec046240-f898-11e8-88fe-d753563b78ae +0ms
drachtio:fsmrf Endpoint#execute_Callback hangup +8ms
drachtio:fsmrf ignoring connection reset error during teardown of connection +1ms
Restart DrachtServer -> Does not help
Restart FS -> Restart DrachtServer -> Welcome to conference plays again
Hi, we have still a lot of fun (and Success)... :), but
we had made experiments using tone_stream with endPoint.play()
It works, but with strange behavior if "loops=-1" (endless loop)
After you have send this play statement, any following call (even if you end your app and restart and reconnect to the DrachtIOServer) will have the tone playing. You have to restart the DrachtIO/FreeSwitch construct to remove this behaviour.
Is the RTP EndPoint reused between different calls?