I have the following situation:
Asterisk with a zaphfc BRI card and 5 SIP phones (1001-1005).
When a call comes in on the BRI, 1001 and 1002 are going to ring -->
s,3,Dial(sip/1001&sip/1002)
When one of them picks up, an AGI script takes a few variables such as callerid and uniqueid, and netcats them to an MS Access application.
This is the output of an AGI debug when 1001 or 1002 pick up:
AGI Tx >> agi_request: schrijfextensie.sh
AGI Tx >> agi_channel: SIP/1002-836e
AGI Tx >> agi_language: nl
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: asterisk-31500-1136389501.1136
AGI Tx >> agi_callerid: 0647174820
AGI Tx >> agi_dnid: unknown
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: macro-schrijfextensie
AGI Tx >> agi_extension: s
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
Where 0647174820 is my cellphone calling to the BRI line.
But, here’s the problem. When 1001 and 1002 ring, and 1003 picks up the call with *8#, the AGI debug output looks like this:
AGI Tx >> agi_request: schrijfextensie.sh
AGI Tx >> agi_channel: SIP/1003-7d67
AGI Tx >> agi_language: nl
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: asterisk-31500-1136389401.1132
AGI Tx >> agi_callerid: 1003
AGI Tx >> agi_dnid: *8
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: macro-schrijfextensie
AGI Tx >> agi_extension: s
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
Obviously, my Access app, which kind of relies on agi_callerid, doesn’t know what to do with this call. Is there any way to get the agi_callerid set to the original callerid? I have tried working with a global variable, but that doesn’t work when there are more than one calls at the same time.
Thanks for your info!