My asterisk is on 192.168.7.2, and I have a SIPURA LinkSys SPA300 on the same LAN at 192.168.7.9.
asterisk configuration includes the following:
sip.conf:
[7000]
host=dynamic
secret=*****
context=from-ATA
type=friend
[SIPURA]
type=friend
port=5080
host=192.168.7.9
extensions.conf:
[from-ATA]
exten = 8888,1,Answer(1200)
exten = 8888,n,Verbose(3,Caller Id is [${CALLERID(all)}])
exten = 8888,n,Dial(SIP/8001&SIP/8002,20)
...
[SIPURA] is for my asterisk to register as the channel for outgoing PSTN calls.
The LinkSys ATA PSTN is registered using extension 7000:
I forward incoming calls on the PSTN line to extension 8888 (Dial plan 8 contains <:8888>):
This has been doing fine for a few years. Recently I bought caller id service on the PSTN line. So I changed PSTN CID for VoIP CID to yes. That’s when I am seeing a weird phenomenon.
Whenever PSTN CID for VoIP CID is set to yes, the call to asterisk is in the public context
[Dec 12 10:17:53] NOTICE[522][C-0000009c]: chan_sip.c:26458 handle_request_invite:
Call from 'SIPURA' (192.168.7.9:5080) to extension '8888' rejected
because extension not found in context 'public'.
I took the risk and changed the context for dialplan 8888 to [public] momentarily just to test. The incoming call was handled correctly with this setting, and I could see the PSTN number in the CALLERID function.
When I set the PSTN CID for VoIP CID back to no, things work again (ie context is [from-ATA]), but of course without caller id information.
I am puzzled why this is happening. What have I done wrong?