jean-marie.goupil@telintrans.fr
2004-Jun-21 07:48 UTC
[Asterisk-Users] A Callback AGI script
Hi there, I just give you the script (in Python) I have just written in case of someone would like to implemant this. I think it is more simple than the one we can see over the net... It uses DISA (security issues ==> limit access with contexts and the password !!) and CAPI but it should work with type of channel. Basically, you ring your asterisk and the line goes down after 1 ring. Asterisk calls you back with a tonality and you have to enter a password to dial any extension. The advantage of using DISA is that you can acces any services you want (=> voicemail...) If you would like to comment it, do not hesitate ! -------------------------------- [root@asterisk1]# cat /var/lib/asterisk/agi-bin/callback.py #!/usr/bin/env python import sys context="incoming" extension="300" canal = "CAPI/02xxx89127:"+sys.argv[1] cf = open("/var/spool/asterisk/outgoing/"+sys.argv[1]+".call",'w+') cf.write("Channel:"+canal+"\nMaxRetries:2\ncontext:"+context+"\nextension:"+extension+"\npriority:1\nRetryTime:10\nWaitTime:20\n") [root@asterisk1]# cat /etc/asterisk/extensions.conf | grep -i 300 exten => 300,1,DISA,9641|incoming exten => 300,2,Hangup