Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Rum python script from dialplan


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
rmartinez at redvoiss.net
Guest





PostPosted: Tue Jun 29, 2021 11:10 am    Post subject: [Freeswitch-users] Rum python script from dialplan Reply with quote

Hi
I’m trying to run a script in python from the freeswitch dialplan.  This scripts has calls to a local REDIS DB which I need to query every time a call arrives.
So far I was able to compile freeswitch with mod_python, I even can run a test.py script from the fs_cli like this:
 
freeswitch@reverse> python test
2021-06-25 16:36:36.007177 [NOTICE] mod_python.c:213 Invoking py module: test
2021-06-25 16:36:36.027120 [INFO] switch_cpp.cpp:1465 test
Hello
 
But when  try to add in the test.py the “import redis” line in order to work with my redis db  I’m getting :
 
freeswitch@reverse> python test
2021-06-25 16:37:17.847161 [NOTICE] mod_python.c:213 Invoking py module: test
2021-06-25 16:37:17.847161 [ERR] mod_python.c:261 Error reloading module
 
 
2021-06-25 16:37:17.847161 [ERR] mod_python.c:165 Python Error by calling script "test": <type 'exceptions.ImportError'>
Message: No module named redis
Exception: None
 
Traceback (most recent call last)
        File: "/usr/share/freeswitch/scripts/test.py", line 1, in <module>
 
Maybe I’m not getting correctly the use of pythons scripts?.. Can I use a script that calls another module?... Is possible?
Or maybe there is a better way to do this?.
 
Thanks!
Ricardo
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services