Asterisk and "AMI" to monitor incoming calls

Use PHP scripts to monitor incoming calls by AMI

The command is: “Action: CoreShowChannels”

The point is that there’s always the same UserContext

but calls arrive on different numbers registered with their inner trunk

how it can behave like that?

here is example:

Action: CoreShowChannels
Response: Success
EventList: start
Message: Channels will follow
Event: CoreShowChannel
Channel: SIP / 018…40_in-0,000,009th
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 347…66
CallerIDName: 347…66
Language: en
Context: IVR-1
Exten: s
Priority: 11
Uniqueid: 1445007838.8012
Linkedin: 1445007838.8012
Application: BackGround
Application Date: custom / Msg_GG
Duration: 0:00:11
Event: CoreShowChannelsComplete
EventList: Complete
ListItems: 1