I created several service providers in Asterisk, all of them use the
same context name such as "DID_Incoming". So any incoming call from
these service providers will go into the same context. Under this
context, the AGI command below is invoked:
[DID_Incoming]
exten=_X.,1,AGI(agi://
127.0.0.1)
which forwards the calling control to Adhearsion. In the
extensions.rb, the corresponding context is created:
DID_Incoming {
######
}
In this context, I would like to do different things according to
different trunk names. But the problem is that there is no trunk name
sent to Adhearsion:
AGI Tx >> agi_network: yes
AGI Tx >> agi_request: agi://
127.0.0.1
AGI Tx >> agi_channel: SIP/059524670148-0933b318
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1210503260.13
AGI Tx >> agi_callerid: 24670150
AGI Tx >> agi_calleridname: New User
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 059524670148
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: DID_Incoming
AGI Tx >> agi_extension: 059524670148
AGI Tx >> agi_priority: 1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
Can anybody tell me, how can I get the trunkname of the incoming call
in Adhearsion?