[from-cont15]
exten => _+X.,1,Set(CALLERID(all)=+91XXXXXXXX15)
same => n,NoOp(IFI_UUID: ${IFI_UUID})
same => n,NoOp(EXTEN: ${EXTEN})
same => n,NoOp(UNIQUEID: ${UNIQUEID})
same => n,NoOp(CHANNEL: ${CHANNEL})
same => n,NoOp(IFI_AGENT: ${IFI_AGENT})
same => n,Set(CDR(userfield)=${IFI_AGENT})
same => n,Set(SPYGROUP=${IFI_AGENT})
same => n,AGI(update_session.py, ${IFI_UUID}, ${EXTEN}, ${UNIQUEID}, ${CHANNEL})
same => n,Goto(from-internal,${EXTEN},1)
How, I want to send the DIALSTATUS to update_session.py with either UNIQUEID or other custom variable. Actually, I need to update the call info like answer, hangup info through update_session.py.
As you can see, I’m sending some data to update_session.py, I also need to pass the Hangup, Failed or Answer to the same script. Actually the script sends data to another server different data regarding the calls. I need to immediately when the call is answered or failed or hanged up.
At a high-level, this looks okay to me (maybe, when/where you are activating), but you might find better expertise in the Asterisk forum as this is moving away from FreePBX.