Inbound call error (Anonymous <sip:anonymous@anonymous.invalid)

Hi. I’m setting up asterisk by tweaking an existing configuration created a while back and It usually works but have been facing Issues this time round.

Main problem at present Is that incoming calls (tried from a number of landlines, mobiles) are all not completing and this error keeps popping up when sip debug is enabled:

From: Anonymous sip:anonymous@anonymous.invalid;

Is there some general troubleshooting for the above I can follow ?

Appreciate any assistance.

Global Settings:

UDP Bindaddress: 0.0.0.0:5060
TCP SIP Bindaddress: Disabled
TLS SIP Bindaddress: Disabled
Videosupport: No
Textsupport: No
Ignore SDP sess. ver.: No
AutoCreate Peer: Off
Match Auth Username: No
Allow unknown access: Yes
Allow subscriptions: Yes
Allow overlap dialing: Yes
Allow promisc. redir: No
Enable call counters: No
SIP domain support: No
Path support : No
Realm. auth: No
Our auth realm asterisk
Use domains as realms: No
Call to non-local dom.: Yes
URI user is phone no: No
Always auth rejects: Yes
Direct RTP setup: No
User Agent: Asterisk PBX 13.3.2
SDP Session Name: Asterisk PBX 13.3.2
SDP Owner Name: root
Reg. context: (not set)
Regexten on Qualify: No
Trust RPID: No
Send RPID: No
Legacy userfield parse: No
Send Diversion: Yes
Caller ID: asterisk
From: Domain:
Record SIP history: Off
Auth. Failure Events: Off
T.38 support: No
T.38 EC mode: Unknown
T.38 MaxDtgrm: 4294967295

There is no error in the quoted text.

Without more context it cannot even be used as a symptom.

I don’t see anything In the asterisk CLI when Inbound calls are placed. Only the “anonymous…” when sip debugging Is on.

SIP.CONF

[general]
jitter Buffer
jbenable=yes
jbforce=yes
jbmaxsize=500
jbimpl=fixed
;jbimpl=adaptive
;jbresynchthreshold=100
externrefresh=3600
rtptimeout=1200
registerattempts=0
rtpholdtimeout=2000
session-timers=originate
session-expires=600
session-minse=90
session-refresher=uas

tcpenable=yes
tcpbindaddr=0.0.0.0

register => 61871231842:passw0rd@sip.test.net/61871001842

[mtnsat-outbound]
type=friend
directmedia=no
directrtpsetup=no
dtmfmode=auto
;qualify=yes ; nnikolaou 28.12.16
dtmfmode=RFC2833
host=sip.test.net
context=shipsat
;context=DirectCall
username=61871231842
transport=tcp
trustrpid=yes
sendrpid=yes
secret=6eo16yg
;disallow=all
allow=g729:60
nat=yes

EXTENSIONS.CONF

exten => 61871231842 ,1,Set(DSTNUM=${EXTEN})
exten => 61871231842 ,2,Set(CALID=${CALLERID(num)})
exten => 61871231842 ,3,Dial(SIP/8551)
exten => 61871231842 ,4,Hangup()

exten => _X./8551,1,Set(gateway=${CALLERID(num)})
exten => _X./8551,n,Answer
exten => _X./8551,n,Set(GW_ID=${SHELL(/Database/shipsat/scripts/getgwid):0:-1})
exten => _X./8551,n,Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)})
exten => _X./8551,n,Set(USERKEY=1234567)
exten => _X./8551,n,Set(CDR(accountcode)=${USERKEY})
exten => _X./8551,n,Set(CALLERID(num)=61871231842)
exten => _X./8551,n,Set(CDR(userfield)=${BOXID}@${GW_ID})
exten => _X./8551,n,AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN})
exten => _X./8551,n,Hangup(18) ;Check script fails

exten => _X.,1,Set(gateway=${CALLERID(num)})
exten => _X.,n,Answer()
exten => _X.,n,Set(GW_ID=${SHELL(/Database/shipsat/scripts/getgwid):0:-1})
exten => _X.,n,Read(USERKEY,shipsat/enter-pin-number,10)
exten => _X.,n,Set(CDR(userfield)=${BOXID}@${GW_ID})
exten => _X.,n,Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)})
exten => _X.,n,Set(CDR(accountcode)=${USERKEY})
exten => _X.,n,AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN})
exten => _X.,n,Hangup(18)

exten => h,1,NoOp(Call data : ${DIALSTATUS} : ${ANSWEREDTIME} : ${CDR(billsec)} : ${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)})
exten => h,n,AGI(writeCdr.agi, ${DSTNUM}, ${CDR(start)}, ${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)}, ${CDR(duration)}, ${CDR(disposition)}, ${CDR(userfield)}, ${CDR(accountcode)}, ${CDR(billsec)})

exten => badauth,1,Playback(shipsat/auth-fail)
exten => badauth,n,Hangup(21)

exten => nomoney,1,Playback(shipsat/no-credits)
exten => nomoney,n,Hangup(21)

; Outbound Calling
exten => makecallEMC,1,NoOp( DialOut ${DST1} )
exten => makecallEMC,2,Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC}))
exten => makecallEMC,3,Hangup

Turn up the verbosity until you actually see an error.

I am receiving this when placing an inbound call:

<— Reliably Transmitting (NAT) to 216.7.159.214:5060 —>
SIP/2.0 401 Unauthorized

Ok. Adding insecure=invite seems to have solved the Issue.

Thanks everyone for taking a look.

That’s also not an error. The UAC should repeat the INVITE with appropriate authentication information. If it doesn’t do so, it generally means it hasn’t been configured with any at all.

Note that ITSP’s generally never have authentication data to give to customers, and need remotesecret, or the, older, insecure=invite, hack. secret is applied in both directions, otherwise.