pythonfreeswitch

Freeswitch mod_python No module named freeswitch


I installed Freeswitch 1.6 in Debian 8, using this link. Installing latest release branch section.

Module python is enabled using fs_cli:

>module_exists mod_python                                                                                              
true

Symptoms

When I execute my Python script I get:

    2016-08-05 05:49:23.875318 [ERR] mod_python.c:231 Error importing module
    2016-08-05 05:49:23.875318 [ERR] mod_python.c:164 Python Error by calling script "fax": <type 'exceptions.ImportError'>    
    Message: No module named freeswitch    
    Exception: None    
    Traceback (most recent call last)
File: "/usr/share/freeswitch/scripts/fax.py", line 1, in <module>

Using this document:

Troubleshooting:

  1. This same script is working with other Freeswitch box.

  2. Moved file properly:

    ls -al /usr/local/lib/python2.7/site-packages/ freeswitch.py

  3. Script fax.py content is here

  4. Reboot Freeswitch

  5. Script freeswitch.py location

    • /usr/local/lib/python3.4/dist-packages/freeswitch.py
    • /usr/local/lib/python2.7/site-packages/freeswitch.py
    • /usr/share/pyshared/freeswitch.py

Solution

  • I copied freeswitch.py to /usr/share/freeswitch/scripts/ and that solved the problem.