PSIP trunk failing

Hi,

Please see below configurations done for pjsip trunking, and the error seen on console. Please help

pjsip.conf on asterisk1

[asterisk2]
type=aor
;contact=sip:192.168.0.196:5060
max_contacts=10

[asterisk2]
type=endpoint
context=from-internal
allow=all
;allow=ulaw
outbound_auth=asterisk2
aors=asterisk2

[asterisk2]
type=identify
endpoint=asterisk2
match=192.168.0.196

pjsip.conf on asterisk2

[asterisk1]
type=aor
max_contacts=10
;contact=sip:192.168.0.180:5060

[asterisk1]
type=endpoint
context=from-internal
allow=all
;allow=ulaw
outbound_auth=asterisk1
aors=asterisk1

[asterisk1]
type=identify
endpoint=asterisk1
match=192.168.0.180

extensions.conf on asterisk2

[from-internal]

exten = 100,1,NoOp("Call received from m: " ${CALLERID(num)})
same = n,Dial(PJSIP/${EXTEN}@asterisk1)
same = n,Wait(1)
same = Hangup()

Console logs

-- Executing [100@from-internal:1] NoOp("PJSIP/9000000001-00000001", ""Call received from m: " 9000000001") in new stack
-- Executing [100@from-internal:2] Dial("PJSIP/9000000001-00000001", "PJSIP/100@asterisk1") in new stack

[Jun 6 18:19:12] ERROR[11921]: res_pjsip.c:2811 ast_sip_create_dialog_uac: Could not create dialog to endpoint ‘asterisk1’ as URI ‘asterisk1’ is not valid
[Jun 6 18:19:12] ERROR[11921]: chan_pjsip.c:1947 request: Failed to create outgoing session to endpoint ‘asterisk1’
[Jun 6 18:19:12] WARNING[11933][C-00000001]: app_dial.c:2432 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [100@from-internal:3] Wait(“PJSIP/9000000001-00000001”, “1”) in new stack
– Auto fallthrough, channel ‘PJSIP/9000000001-00000001’ status is ‘CHANUNAVAIL’

You have commented out the contact on the ‘asterisk1’ AOR. Is there a device registered to it instead? If not then PJSIP does not have any idea how to contact that endpoint.

When i try to register I get the following error. Hence, removed the registration part.

On asterisk 1

registration_response: Fatal response ‘404’ received from ‘sip:192.168.0.196’ on registration attempt to ‘sip:192.168.0.180’, stopping outbound registration

On asterisk 2

registration_response: Fatal response ‘401’ received from ‘sip:192.168.0.196’ on registration attempt to ‘sip:192.168.0.180’, stopping outbound registration

pjsip.conf on asterisk2

[asterisk2]
type=registration
outbound_auth=asterisk2
server_uri=sip:192.168.0.196
client_uri=sip:192.168.0.180
retry_interval=60

[asterisk2]
type=auth
auth_type=userpass
password=asterisk
username=asterisk

[asterisk2]
type=aor
contact=sip:192.168.0.196:5060
;max_contacts=10

[asterisk2]
type=endpoint
context=from-internal
allow=all
;allow=ulaw
outbound_auth=asterisk2
aors=asterisk2

[asterisk2]
type=identify
endpoint=asterisk2
match=192.168.0.196

pjsip.conf on asterisk 1

[asterisk1]
type=registration
outbound_auth=asterisk1
server_uri=sip:192.168.0.196
client_uri=sip:192.168.0.180
retry_interval=60

[asterisk1]
type=auth
auth_type=userpass
password=asterisk
username=asterisk

[asterisk1]
type=aor
;max_contacts=10
contact=sip:192.168.0.180:5060

[asterisk1]
type=endpoint
context=from-internal
allow=all
;allow=ulaw
outbound_auth=asterisk1
aors=asterisk1

[asterisk1]
type=identify
endpoint=asterisk1
match=192.168.0.180

Your registrations are incorrect. The client_uri should contain the name of the endpoint. For example:

client_uri=sip:asterisk1@192.168.0.180