Open mguerrieri opened 7 years ago
Think you referenced the wrong issue above- should have referenced issue #60, this is a different issue.
Yep, I fixed the commit and force-pushed but the link is still in the Github UI.
re: this one, I'm trying to re-work it into an example that does what you want.
Any thoughts as to why it hangs as-is?
I think I may have this figured out. The
<action application="set" data="park_after_bridge=true" />
in the dialplan seems to be the culprit. I think this is needed for an inbound socket app to keep the channel alive after a bridge, but for an outbound channel app, it seems that the channel remains under the outbound socket's control after the bridge ends. Having park_after_bridge set causes the fist bridge to succeed, and park is executed when it ends. The next bridge works under the context of the park application, which ends when the bridge ends, which appears to leave the channel in a hung state. Bottom line is that is does not appear that park plays well with outbound sockets (at least in my scenario).
That would make sense. Some dialplan applications are blocking and will not yield control of the channel until finished.
Have you tried setting HangUpAfterBridge = false
on the bridge call? It works with outbound sockets.
Also, all the stuff you've done in dialplan XML you should be able to do with the InboundSocket
.
The FreeSWITCH docs state that false is the default value for hangup_after_bridge, so I just didn’t set it at all. As for the dialplan stuff, it is there just because we want to give control of things like whether to play a tone on connect and what type of tone, etc. to an end-user who can make those changes without knowing anything about the socket code, but yeah, I could (and previously did) use the InboundSocket to answer/play tone/park, etc.
From: Dan Barua [mailto:notifications@github.com] Sent: Tuesday, September 20, 2016 4:54 AM To: danbarua/NEventSocket NEventSocket@noreply.github.com Cc: Mark Guerrieri mguerrieri@jmbtech.net; Author author@noreply.github.com Subject: Re: [danbarua/NEventSocket] BridgeTo hangs when called multiple times (#62)
That would make sense. Some dialplan applications are blocking and will not yield control of the channel until finished. Have you tried setting HangUpAfterBridge = false on the bridge call? It works with outbound sockets. Also, all the stuff you've done in dialplan XML you should be able to do with the InboundSocket.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danbarua/NEventSocket/issues/62#issuecomment-248243036 , or mute the thread https://github.com/notifications/unsubscribe-auth/AEGPVVXNM47FLBHnNAYKlmoVKziHnzqyks5qr58TgaJpZM4KANY7 . https://github.com/notifications/beacon/AEGPVdS2aPcHmTGTo5Id6g1PilVV5Fytks5qr58TgaJpZM4KANY7.gif
I am able to reproduce this issue against the stable and latest codebases. Open an inbound socket and originate to a phone. Using Channel API, get channel for successfully originated call. Wait 10 seconds and call BridgeTo to bridge to a different phone number. Bridge is successful. Hangup bridged phone, and detect the hangup in Channel API. Wait 10 seconds and call BridgeTo to bridge to the phone number again. Bridge is successful. Wait 10 seconds and call BridgeTo a 3rd time. BridgeTo hangs and never returns, fs_cli shows no indication that it received the bridge command. Channel remains hung until you hangup the originally originated call, then BridgeTo returns and fs_cli shows the bridge command failing (obviously) because of the hangup. I have tried this countless times and it always hangs on the 3rd BridgeTo. I also tried setting the event-lock option on the bridge (as recommended by the FS docs for an outbound socket bridge, but it made no difference. Also, my original version of the code used only the inbound socket and no Channel API, but I had the same problem (which prompted me to try outbound sockets/Channel API).
This is a showstopper for me and I am at a loss, not being very fluent in the reactive extensions (I can only debug so far before I get in over my head). Any help is greatly appreciated.
Below is a console app to reproduce (.NET Core console app)- obviously substitute your own FS config and phone numbers.
Dial Plan:
project.json:
Program.cs: