[Freeswitch-dev] Fwd: mod_python load error?

Johny Kadarisman jkr888 at gmail.com
Mon Nov 13 11:54:14 EST 2006


Hi Anthony,

Yea, I'm still looking at the parameters passing between pythons scripts and
freeswitch code. So I am wondering, how we did it in perl scripts.

I'll stop by IRC tonight then....

JK

On 11/13/06, Anthony Minessale <anthmct at yahoo.com> wrote:
>
>  Hi,
>
> The swig code in there builds a binary module against libfreeswitch.
> so if you load that module from the embedded python interpreter you can
> use those calls from your script to call freeswitch code.
>
> stop by irc if you want some more info.
>
>
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> JABBER: anthony.minessale at gmail.com
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at 66.250.68.194
> iax:guest at 66.250.68.194/888
> googletalk:freeswitch at gmail.com
> pstn:712-432-7800
>
>
> ----- Original Message ----
> From: Johny Kadarisman < jkr888 at gmail.com>
> To: freeswitch-dev at lists.freeswitch.org
> Sent: Monday, November 13, 2006 9:49:16 AM
> Subject: [Freeswitch-dev] Fwd: mod_python load error?
>
> Hi all,
>
> I made a few changes in mod_python. Now at least, I can load & execute
> simple python scripts. Haven't test much yet, but its execute following
> scripts:
>
>
> ========================
>
> import sys
> from _freeswitch import *
>
> print "Hello World!\n"
> print sys.path
> print dir()
>
> fs_consol_log("1", "Hello World from inside mypython.py.\n")
>
> =============================
>
> 2006-11-11 00:34:33 [DEBUG] switch_core.c:2497 switch_core_standard_on _execute()
> Standard EXECUTE
> 2006-11-11 00:34:33 [NOTICE] switch_core.c:2506
> switch_core_standard_on_execute() Execute
> python(/usr/local/freeswitch/mypython.py)
> Hello World!
>
> ['/usr/lib/python24.zip', '/usr/lib/python2.4',
> '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
> '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages',
> '/usr/lib/python2.4/site-packages',
> '/usr/lib/python2.4/site-packages/HTMLgen',
> '/usr/lib/python2.4/site-packages/Numeric',
> '/usr/lib/python2.4/site-packages/PIL',
> '/usr/lib/python2.4/site-packages/cairo',
> '/usr/lib/python2.4/site-packages/gst- 0.10',
> '/usr/lib/python2.4/site-packages/gtk-2.0']
> ['__builtins__', '__doc__', '__file__', '__name__', 'fs_channel_answer',
> 'fs_channel_get_variable', 'fs_channel_hangup', 'fs_channel_pre_answer',
> 'fs_channel_set_state', 'fs_channel_set_variable', 'fs_consol_clean',
> 'fs_consol_log', 'fs_console_loop', 'fs_core_destroy', 'fs_core_init',
> 'fs_core_session_locate', 'fs_core_set_globals', 'fs_ivr_play_file',
> 'fs_ivr_play_file2', 'fs_loadable_module_init',
> 'fs_loadable_module_shutdown', 'fs_switch_channel_get_variable',
> 'fs_switch_channel_set_variable', 'fs_switch_ivr_collect_digits_callback',
> 'fs_switch_ivr_collect_digits_count', 'fs_switch_ivr_originate',
> 'fs_switch_ivr_record_file', 'fs_switch_ivr_session_transfer',
> 'fs_switch_ivr_sleep', 'fs_switch_ivr_speak_text', 'sys']
> 2006-11-11 00:34:33 [DEBUG] switch_swig.c:96 fs_consol_log() Hello World
> from inside mypython.py.
> 2006-11-11 00:34:33 [NOTICE] switch_core.c:2558
> switch_core_standard_on_execute() Hangup sofia/test/ubuntu at 192.168.1.146[CS_EXECUTE] [NORMAL_CLEARING]
> 2006-11-11 00:34:33 [INFO] switch_channel.c:973
> switch_channel_perform_hangup() Kill sofia/test/ubuntu at 192.168.1.146 [1]
> 2
> ====================
>
>
> before committing to the trunk, I would like to make it consistence with
> perl implementation. Can some one send me example on how to use fs_*
> function in perl scripts. ie, how you pass uuid to perl, how you get
> sessions from uuid, etc. I'll try to make it work with python scripts.
>
> JK
>
>
> ---------- Forwarded message ----------
> From: Brian West < brian.west at mac.com>
> Date: Nov 11, 2006 10:21 PM
> Subject: Re: [Freeswitch-dev] mod_python load error?
> To: Johny Kadarisman < jkr888 at gmail.com>
>
> Populate the changes into your branch.  Then alert MikeJ on IRC and he can
> pull them down.. Infact we can give you commit to the trunk for those
> modules if you like.  Get on IRC and talk to xachen, MikeJ and anthm.
> /b
>
>  On Nov 11, 2006, at 9:15 PM, Johny Kadarisman wrote:
>
>  Anyway, thats the progress so far :)
> If I like to submit this fixes to the trunk, what is the procedure?
>
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20061113/51cc43f7/attachment-0001.html 


More information about the Freeswitch-dev mailing list