drachtio / drachtio-fsmrf

Drachtio freeswitch-based media resource function -- http://davehorton.github.io/drachtio-fsmrf
MIT License
47 stars 26 forks source link

mediaserver connection timeout #73

Closed spointer closed 1 year ago

spointer commented 1 year ago

Hello Dave,

My app is UAS and drachtio-fsmrf sends 200 OK to remote sip server internally even if freeswitch connection has timed out(connectCaller or createEndpoint). So my app has no way to disconnect(sending bye) because drachtio-fsmrf does not return any dialog or endpoint object, just throw error callback.

Is there any way to resolve this?

Thanks.

davehorton commented 1 year ago

not sure I am following the scenario but if you can provide logs that would be helpful

spointer commented 1 year ago

It seems that happens only on webRTC call because in plain RTP call, createEndpoint throws timeout error and that error is thrown to app before calling createUAS internally..

BTW what log will be helpful?

lylepratt commented 1 year ago

How big is the SDP you’re sending from your webrtc call? This sounds similar to issues we’ve had in the past with SDP being cut off. FS just barfs on it because it can’t parse the cut off SDP.

spointer commented 1 year ago

No, timeout is raised in case my app does not set TURN ICE candidates properly on mobile(5G) network, but if TURN candidates are set, all are good. I found this issue in former situation and let you know.

spointer commented 1 year ago

I think UA dialog also should be destroyed in this code snippet of connectCaller function at least because app cannot know UA dialog and cannot send bye when timeout error is thrown.

Any ideas?

        /* timeout waiting for esl connection after invite to FS answered */
        const timeoutFn = (dialog, uuid) => {
          delete this.pendingConnections.delete(uuid);
          dialog.destroy();
          pair.dialog && pair.dialog.destroy(); // UA dialog destroy
          debug(`MediaServer#createEndpoint - (srtp scenario) connection timeout for ${uuid}`);
          callback(new Error('Connection timeout')) ;
        };
davehorton commented 1 year ago

probably makes sense. Do you want to give me a PR?

spointer commented 1 year ago

I made a PR including createEndpoint headers issue.

davehorton commented 1 year ago

merged!

spointer commented 1 year ago

Hello Dave, When do you plan to release this issue?

davehorton commented 1 year ago

Thanks for reminding me. I just pushed this fix in 3.0.21