Terminating traffic on a gateway

Hey guys,

Ive got a system running * 1.4. without the gui.

All my incoming calls are going to terminate on a gateway, now the thing is that the provider is giving me 5 trunks, but each trunk has its own user and password, although it is the same ip address, how can i do so that the asterisk knows which channel is available and it dials properly?

thanks for the help.

so, they have their own username and pass. Then maybe define then is sip.conf like such:

[trunk1]
username=trunk1
secret=trunk1
host=ip

[trunk2]
username=trunk2
secret=trunk2
host=ip

for all of them. then in extensions.conf

exten => _X.,1,Dial(SIP/trunk1/${EXTEN})

exten => _X.,2,Dial(SIP/trunk2/${EXTEN})

exten => _X.,3,Dial(SIP/trunk3/${EXTEN})

exten => _X.,4,Dial(SIP/trunk4/${EXTEN})

exten => _X.,5,Dial(SIP/trunk5/${EXTEN})

or somethin like that.

Thanks for the help, i will try and let you know the results.