Asterisk Newbie running into problems with Asterisk 14 in Pi2

Good morning everyone,

after a long try and error weekend I have to admit I was too eager to think configuring Asterisk would be a piece of cake…

I finally managed to register four trinks (three German Telekom numbers and one sipgate numbers).

But I run into the following problem jcolp already tried to explain but I just dont get it…

I have a SIP phone I would like to register 2 local accounts to (20 and 21). I’d like to route one outside number to one local number. But I found that I was not able to register 2 local accounts on the phone…

Do I misunderstand the concept of Asterisk?
If yes please explain or hint me to a tutorial…
If no, what do I need to configure in order to get this working?

This is my pjsip.conf part regarding the two local accounts:

[20]
;line=yes
type=endpoint
transport=transport-udp
context=internalsip
disallow=all
allow=g722
allow=alaw
auth=20-auth
aors=20
mailboxes=20

[20-auth]
type=auth
auth_type=userpass
password=1234
username=20
realm=domain.local

[20]
type=aor
max_contacts=1
remove_existing=true

[20]
type=identify
endpoint=20
match=192.168.178.57

;****************************************************

[21]
;line=yes
type=endpoint
transport=transport-udp
context=internalsip
disallow=all
allow=g722
allow=alaw
auth=21-auth
aors=21
mailboxes=21

[21-auth]
type=auth
auth_type=userpass
password=5678
username=21
realm=domain.local

[21]
type=aor
max_contacts=1
remove_existing=true

[21]
type=identify
endpoint=21
match=192.168.178.57

Please advise what to do.

Best regards,

Joerg

You can’t have two identify sections doing IP based matching to different endpoints. There’s no way for it to identify the difference between the two. If you remove the identify matches do things work?

Thanks again…

No, there is only the first in line, number 20, created.

[Feb 6 12:13:34] NOTICE[26801]: res_pjsip/pjsip_distributor.c:525 log_failed_request: Request ‘REGISTER’ from ‘“Wohnzimmer - 21” sip:21@domain.local’ failed for ‘192.168.178.57:5060’ (callid: 3781039862@192_168_178_57) - No matching endpoint found

Have you checked the console output at startup to see if there’s any reasons the endpoints didn’t load? Do they show using “pjsip show endpoints”?

The endpoints do show in “pjsip show endpoints”.

 Endpoint:  20                                                   Not in use    0 of inf
     InAuth:  20-auth/20
        Aor:  20                                                 1
      Contact:  20/sip:20@192.168.178.57:5060              9e887d7167 Unknown         nan
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060
   Identify:  20/20

 Endpoint:  21 - Wohnzimmer sipgate                              Unavailable   0 of inf
     InAuth:  21-auth/21
        Aor:  21                                                 1
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060
   Identify:  21/21

There’s no output at startup pointing in this direction.

Only later will come a warning:

[Feb  6 12:38:35] NOTICE[27140]: res_pjsip/pjsip_distributor.c:525 log_failed_request: Request 'REGISTER' from '"Wohnzimmer - 21" <sip:21@domain.local>' failed for '192.168.178.57:5060' (callid: 3781039862@192_168_178_57) - No matching endpoint found
[Feb  6 12:38:35] NOTICE[27140]: res_pjsip/pjsip_distributor.c:525 log_failed_request: Request 'REGISTER' from '"Wohnzimmer - 21" <sip:21@domain.local>' failed for '192.168.178.57:5060' (callid: 3781039862@192_168_178_57) - Failed to authenticate

What is the current configuration of the 21 endpoint?

With the exception of user and password, the same as 20 endpoint.

I’d like to see a copy/paste… as your “pjsip show endpoints” also has a “- Wohnzimmer sipgate” which is not present in 20.

Sorry it was my fault!

I edited the pjsip.conf in order tp get my crap out of it…

This is the original one… Shame on me!

[21 - Wohnzimmer sipgate]
;line=yes
type=endpoint
transport=transport-udp
context=internalsip
disallow=all
allow=g722
allow=alaw
auth=21-auth
aors=21
mailboxes=21

[21-auth]
type=auth
auth_type=userpass
password=5678
username=21
realm=nieder.elvenich

[21]
type=aor
max_contacts=1
remove_existing=true

[21]
type=identify
endpoint=21
;match=192.168.178.57

Remove the identify section and make “[21 - Wohnzimmer sipgate]” into “[21]”.

It’s working!

Thanks!

Dear Joerg,

Please could you explain what works?
21 can call 20
20 can call 21
21 can be called from sipgate

I’m having problems getting inbound calls from an external SIP gateway to work.
Oubound registration and calls works.

Inbound is refusing to authenticate.

Best regards,
Pete

Hi Pete,

every single internal endpoint can call the others.

Regarding inbound calls I used this tutorial:

http://www.rotherland.de/en/voip.html

Regards,

Joerg