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

I put the Who? in Mishehu mishehu at freeswitch.org
Fri May 8 17:33:40 MSD 2015


Have you attempted to run the command, minus the "bgapi" part directly 
from fs_cli or the FreeSWITCH console?  I would recommend doing this, 
and enabling debug output (f8).  It will be a bit painfully verbose, but 
it should reveal some information.  Based upon the information you 
provided, you're not actually giving any handling commands to this new 
channel that you are originating.  It needs to bridge to something or 
run some sort of dialplan application otherwise it vanishes as quickly 
as it was created.

-Yossi

On 05/08/2015 04:21 AM, Sina Owolabi wrote:
> 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!
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org




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