I have agi script and I want, when that agi file called (which written in python). I can fetch all asterisk’s variable inside that agi file. Like Extension, Caller ID, Channel, etc.
I have to log all this in one excel file so in future I can refer that for some purpose.
exten => 1001,1,answer() exten => 1001,n,AGI(AGICode.agi) or 1001,n,AGI(AGICode.agi,$(agi_channel),$(agi_extension),$(agi_callerid))) exten => 1001,n,hangup()
As you see above dialplan, which one is correct way to pass Asterisk’s Variable?
For example check below Image, you can see this all variable.
Also if I have pass these variables then How to get then inside script?
import sys from asterisk.agi import * agi = AGI() channelID = sys.argv extension = sys.argv calledID = sys.argv
or if we don’t require to pass variable (direct get them inside script) then how?