Asterisk pjsip and GSM gateway Dinstar

Hello, I have an Asterisk server that is connected to a Dinstar gateway, the gateway has 8 ports that are directed to different sip servers (Asterisk).
The problem is that only one sim card out of two is registered on the Asterisk (pjsip) server, and the other gives authorization errors. If you comment on any of them, they work separately for incoming/outgoing calls.

The gateway has the address: 192.168.5.157
Asterisk server: 192.168.3.34

Server error:


[Nov 13 16:00:31] NOTICE[88346]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:0797979797@192.168.3.34>' failed for '10.2.5.11:5060' (callid: 485cb96c8a1379d78df9c64038bb674b@192.168.5.157) - Failed to authenticate

My pjsip.conf config:

;number 0979797979
[0979797979]
type=identify
endpoint=0979797979
match=10.2.5.11,192.168.5.157

[0979797979]
type=endpoint
transport=udp-transport
context=in-gsm8
allow=!all,alaw,ulaw
aors=0979797979
auth=0979797979
rewrite_contact=yes

[0979797979]
type=aor
max_contacts=1
contact=sip:0979797979@192.168.5.157:5060

[0979797979]
type=auth
auth_type=userpass
username=0979797979
password=AAAA

;number 0797979797
[0797979797]
type=identify
endpoint=0797979797
match=10.2.5.11,192.168.5.157

[0797979797]
type=endpoint
transport=udp-transport
context=in-gsm8
allow=!all,alaw,ulaw
aors=0797979797
auth=0797979797
rewrite_contact=yes

[0797979797]
type=aor
max_contacts=1
contact=sip:0797979797@192.168.5.157:5060

[0797979797]
type=auth
auth_type=userpass
username=0797979797
password=BBBB

VOIP*CLI> pjsip show aors

  Aor:  <Aor..............................................>  <MaxContact>
Contact:  <Aor/ContactUri............................> <Hash....> <Status> <RTT(ms)..>

==========================================================================================

  Aor:  0797979797                                           3
Contact:  0797979797/sip:0797979797@192.168.5.157      71664d8533 NonQual         nan

  Aor:  0979797979                                           1
Contact:  0979797979/sip:0979797979@10.2.5.11:5060;x-a acf9b9a57a NonQual         nan
Contact:  0979797979/sip:0979797979@192.168.5.157:5060 90e81f4066 NonQual         nan

You can’t have two type=identify’s with the same match settings. Only one will work. You will either need to use some other means to distinguish the two ports, or you will need have two AORs on the one endpoint. I think that is possible, but you will need to use PJSIP_DIAL_CONTACTS to get usable dial strings which are AOR specific.

If the ATA can be made to use different port numbers, it is possible that you can include those in the match line, but I have no experience of doing this

1 Like