Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

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


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





PostPosted: Wed Jan 21, 2009 5:46 pm    Post subject: [Freeswitch-users] Error: eval_some_python() Error importing Reply with quote

Greetings,

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)

# echo $PYTHONPATH
/usr/local/freeswitch/python

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

# ls $PYTHONPATH
bar.py bar.pyc

# cat $PYTHONPATH/bar.py
stream.write("baz")


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"
data="{group_confirm_file=vm-hello,group_confirm_key=4,call_timeout=60}
sofia/internal/1000,sofia/internal/1002" />
</condition>
</extension>

(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:


Quote:
2009-01-21 15:20:14 [DEBUG] switch_core_state_machine.c:152 switch_core_standard_on_execute() sofia/internal/1000@10.48.5.207 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@10.48.5.207 Expanded String set(foo=)
2009-01-21 15:20:14 [DEBUG] mod_dptools.c:699 set_function() sofia/internal/1000@10.48.5.207 SET [foo]=[UNDEF]


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

TIA,
Brian


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
anthony.minessale at g...
Guest





PostPosted: Wed Jan 21, 2009 5:58 pm    Post subject: [Freeswitch-users] Error: eval_some_python() Error importing Reply with quote

add

def fsapi(session, stream, env, args):
stream.write("baz")


see:
http://svn.freeswitch.org/svn/freeswitch/trunk/src/mod/languages/mod_python/python_example.py

could make a good addition to the wiki




On Wed, Jan 21, 2009 at 4:40 PM, Brian Deacon <bdeacon@highergear.com (bdeacon@highergear.com)> wrote:
Quote:
Greetings,

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)

# echo $PYTHONPATH
/usr/local/freeswitch/python

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

# ls $PYTHONPATH
bar.py bar.pyc

# cat $PYTHONPATH/bar.py
stream.write("baz")


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"
data="{group_confirm_file=vm-hello,group_confirm_key=4,call_timeout=60}
sofia/internal/1000,sofia/internal/1002" />
</condition>
</extension>

(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:


Quote:
2009-01-21 15:20:14 [DEBUG] switch_core_state_machine.c:152 switch_core_standard_on_execute() sofia/internal/1000@10.48.5.207 (1000@10.48.5.207) 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@10.48.5.207 (1000@10.48.5.207) Expanded String set(foo=)
2009-01-21 15:20:14 [DEBUG] mod_dptools.c:699 set_function() sofia/internal/1000@10.48.5.207 (1000@10.48.5.207) SET [foo]=[UNDEF]


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

TIA,
Brian


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
msc at freeswitch.org
Guest





PostPosted: Wed Jan 21, 2009 6:36 pm    Post subject: [Freeswitch-users] Error: eval_some_python() Error importing Reply with quote

On Wed, Jan 21, 2009 at 2:40 PM, Brian Deacon <bdeacon@highergear.com> wrote:
Quote:
Greetings,

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.)
Thanks, you're hired! Smile
We definitely need Python users to step up and help with the docs.
There are only a few people so far who use Python so those who do use,
and want to see it flourish, need to work on the documentation.
Please start here:
http://wiki.freeswitch.org/wiki/Mod_python
Take it from there...
-MC
Quote:

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)

# echo $PYTHONPATH
/usr/local/freeswitch/python

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

# ls $PYTHONPATH
bar.py bar.pyc

# cat $PYTHONPATH/bar.py
stream.write("baz")


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"
data="{group_confirm_file=vm-hello,group_confirm_key=4,call_timeout=60}
sofia/internal/1000,sofia/internal/1002" />
</condition>
</extension>

(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:


Quote:
2009-01-21 15:20:14 [DEBUG] switch_core_state_machine.c:152 switch_core_standard_on_execute() sofia/internal/1000@10.48.5.207 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@10.48.5.207 Expanded String set(foo=)
2009-01-21 15:20:14 [DEBUG] mod_dptools.c:699 set_function() sofia/internal/1000@10.48.5.207 SET [foo]=[UNDEF]


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

TIA,
Brian


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
stevecrozz at gmail.com
Guest





PostPosted: Wed Jan 21, 2009 6:51 pm    Post subject: [Freeswitch-users] Error: eval_some_python() Error importing Reply with quote

I would love to see the documentation for python flourish. I would
have chosen python for my recent development if I could have quickly
figured out how to use it. I chose the javascript route instead
because of all the examples on the wiki.

--Stephen

On Wed, Jan 21, 2009 at 3:33 PM, Michael Collins <msc@freeswitch.org> wrote:
Quote:
On Wed, Jan 21, 2009 at 2:40 PM, Brian Deacon <bdeacon@highergear.com> wrote:
Quote:
Greetings,

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.)
Thanks, you're hired! Smile
We definitely need Python users to step up and help with the docs.
There are only a few people so far who use Python so those who do use,
and want to see it flourish, need to work on the documentation.
Please start here:
http://wiki.freeswitch.org/wiki/Mod_python
Take it from there...
-MC
Quote:

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)

