Those SIP endpoints register to Free-PBX. and Free-PBX will do outbound routes to gateway by extension.
If extension is 6XXX–> Trunk name: 6XXX -->Trunk: 6XXX in gateway --> port 1 (E1) --> PSTN1
If extension is 7XXX --> trunk name: 7XXX -->Trunk: 7XXX in gateway --> port 2 (E1) --> PSTN2
It seems digium gateway cannot identify the calls is called from which trunk, I monitored in freepbx log and saw that freePBX sent to gateway as 6XXX@freepbxIP or 7XXX@freepbxIP.
Please help.
Thanks