I’ll add this too because it was confusing to me because Astersk never addresses “telecom” per say. It assumes you know these things.
When you get in to the multiple phone line world, the phone line is not dedicated to a particular number. In other words a T1 line that has 23 phone line bundled in it is not restricted to 23 phone lines. 281-501-1000 does not ring line 1, 281-501-1001 does not ring line 2, etc…
When you step up to this class of connection with the phone company they can send the phone number that was dialed down any of the lines. 281-501-1000 can be dialed, and sent down any of the 23 phone lines in a T1.
In Asterisk you don’t really care cause you just match on the digits dialed.
exten => 2815011000,1,Answer()
exten => 2815011000,2,Dial(SIP/1000)
It doesn’t matter that it came in on line 1,2,3,4, or 23 of the T1. Now outbound it makes a bit of a difference, in that you cannot dial out on line 1 if it is in use. So what you do there is you treat it as a group and dial out on any available line.
In other words while you could dial DAHDI/01, DAHDI/02, DAHDI/03 to address the individual lines you would not typically do that. You would treat them as a group and dial DAHDI/g1 and let Asterisk figure which line was free.
So same thing in reverse that the phone company does not treat T1 line 1 as 281-501-1000, T1 line 2 as 281-501-1001, you tell the phone company what digits were dialed and what even line was available. They don’t care if it came in on line 1 or 23, it just has to be an open line.