使用django.db模型在dialplan中使用一些python脚本运行freeswitch时遇到了问题。每当它启动时都会导致错误:
freeswitch@ubuntu> 2013-08-15 06:56:08.094348 [ERR] mod_python.c:231 Error importing module
2013-08-15 06:56:08.094348 [ERR] mod_python.c:164 Python Error by calling script "fs_scripts.ringback": <type 'exceptions.IOError'>
Message: [Errno 10] No child processes
Exception: None
Traceback (most recent call last)
File: "/home/piotrek/lettel/fs_scripts/ringback.py", line 19, in <module>
File: "/home/piotrek/lettel/api/call.py", line 3, in <module>
File: "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 11, in <module>
File: "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
File: "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
File: "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 93, in __init__
File: "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
File: "/home/piotrek/lettel/lettel/settings.py", line 13, in <module>
File: "/usr/local/lib/python2.7/dist-packages/djcelery/__init__.py", line 25, in <module>
File: "/usr/local/lib/python2.7/dist-packages/celery/__compat__.py", line 135, in __getattr__
File: "/usr/local/lib/python2.7/dist-packages/celery/_state.py", line 19, in <module>
File: "/usr/local/lib/python2.7/dist-packages/celery/utils/__init__.py", line 22, in <module>
File: "/usr/local/lib/python2.7/dist-packages/kombu/entity.py", line 10, in <module>
File: "/usr/local/lib/python2.7/dist-packages/kombu/abstract.py", line 12, in <module>
File: "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 24, in <module>
File: "/usr/local/lib/python2.7/dist-packages/kombu/log.py", line 8, in <module>
File: "/usr/local/lib/python2.7/dist-packages/kombu/utils/compat.py", line 68, in <module>
File: "/usr/lib/python2.7/platform.py", line 1337, in system
File: "/usr/lib/python2.7/platform.py", line 1304, in uname
File: "/usr/lib/python2.7/platform.py", line 1039, in _syscmd_uname
编辑:导致错误的行是django.db的简单导入:
来自django.db导入模型
这整个设置已经在我无权访问的服务器上运行,所以django应用程序或脚本似乎没有错...
任何帮助都会受到赞赏,因为我没有想法如何解决这个问题......
答案 0 :(得分:0)
我不知道您的性能和可扩展性要求,尽管软交换具有运行rtp流和信令的实时要求。因此,在mod_python下运行django应用程序不是一个好的解决方案。此外,这与python解释器不同,某些东西不起作用。你可以在这里查看mod_python问题: mod_python issues
我建议你在客户端/服务器架构中拆分你的python解决方案。在mod_python下运行的脚本将对您的Django应用程序进行查询。这样你就可以摆脱Freeswitch方面的复杂性,获得可扩展性,提高性能,并且最有可能让一切正常运行。