-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
endPoint.play does not return if call end by RemoteParty #9
Comments
The Result is the same with or without
It is realy needed to Populate the remote.sdp (i think so?) |
Yes, this is how it currently works. If you destroy the Endpoint (as you do in the 'destroy' handler for the sip dialog) then any operations are terminated by freeswitch and those promises won't resolve . I suppose it would be more correct to have those promises be rejected (or callbacks invoked with an error) that indicate the call / session was terminated? In practice, I have never had the need to want to receive those since once the call is over I implicitly know all operations have ceased and I mostly proceed to doing my cleanup code. I can take a deeper look at this, but would be good to know what you expect....a Promise rejection, as I suggest above? |
A Promise rejection wood be perfect. Even if I know the Endpoint is destroyed i‘m not able to reject a Promis, even if I have the promise (and normally only the creator of the promise should resolve or reject).
Best solution would be promises „owned“ by
Endpoint so all promises can be rejected if the endpoint is destroyed/ crashed whatever.
Von meinem iPhone gesendet
Am 23.11.2018 um 19:00 schrieb Dave Horton <[email protected]<mailto:[email protected]>>:
Yes, this is how it currently works. If you destroy the Endpoint (as you do in the 'destroy' handler for the sip dialog) then any operations are terminated by freeswitch and those promises won't resolve .
I suppose it would be more correct to have those promises be rejected (or callbacks invoked with an error) that indicate the call / session was terminated? In practice, I have never had the need to want to receive those since once the call is over I implicitly know all operations have ceased and I mostly proceed to doing my cleanup code. I can take a deeper look at this, but would be good to know what you expect....a Promise rejection, as I suggest above?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#9 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYvpiO1F36TBfmT2O1te7Nc-y665pZdWks5uyDezgaJpZM4YwlgY>.
|
How do you end a Promise if your Code waits on the Promise.
Maybe this is only needed for persons like me, working with async functions.
Von meinem iPhone gesendet
Am 23.11.2018 um 19:00 schrieb Dave Horton <[email protected]<mailto:[email protected]>>:
Yes, this is how it currently works. If you destroy the Endpoint (as you do in the 'destroy' handler for the sip dialog) then any operations are terminated by freeswitch and those promises won't resolve .
I suppose it would be more correct to have those promises be rejected (or callbacks invoked with an error) that indicate the call / session was terminated? In practice, I have never had the need to want to receive those since once the call is over I implicitly know all operations have ceased and I mostly proceed to doing my cleanup code. I can take a deeper look at this, but would be good to know what you expect....a Promise rejection, as I suggest above?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#9 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYvpiO1F36TBfmT2O1te7Nc-y665pZdWks5uyDezgaJpZM4YwlgY>.
|
At the end I think a Promise should always end by the component which created the Promise (even by timeout). Only this way it’s possible for booth sites to continue correctly (means „at a trusted state“).
Second problem would be a possible memory leak by unresolved promises / or never called callbacks!
Von meinem iPhone gesendet
Am 23.11.2018 um 20:47 schrieb Häferer, Andreas <[email protected]<mailto:[email protected]>>:
How do you end a Promise if your Code waits on the Promise.
Maybe this is only needed for persons like me, working with async functions.
Von meinem iPhone gesendet
Am 23.11.2018 um 19:00 schrieb Dave Horton <[email protected]<mailto:[email protected]>>:
Yes, this is how it currently works. If you destroy the Endpoint (as you do in the 'destroy' handler for the sip dialog) then any operations are terminated by freeswitch and those promises won't resolve .
I suppose it would be more correct to have those promises be rejected (or callbacks invoked with an error) that indicate the call / session was terminated? In practice, I have never had the need to want to receive those since once the call is over I implicitly know all operations have ceased and I mostly proceed to doing my cleanup code. I can take a deeper look at this, but would be good to know what you expect....a Promise rejection, as I suggest above?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#9 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYvpiO1F36TBfmT2O1te7Nc-y665pZdWks5uyDezgaJpZM4YwlgY>.
|
we had solved the problem by implementing a BreakablePromise. This class implements a Set of Promises. If an event (like destroy) occurs, all promises in unresolved( like on .play or .playCollect) will be broken (resolved) with a special error. |
ok. I'm still going to look into properly resolving/rejecting those promises. let's leave this issue open until I do so. |
So far i‘ve build a BreakablePromise Wrapper, to break alle unresolved Promises for an endpoint in case of an destroy event.
Von meinem iPhone gesendet
Am 30.11.2018 um 16:23 schrieb Dave Horton <[email protected]<mailto:[email protected]>>:
ok. I'm still going to look into properly resolving/rejecting those promises. let's leave this issue open until I do so.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#9 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYvpiJ-QoYgcPVR5fzHDHCspmHjYO2R3ks5u0U1_gaJpZM4YwlgY>.
|
we have a sample conneting to a local PhonerLite.
The Playback works, but if the remoteparty (Phonerlite) hangs up during playback the Promise
never ends...
The destroy event from Dialog is fired
The text was updated successfully, but these errors were encountered: