[Freeswitch-dev] mod_python error

Gabriel Gunderson gabe at gundy.org
Wed Dec 15 20:56:52 MSK 2010


On Fri, Dec 10, 2010 at 12:40 AM, peter_green lion <betergreen at live.com> wrote:
> I see mod_python in wiki and i try to make some example as page:
> http://wiki.freeswitch.org/wiki/Examples_directory_py

That script looks out dated.  See the docs here:
http://wiki.freeswitch.org/wiki/Mod_python#Python_module_specification



> def handler(uuid):
>     alphabet = "abcdefghijklmnopqrstuvwxyz"
>     numbers = "22233344455566677778889999"
>     code_to_name = {}
>     code = ""

Looks the the session should have been passed in there like so:

def handler(session, args):



> i log in soft phone and make call to :1234
> call hangup and i see log in freeswitch -c:
> 2010-12-10 02:35:55.711484 [ERR] mod_python.c:200 Error calling python
> script
> TypeError: handler() takes exactly 1 argument (2 given)

Redefine the handler function and let us know what you find.

My advice would be to start with a small script and make sure you
understand how it's being called.  Something like hello_world.  Once
you have that working, move on from there.

Good luck,
Gabe

BTW, it seems like this belongs on the regular FreeSWITCH users list.



More information about the FreeSWITCH-dev mailing list