[Freeswitch-users] Error: eval_some_python() Error importing module

Brian Deacon bdeacon at highergear.com
Wed Jan 21 14:40:45 PST 2009


Couldn't find anything on the wiki or in the mail archives.  (Let me
know where you think a good home for this info might be on the wiki and
I'd be more than happy to write something up in there.)

I'm guessing I haven't done everything necessary to enable python on my
machine.  I have python-2.4.3 and python-devel 2.4.3-21 installed on the
FS machine.

Per the instructions, I uncommented the mod_python line from
modules.conf and rebuilt my freeswitch instance.  Vanilla functionality
is working.  I set PYTHONPATH to /usr/local/freeswitch/python before
restarting the mod_python-enabled freeswitch (via modules.conf.xml)


# grep mod_python \
> /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml 
    <load module="mod_python"/>  

bar.py  bar.pyc

# cat $PYTHONPATH/bar.py

The relevant entry in conf/dialplan/default.xml:
    <extension name="Test_Simple_Python">
        <condition field="destination_number" expression="^1235$">
            <action application="set" data="foo=${python(bar)}" />
            <action application="bridge"
sofia/internal/1000,sofia/internal/1002" />

(The bridge action is only there because it seemed unhappy unless it was
going to actually try to do something.)

The following output shows up in fs_cli when I dial 1235:

> 2009-01-21 15:20:14 [DEBUG] switch_core_state_machine.c:152 switch_core_standard_on_execute() sofia/internal/1000 at Execute set(foo=${python(bar)})
> 2009-01-21 15:20:14 [NOTICE] mod_python.c:107 eval_some_python() Invoking py module: bar
> 2009-01-21 15:20:14 [ERR] mod_python.c:121 eval_some_python() Error importing module
> 2009-01-21 15:20:14 [DEBUG] switch_core_session.c:1254 switch_core_session_execute_application() sofia/internal/1000 at Expanded String set(foo=)
> 2009-01-21 15:20:14 [DEBUG] mod_dptools.c:699 set_function() sofia/internal/1000 at SET [foo]=[UNDEF]

So I'm guessing something dumb on my part.  But there are so many dumb things I'm capable of doing...  :)


More information about the FreeSWITCH-users mailing list