Multiple SIP numbers on one device

Hi,
I’m creating application which allows to dial and answer calls from multiple SIP lines simultanously. My goal is to have for ex. 2 headsets and two different calls from them.

Let’s say I have four SIP numbers:
500
501
502
503
My IP addres 192.170.1.10

I registered 2 SIP numbers from my app (500 and 501) and 502 and 503 are registered from SIP hardphones.
I’ve set up connection (invite):
From field: “500” 500@192.170.1.10
To: “502” 500@192.170.1.12
And another connection in the same time:
From field: “501” 500@192.170.1.10
To: “503” 500@192.170.1.12

It seemed working until I checked which extension was used. Both calls used SIP/500. I guess it is because asterisk checks IP address of incoming connection and runs extension which fits that number. Can I change this behavior?

I don’t know what else I can change from my application, it feels like normal behavior when PBX checks FROM field of invite packet when it allows to register multiple numbers.

Maybe I should ask more direct question :stuck_out_tongue:

Is it possible to use multiple SIP numbers (extensions) on one computer (ip address)?

Yes it is.

For instance, i own a Cisco 7961 with 5 lines (5 extensions) registered on it.

And the hardphone has only one IP adress.

Rgds
Constantin

Thanks, so I guess I have problem with extension.conf or sip.conf.

My SIP configuration:

[general]
canreinvite=no
context=internal
busylevel=1
limitonpeers=yes
callcounter=yes
notifycid=yes
notifyhold=yes
notifyringing=yes
insecure=port,invite
nat=yes

[100]
type=peer
host=dynamic
secret=abcd
context=internal
call-limit=100
nat=yes

[120]
type=peer
host=dynamic
secret=abcd
context=internal
call-limit=100
nat=yes

And extensions.conf:

[internal]
exten => 100,hint,SIP/100
exten => 100, 1, Dial(SIP/100)
exten => 100, n, Hangup()

exten => 101,hint,SIP/101
exten => 101, 1, Dial(SIP/101)
exten => 101, n, Hangup()

exten => 120,hint,SIP/120
exten => 120, 1, Dial(SIP/120)
exten => 120, n, Hangup()

My problem is that when I register for example 100 and 101 on one computer and I set up call from 101 it always use extension SIP/100… - Executing Dial(“SIP/100-00000”, “SIP-120”). When I check “CALLERID(num)” it is okay (“CALLERID(num)=101”) so I think this is configuration problem, but I don’t even know where to start looking. Anyoone can help? I have Asterisk 10.5.2 version.

Nvm, fixed, not sure how but now it works, I changed every SIP user to:

[100]
type=friend
host=dynamic
secret=abcd
context=internal
call-limit=100
fromuser=100
nat=yes
insecure=invite,port
dial=SIP/100
trustrpid=yes