Please, tell me what I did wrong.
If I setup transfer of telephone number from PSTN line to SIP Call ID then all calls from PSTN line didn’t come to the context FromCity in the section LinSYS-01 on the Asterisk, but came to the default context instead.
If I disable transfer of telephone number then everything works perfectly!
Settings for a connect to asterisk from the SPA3201
PSTN Line setting on th SPA3201
For a start, disable allowguest (that should get the call rejected).
This should produce some logging that will give some clues.
Next use sip show peers, to see if it has actually registered.
Also, best practice is to use type=peer.
Thank you for a answer!
I enabled allowguest=no in the section [general]
after that in the console asterisk I saw:
[Mar 26 16:13:10] NOTICE[C-00000000]: chan_sip.c:25528 handle_request_invite: Failed to authenticate device <sip:firstname.lastname@example.org>;tag=15db404574363439o1
If I disable ANI for a number in the PSTN line in the configuration dashboard SPA3201 and call the asterisk, everything works good: my telephone call comes to the context FromCity and I can hear my voice menu:
Executing [010101@FromCity:3] Answer("SIP/LinkSYS-01-00000003", "") in new stack
== Begin MixMonitor Recording SIP/LinkSYS-01-00000003
> 0x7f64fc094be0 -- Probation passed - setting RTP source address to 172.22.36.70:16470
-- Executing [010101@FromCity:4] BackGround("SIP/LinkSYS-01-00000003", "QBWelcome") in new stack
Thank you for your help!
They are sourcing calls from a different IP address from the one with which you registered. Define a peer for each possible source address, or if too many, re-enable allowguest, make the default context be appropriate, and lock down the firewall to only allow guest calls from trusted address blocks.
By disabling ANI, you are allowing Asterisk to work in user mode. With ANI it can only be used in peer mode.
Note there isn’t enough information to be absolutely sure of this diagnosis.