Hi,
I spend a few weeks now trying to connect to my voip provider using asterisk on raspberry pi 4 (apt package).
Outgoing calls from my internal number (201) seem to be working correctly.
Incoming calls are not visible anywhere (not in logs, not in asterisk).
Package I use has only pjsip. My voip provider only has an example of sip config for asterisk so I did my best to convert it to pjsip. I pasted my redacted extensions.conf and pjsip.conf at the end of this post.
Just after restart of asterisk service I get this error which I don’t fully understand:
[Sep 22 12:41:50] ERROR[1601538]: res_pjsip_outbound_authenticator_digest.c:447 digest_create_request_with_auth: Host: ‘XXX.XX.XXX.37:5060’: There were no auth ids available
[Sep 22 12:41:50] WARNING[1601538]: res_pjsip_outbound_registration.c:999 handle_registration_response: Failed to create authenticated REGISTER request to server ‘sip:sip.provider.com’ from client ‘sip:USERNAME@sip.provider’
[Sep 22 12:41:50] WARNING[1601538]: 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
‘pjsip set logger on’ shows nothing when trying to call my number from outside. The only answer I get is that line is busy.
Standalone voip apps like microsip work almost out of the box with only minimal configuration that connects to my operator directly (later I will need asterisk’s features though) for incoming and outgoing calls.
Thanks in advance!
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
[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(“[1]{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)
0-9 ↩︎