Comments (10)
If NEventSocket detects a logging library in your program, such as NLog, Log4Net etc then it will route log messages to that. Could you log trace-level messages to a file and paste the logs here and we can see what is going on?
from neventsocket.
I installed Nlog and tried example.
This is last debug trace that I get
2015-08-12 03:59:47 TID[13] DEBUG CommandReply re
ceived [+OK event listener enabled plain] for [event plain CHANNEL_EXECUTE_COMPL
ETE BACKGROUND_JOB CHANNEL_HANGUP CHANNEL_ANSWER CHANNEL_PROGRESS CHANNEL_PROGRESS_MEDIA CHANNEL_BRIDGE CHANNEL_UNBRIDGE CUSTOM conference::maintenance]
This is code snippet that I use:
await client.SubscribeEvents();
client.Events.Where(x => x.EventName == EventName.ChannelAnswer)
.Subscribe(x =>
{
uuid = x.UUID;
ColorConsole.WriteLine("Channel Answer Event ".Blue(), x.UUID);
});
Is there a way I can send you private my ESL settings (ip,user, pass), so you can try to subscribe for example to HEARTBEAT event?
from neventsocket.
Sure, it's my GitHub user name at gmail.com
from neventsocket.
It looks like calling Console.ReadLine()
blocks subscription callbacks.
As a workaround, adding await Task.Delay(200);
before Console.ReadLine();
seems to do the trick.
from neventsocket.
If you're calling Console.ReadLine() in production, you have bigger issues.
:) you would normally be running as a Windows Service where blocking the UI
thread is not an issue.
On Thu, 15 Oct 2015 at 18:58, gregoriusus [email protected] wrote:
That's great news. Just one question. Is this workaround ok for production?
Best regards, Gregor
On Thu, Oct 15, 2015, 19:09 Dan Barua [email protected] wrote:
It looks like calling Console.ReadLine() blocks subscription callbacks.
As a workaround, adding await Task.Delay(200); before Console.ReadLine();
seems to do the trick.—
Reply to this email directly or view it on GitHub
<
https://github.com/danbarua/NEventSocket/issues/20#issuecomment-148460186>
.Gregor Nanger
CTO
t./f.: 00386 (0) 7 6000 308/309 • m:. 00386 (0)41 756485
• Infomedia d.o.o. • Jerebova 3, Novo mesto, Slovenia
• www.infomedia.si—
Reply to this email directly or view it on GitHub
#20 (comment)
.
from neventsocket.
alternatively, instead of calling Console.ReadLine();
we can do this to avoid blocking the main thread:
Console.WriteLine("Press CTRL+C to exit");
await Observable.FromEventPattern<ConsoleCancelEventHandler, ConsoleCancelEventArgs>(
h => Console.CancelKeyPress += h,
h => Console.CancelKeyPress -= h).ToTask();
from neventsocket.
Seems to be working now.
from neventsocket.
This seems like a great library, but I'm also having the same problem. Using latest release from nuget (1.0.2). I am not using Console.ReadLine(). I'm using the sample code from the readme (below). The only change is that I write to Debug window instead of Console window. The "status" response works fine and I get status output in Debug window, but after that no events are being displayed from FreeSWITCH. I also tried subscribing to EventName.All, with no luck either. How do I go about debugging this? Thanks.
public async Task Test()
{
using (var socket = await InboundSocket.Connect("10.10.10.77", 8021, "ClueCon"))
{
var apiResponse = await socket.SendApi("status");
Debug.WriteLine(apiResponse.BodyText);
await socket.SubscribeEvents(EventName.ChannelAnswer);
socket.Events
.Where(x => x.EventName == EventName.ChannelAnswer)
.Subscribe(x =>
{
Debug.WriteLine("Channel Answer Event " + x.UUID);
});
}
}
from neventsocket.
Well, you have to use Readline otherwise your program finish.
from neventsocket.
Never mind. My fault. The local socket variable was going out of scope, so it clearly could no longer react to events. Fixed by making it an instance variable instead of a local one. Kudos on the library again.
EDIT: I posted before seeing your response. Thanks.
from neventsocket.
Related Issues (20)
- Public member 'Where' on type 'Select(Of BasicMessage,EventMessage)' not found. HOT 14
- Not all CHANNEL_HANGUP_COMPLETE are received HOT 6
- ApiResponse.ErrorMessage returns a trailing "\n" HOT 2
- ApiResponse: Is "-ERR no reply" an error? HOT 3
- Use Logging/Diagnostics context for Channels
- Split Channel Events into separate message type/observable HOT 1
- Feature: Add Event helpers for Sofia custom events HOT 1
- socket disconnect HOT 1
- ChannelHangupComplete event HOT 8
- BridgedChannels and OtherLeg HOT 1
- BridgeTo hangs when called multiple times HOT 6
- BridgeTo does not return BridgeResult HOT 3
- Cannot access a disposed object. Object name: 'NEventSocket.InboundSocket'. HOT 3
- All calls return HangupCause.UnallocatedNumber HOT 2
- PlayGetDigitsResult is not Success when no digits is provided by user HOT 2
- Cancel networkStream.ReadAscync() on socket shutdown
- Bridge simultaneous ring multiple endpoints HOT 1
- I will pay for good help configuring freeswitch and making the demo code work.
- Hangup call after number of seconds
- Transfer audio between two legs of call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neventsocket.