How to SIP Trunk Match- IP and username?

Hi

I am new in Asterisk world and now trying to solve one problem.
I have two different phone numbers and two different sip trunk, but these sip trunks are from one provider and IP address is one.
in sip.conf I got something like this:

[general]

register => user1234:65f4d4fdg43f@sip.example.com
register => user5678:6d8gf7d68dsf1df68g@sip.example.com

[Test_trunk1]
type = peer
host = sip.example.com
username = user1234
secret = 65f4d4fdg43f
qualify = yes
callgroup = 1
insecure = invite,port
dtmfmode = rfc2833
disallow = all
allow = ulaw
allow = alaw
allow = gsm

[Test_trunk2]
type = peer
host = sip.example.com
username = user5678
secret = 6d8gf7d68dsf1df68g
qualify = yes
callgroup = 1
insecure = invite,port
dtmfmode = rfc2833
disallow = all
allow = ulaw
allow = alaw
allow = gsm

Now my problem is that when I am getting incoming connection it shows SIP/Test_trunk1… all the times because Asterisk match peer on IP.
Do anyone know how to make Asterisk to be matching peers on ip address and username or maybe other idea to sort out this problem.
I need to have solution, if someone is calling for one number which is signet to user1234:65f4d4fdg43f@sip.example.com than on incoming connection it will show SIP/Test_trunk1 and when is other number than it will show SIP/Test_trunk2.

Please for a little help.
Kind regards
Kris

You can’t normally do that.

What you can often do is to supply a callback extension number and separate the two “lines” in extensions.conf.

Thank you very much david55

Later I will test your solution and if that will help me out to separate two lines from the same IP then I don’t need anything more.

Regards
Kris