I’m using a Linksys3000 for receiving calls from the PSTN.
The FXS line is registered as extension 1000 port 5060
The FXO line is registered as extension 1001 port 5061
PSTN calls arriving at the FXO are forwarded to Asterisk extension 99, as described in
forum.voxilla.com/linksys-sipura … 10193.html
- PSTN Line tab:
PSTN-To-VoIP Gateway Setup
PSTN-To-VoIP Gateway Enable: NO
PSTN Ring Thru Line 1: YES
PSTN CID For VoIP CID: YES
(here’s one of the tricks to make it work)
PSTN CID Number Prefix: A
(I used ‘A’ but I suppose you could pick any ALPHA character that WOULDN’T be expected as a valid caller-ID NUMBER)
FXO Timer Values (sec)
PSTN Ring Thru Delay: 3
- User 1 tab:
Selective Call Forward Settings
Cfwd Sel1 Caller: A*
Cfwd Sel1 Dest: 99
- In Asterisk (in the context that you’ve defined exten 99):
exten => 99,1,SETCIDNUM(${CALLERIDNUM:1})
exten => 99,2,Dial(SIP/${exten})
(for example)
Here’s what happens:
Call rings FXO port.
Wait three seconds so that caller-ID gets sent (you might need to increase this, but 3 secs seems to work fine for me) to the SPA3000.
PREFIX the caller-ID NUMBER with a LETTER before passing it to LINE 1
(so if original caller-ID was 5559991212, it’s now A5559991212, not a ‘valid’ caller ID number, but SPA3000 and Asterisk don’t seem to care, thankfully).
SELECTIVELY forward ONLY calls with caller-ID NUMBER that begin with A (actually this should be EVERY inbound PSTN call) to Asterisk extension 99
As soon as Asterisk gets the call, STRIP the ‘invalid’ A off and we’re left with a good, original callerID number. Send the call out to a device (can be the SPA3000 FXS (exten 2000) or port if you want!)
The call is still UNANSWERED at this point.
FXS port starts to ring, and original PSTN-provided caller-ID is sent as usual.
Answer extension 99 (or send it voicemail) and FXO finally goes off-hook.
You can make calls to extension 2000 and not worry about them being bounced back to extension 99 since no “normal” caller-ID NUMBER should ever (??) start with “A”
So far so good
My config of extension 99 is:
exten=>99,1,SetCIDNum(${CALLERID(number):1})
exten=>99,n,NoOp(${CALLERIDNUM})
exten=>99,n,dial(sip/1000)
My only problem is that extension 1000 does NOT show the PSTN caller id number, but the internal number 1001 (the FXO number from the Linksys)
The PSTN caller id number is however reveived, see:
= Parsing ‘/etc/asterisk/sip_notify.conf’: Found
– Executing SetCIDNum(“SIP/1001-081b1308”, “04763788xx”) in new stack
– Executing NoOp(“SIP/1001-081b1308”, “04763788xx”) in new stack
– Executing Dial(“SIP/1001-081b1308”, “sip/1000”) in new stack
– Called 1000
– SIP/1000-081c9390 is ringing
== Spawn extension (default, 99, 3) exited non-zero on ‘SIP/1001-081b1308’
How can I have 04763788xx displayed on my telephone