-
Notifications
You must be signed in to change notification settings - Fork 124
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
QUESTION: events per socketConnection or not #2
Comments
Hmm so how it works is that goesl client is a raw connection towards freeswitch esl. It's designed to be one connection to rule them all so you will get all events within single connection. It's up to you to manage specific events and their states. Each DTMF event will be related to leg that actually initialized DTMF event. So to answer your question, No. Each call will receive its related event. Other call, unless intentional, won't receive that event. If you have leg A and leg B connected on the same call than when leg A ships event, B leg will receive it. Same happens with reversed order. Now don't get me fully for my word but I think that all of this can be modified within freeswitch config. I've just never went that deep. Didn't need to yet. |
thanks for your reply, (calls block until we get CHANNEL_EXECUTE_COMPLETE for that application for easy synchronous IVR logic) I need listen to call events and process them that I encountered issue#1 and got this question. |
Check this one out :D https://github.com/0x19/goesl/blob/master/examples/server_playback.go#L75 |
I have seen this but it does not allow for synchronous logic. I want to execute next line of code when playback is completed. |
You have 3rd parameter that can help you with that :) https://github.com/0x19/goesl/blob/master/connection.go#L61 From http://wiki.freeswitch.org/wiki/Event_Socket_Outbound
|
Thank for your guides, but third option keeps freeswitch in lock state, but
|
Hmm ok so if I am aware correctly you should be able to do this without any issues. However, I gotta admit I have no clear image on what your code looks alike or what you wish to accomplish so I may be saying things you already know. if sm, err := conn.Execute("playback", "file_one.wav", true); err != nil {
Error("Got error while executing playback: %s", err)
break
} else {
Debug("Playback Message: %s", sm)
}
// Do some logic here
if sm, err := conn.Execute("playback", "file_two.wav", true); err != nil {
Error("Got error while executing playback: %s", err)
break
} else {
Debug("Playback Message: %s", sm)
}
// Do some additional logic here
// Hangup and do not wait
if hm, err := conn.ExecuteHangup(cUUID, "", false); err != nil {
Error("Got error while executing hangup: %s", err)
break
} else {
Debug("Hangup Message: %s", hm)
} |
I appreciate your very help and passion, anyway, if you fix the issue #1 I will fix event dispatching to calls in my code base and finish the job, then I will share it, if it look worthy. if you are really interested i can share it with you in this current immature state. |
@MehSha sorry for late reply on this. Basically I've went ahead, thought about some stuff and I can say that I'd like to rewrite this goesl pretty much so instead of fixing EOF, i'll be doing some changes in 2.0 release. Bringing this goesl more towards micro service than anything else. |
it may seem naive, but i really do not know if the events are streamed per call (socketConnection) or all the events of all calls are received in every connection. I mean, if i want to listen to DTMF in calls, and have two simultaneous calls, if call A send 1 and call b send 2, is this the case that both calls receive both events? or every call receives it's related event (call A, 1 and call B, 2).
if the first is the case,isn't it a good idea to filter events for calls based on call_uuid and let pertinent calls have pertinent events?
The text was updated successfully, but these errors were encountered: