sangoma / switchy

async FreeSWITCH cluster control
https://switchy.readthedocs.io/en/latest/
Mozilla Public License 2.0
69 stars 18 forks source link

Service cli #63

Closed goodboy closed 7 years ago

goodboy commented 7 years ago

Adds switchy serve for launching cluster control services easily from the CLI. This makes it super easy to test call processing apps and connections to remote FS hosts.

This was original instigated by #62 so thanks to @k4ml for the initial request :+1:

k4ml commented 7 years ago

The password seem to work, both from cli and Service class. But how do I pass app to the serve command ?

./bin/switchy serve 127.0.0.1 --app switchy.apps.routers.Router --password=mypass
Apr 06 01:16:17 (MainThread) [WARNING] root storage.py:23 : No module named 'pandas'
Apr 06 01:16:18 (MainThread) [INFO] switchy.EventListener@127.0.0.1 observe.py:301 : Connected listener 'a2e2fdc2-1a66-11e7-ab7e-06c8a08c25e1' to '127.0.0.1'
Error: Unknown app 'switchy.apps.routers.Router'
Use list-apps command to list available apps

switchy.apps.routers.Router is listed by list-apps. Try with --app=switchy.apps.routers also gave the same error.

goodboy commented 7 years ago

@k4ml ahh yeah so right now it works by passing the class name. In your case that is just 'Router'.

Maybe this isn't very intuitive and both should work?

goodboy commented 7 years ago

@k4ml I added the support for loading arbitrary modules using --app mod.submod:AppName module path syntax or file path syntax --app /path/to/my/dialplan.py:router.

Let me know what you think!

goodboy commented 7 years ago

@moises-silva @vodik @tsemczyszyn ping ping.

Just need a sanity check on this!

goodboy commented 7 years ago

@vodik one more call for you here ;)