Using Asterisk's manager interface to generate calls (From Python using pyst)
Last update on .
This is not a deep and profound project, it's a quick "hello world" example script that allows you to generate a call via Asterisk that connects a SIP URI to a particular extension in your call plan. You could use this as-is to create a phone survey or similar system that connects a user to an IVR phone survey.
[Note: I've now published a Twisted package that allows both AMI and FastAGI operation, you likely would want to use that instead of this recipe for new development]
Comments are closed.
Pingbacks are closed.
Pavel on 03/22/2006 3:02 p.m. #
Dear mcfletch,<br />
I tried this script and failed.<br />
all the files was modified (manager.conf, extensions.conf) saved script as callback.agi, put it to the /var/lib/asterisk/agi-bin folder and called it this way:<br />
I made only modifications in the script:<br />
targetURL changed with real sip account and changed the string 'SIP/%s'%(targetURL,), with 'SIP/sipnet/%s'%(targetURL,),<br />
may be I did something wrong?<br />
Kirill on 04/05/2006 12:38 p.m. #
you can try this, it works for me:<br />
#! /usr/bin/env python<br />
from Asterisk import Manager<br />
Manager.DEBUG = 3<br />
HOST = '127.0.0.1'<br />
PORT = 5038<br />
addr = (HOST, PORT)<br />
m = Manager.Manager( addr, 'user', 'password')<br />
targetURL = 'userid'<br />
'SIP/sipnet/%s' % targetURL , <br />
extension = 's', <br />
print m.Status()<br />
fahad on 04/02/2008 12:16 p.m. #
i need to know as if call is made by asterisk manager api call is connected now i want to but that call into a queue as queue() in asterisk can u please help me in tht
pulakkil on 04/05/2012 4:31 a.m. #
i tried this calls are originating but how can i pass channel variable when originate calls from python..just give me example .
thanks in advance..