Skip to content
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

Handling exceptions when FS disconnects #45

Open
badcrc opened this issue Mar 8, 2019 · 1 comment
Open

Handling exceptions when FS disconnects #45

badcrc opened this issue Mar 8, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@badcrc
Copy link

badcrc commented Mar 8, 2019

Hi,

I'm working on a script to capture all callcenter related events based on the example log_reg_attempt.py and it's working good, but if FS restarts I get the error:

Error receiving data, is FreeSWITCH running?

Which comes from receive_events() (line 89).

I'm trying to reconnect or handle this as exception but I'm not having luck. How can I do it to detect the disconnect and reconnect again?

An easy way to test this is just to kill the freeswitch process with the script running.

Thanks!

@italorossi italorossi self-assigned this Apr 8, 2019
@italorossi italorossi added this to the 1.0 milestone Apr 8, 2019
@badcrc
Copy link
Author

badcrc commented May 10, 2019

Hi,

I managed to have it working by checking fs.connected in the while loop before gevent.sleep(1), if is False I sleep for 10 seconds and then just call fs_login() again.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants