[Freeswitch-users] Help Needed Generating Calls with Web API and Python

Sina Owolabi notify.sina at gmail.com
Fri May 8 13:21:51 MSD 2015


Hi!

I am sorely in need of guidance on how to do this. I have looked at
the wiki page for web api with python and I can run any of the generic
server commands ("show", etc).

I've tried to generate an outbound call through a gateway, but the
server just silently accepts my commands and does nothing. I also see
a corresponding log in freeswitch_http.log that I have just POSTed
something but that's it.

Please can someone guide me on how to originate this properly? I am
gunning for getting this to dial a number and play something.

My script so far:

import xmlrpc.client

host = 'localhost'
username = 'apicaller'
password = 'password'
port = '8080'

server = xmlrpc.client.ServerProxy("http://%s:%s@%s:%s" % (username,
password, host, port))
#print(server.freeswitch.api("show","status"))
server.freeswitch.api('bgapi originate',
'{origination_caller_id_name="Mr
Whiskers",origination_caller_id_number="012345678",ignore_early_media=true}sofia/gateway/agateway/anumber')

Thanks!



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list