# echo $PYTHONPATH
/usr/local/freeswitch/python

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

# ls $PYTHONPATH
bar.py bar.pyc

# cat $PYTHONPATH/bar.py
stream.write("baz")


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"
data="{group_confirm_file=vm-hello,group_confirm_key=4,call_timeout=60}
sofia/internal/1000,sofia/internal/1002" />
</condition>
</extension>

(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:


Quote:
2009-01-21 15:20:14 [DEBUG] switch_core_state_machine.c:152 switch_core_standard_on_execute() sofia/internal/1000@10.48.5.207 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@10.48.5.207 Expanded String set(foo=)
2009-01-21 15:20:14 [DEBUG] mod_dptools.c:699 set_function() sofia/internal/1000@10.48.5.207 SET [foo]=[UNDEF]


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

TIA,
Brian


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
stevecrozz at gmail.com
Guest





PostPosted: Wed Jan 21, 2009 8:01 pm    Post subject: [Freeswitch-users] Error: eval_some_python() Error importing Reply with quote

I'd like to see an example of recording voicemail and a good
conference application, tone generation, just a good IVR example would
be nice too.

--Stephen

On Wed, Jan 21, 2009 at 4:42 PM, Brian Deacon <bdeacon@highergear.com> wrote:
Quote:
Well, rescuing someone from the evils of javascript cleans so many years
off my time in purgatory that I couldn't possibly pass up the chance. Smile

But I'm still probably another week or two from qualifying as N00b. I
imagine I could probably handle transcoding javascript examples to
python if it's mostly just a syntax issue, which I imagine is most
cases.

I could start whacking one out if someone told me which examples to
steer away from because of javascript- or python-specific issues.

Brian

On Wed, 2009-01-21 at 15:45 -0800, Stephen Crosby wrote:
Quote:
I would love to see the documentation for python flourish. I would
have chosen python for my recent development if I could have quickly
figured out how to use it. I chose the javascript route instead
because of all the examples on the wiki.

--Stephen

On Wed, Jan 21, 2009 at 3:33 PM, Michael Collins <msc@freeswitch.org> wrote:
Quote:
On Wed, Jan 21, 2009 at 2:40 PM, Brian Deacon <bdeacon@highergear.com> wrote:
Quote:
Greetings,

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.)
Thanks, you're hired! Smile
We definitely need Python users to step up and help with the docs.
There are only a few people so far who use Python so those who do use,
and want to see it flourish, need to work on the documentation.
Please start here:
http://wiki.freeswitch.org/wiki/Mod_python
Take it from there...
-MC
Quote:

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)

# echo $PYTHONPATH
/usr/local/freeswitch/python

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

# ls $PYTHONPATH
bar.py bar.pyc

# cat $PYTHONPATH/bar.py
stream.write("baz")


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"
data="{group_confirm_file=vm-hello,group_confirm_key=4,call_timeout=60}
sofia/internal/1000,sofia/internal/1002" />
</condition>
</extension>

(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:


Quote:
2009-01-21 15:20:14 [DEBUG] switch_core_state_machine.c:152 switch_core_standard_on_execute() sofia/internal/1000@10.48.5.207 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@10.48.5.207 Expanded String set(foo=)
2009-01-21 15:20:14 [DEBUG] mod_dptools.c:699 set_function() sofia/internal/1000@10.48.5.207 SET [foo]=[UNDEF]


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

TIA,
Brian


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Wed Jan 21, 2009 8:19 pm    Post subject: [Freeswitch-users] Error: eval_some_python() Error importing Reply with quote

Most if not all of this functionality is done with FreeSWITCH without
any need for python in the first place.

For example you don't use python for voicemail, conferences, tone
generation but maybe IVR... which is what any of the languages are for.

/b

On Jan 21, 2009, at 7:00 PM, Stephen Crosby wrote:

Quote:
I'd like to see an example of recording voicemail and a good
conference application, tone generation, just a good IVR example would
be nice too.

--Stephen


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
stevecrozz at gmail.com
Guest





PostPosted: Thu Jan 22, 2009 12:47 pm    Post subject: [Freeswitch-users] Error: eval_some_python() Error importing Reply with quote

The reason I'd like to see the examples isn't so I can have a basic
voicemail or IVR app, but so I can extend an example with my own
complicated domain logic.

--Stephen

On Wed, Jan 21, 2009 at 5:14 PM, Brian West <brian@freeswitch.org> wrote:
Quote:
Most if not all of this functionality is done with FreeSWITCH without
any need for python in the first place.

For example you don't use python for voicemail, conferences, tone
generation but maybe IVR... which is what any of the languages are for.

/b

On Jan 21, 2009, at 7:00 PM, Stephen Crosby wrote:

Quote:
I'd like to see an example of recording voicemail and a good
conference application, tone generation, just a good IVR example would
be nice too.

--Stephen


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
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