Ignored inbound calls, pjsip

Hi,

I have a problem with receiving inbound calls using asterisk on raspberry pi 4 ( apt package ).
Outbound calls work correctly.

When I am making inbound calls I only get short beeps in phone speaker and no warnings or errors in asterisk.
If it got to extensions - then it would be visible in logs, right?
As much as I understand - when asterisk receives this inbound call, it does nothing with it.

Standalone voip communicators like microsip work for both inbound and outbound calls when connecting to provider directly.

I get this log on inbound call with ‘pjsip set logger on’.
It is pretty long, I didn’t notice enough patterns to truncate it. Hopefully its not too annoying.

pjsip.conf:

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[provider]
type=auth
auth_type=userpass
password=PASSWORD
username=USERNAME

[provider]
type=registration
endpoint=provider
server_uri=sip:sip.provider
client_uri=sip:USERNAME@sip.provider
line=yes
contact_user=USERNAME

[provider]
type=aor
contact=sip:sip.provider

[provider]
type=endpoint
context=exit
disallow=all
allow=alaw,ulaw
aors=provider
auth=provider
from_user=USERNAME
direct_media=no
rtp_symmetric=yes
force_rport=yes
ice_support=yes
rewrite_contact=yes
send_rpid=yes
allow_unauthenticated_options=yes
outbound_auth=provider
;insecure=invite
;identify_by=username

[provider_identify]
type=identify
endpoint=provider
match=XXX.XX.XX.0:5060/24

[201]
type=endpoint
context=city
allow=alaw
allow=ulaw
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
auth=201-auth
aors=201-aor

[201-auth]
type=auth
auth_type=userpass
password=PASSWORD
username=201

[201-aor]
type=aor
max_contacts=1

extensions.conf

[default]
exten => _.,1,GoTo(incoming,${SIP_HEADER(To):5:11},1})
[exit]
include => city
include => internal
[city]
exten => 112,1,Dial(pjsip/${EXTEN}@provider)
exten => _9XX,1,Dial(pjsip/${EXTEN}@provider)
exten => _XXX.,1,NoOp()
exten => _XXX.,n,Gotoif($[!${REGEX(“
{3}$”${CALLERID(num)})}]?clip-redirection)
exten => _XXX.,n,Goto(clip-${CALLERID(num)})
exten => _XXX.,n(clip-201),Set(CALLERID(num)=REDACTED_PHONE_NUMBER)
exten => _XXX.,n,Goto(end-clip)
exten => _XXX.,n(clip-redirection),Set(CALLERID(num)=REDACTED_PHONE_NUMBER)
exten => _XXX.,n(end-clip),NoOp()
exten => _XXX.,n,Dial(pjsip/${EXTEN}@provider,60,tT)
[internal]
exten => _[2-8]XX,1,Dial(pjsip/account-${EXTEN},30,tTk)
exten => _[2-8]XX,n,Hangup()
[incoming]
exten => REDACTED_PHONE_NUMBER,1,GoTo(internal,201,1)

I think it might be that provider auth needs to be type=outbound_auth and not type=auth.

Did you mean this change? It seems to break registration and calls.

diff --git a/pjsip.conf b/pjsip.conf
index 1e27484…4301406 100755
— a/pjsip.conf
+++ b/pjsip.conf
@@ -4,7 +4,7 @@ protocol=udp
bind=0.0.0.0

[provider]
-type=auth
+type=outbound_auth
auth_type=userpass
password=PASSWORD
username=USERNAME

And errors:

[Sep 22 23:00:05] WARNING[1717284]: res_pjsip/pjsip_configuration.c:2287 ast_sip_retrieve_auths_vector: Auth object ‘provider’ could not be found
[Sep 22 23:00:05] WARNING[1717284]: res_pjsip_outbound_registration.c:999 handle_registration_response: Failed to create authenticated REGISTER request to server ‘sip:sip.provider’ from client ‘sip:USERNAME@sip.provider’
[Sep 22 23:00:05] WARNING[1717284]: res_pjsip_outbound_registration.c:1076 handle_registration_response: Fatal response ‘401’ received from ‘sip:sip.provider’ on registration attempt to ‘sip:USERNAME@sip.provider’, stopping outbound registration

As I replied on your original thread, you should not have auth=provider in your endpoint definition, as that will make asterisk ask the provider to authenticate themselves, which is not something I’ve heard of a provider doing.

I don’t think you should have started a new thread.

1 Like

I decided to start new thread because this issue seemed different than the one you helped solve.

Now I did this:

diff --git a/pjsip.conf b/pjsip.conf
index 1e27484…f0d39f8 100755
— a/pjsip.conf
+++ b/pjsip.conf
@@ -28,7 +28,6 @@ context=exit
disallow=all
allow=alaw,ulaw
aors=provider
-auth=provider
from_user=USERNAME
direct_media=no
rtp_symmetric=yes

And it seems to work because now asterisk tries to use extensions when getting inbound call.
This message appears when placing inbound call.

[Sep 23 10:31:35] NOTICE[1845546]: res_pjsip_session.c:3968 new_invite: provider: Call (UDP:XXX.XX.XXX.37:5060) to extension ‘USERNAME’ rejected because extension not found in context ‘exit’.

I will try to figure out what is wrong now and reply here if I am successful.
That seems the furthest I got so far, thanks! I asked previously like 3 IRL people about this, everybody gave up eventually :smiley:

“USERNAME” is taken from contact|_user, but doesn’t exist in exit or its included contexts.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.