| |
| News & Reviews |
Welcome to the Voxilla VoIP Forum.
Voxilla has been a trusted source for accurate, up-to-date information on the IP Communications industry since 2002. A dedicated staff of reporters and engineers produce feature articles and product reviews to keep industry watchers abreast of the people, companies, and trends driving a fast moving market.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
Voxilla VoIP Forum |
SPA3000 FXO gateway to Asterisk (without 'answering' first)Technical support, how-to guides, troubleshooting, and general assistance for Linksys hardware. |
| | LinkBack | Thread Tools | Rate Thread | Display Modes |
| |||
| I've got a way to get the SPA3000 to use the FXO port to take inbound from PSTN (grabs and passes telco caller-ID name/num as well) and pass to Asterisk for add'l handling. Sure, the SPA3000 does a great job of 'front-ending' inbound PSTN calls, and can even pass-through to the built-in FXS port, or external VoIP service, but I needed Asterisk to get the call BEFORE it was "answered" and handled/routed by the SPA-3000. Would seem to be a simple mode of operation, yet everywhere I looked it didn't seem possible to do just that. I wanted to use it as a 'simple' FXO <-> SIP gateway to Asterisk AND also use the FXS port as an Asterisk extension. Here's how: (I'm only detailing the tricky part .. the rest is really basic Asterisk and/or SPA3000 setup) 1. Setup Asterisk and SPA3000 so both the PSTN line (FXO) and Line1 (FXS) are registered with Asterisk as different extensions (i.e. FXO user ID=10 and FXS user ID=2000) on different ports (5060/5061). In this example I'll use Asterisk extension "99" as the place I want to send the inbound PSTN call to. 2. 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 3. User 1 tab: Selective Call Forward Settings Cfwd Sel1 Caller: A* Cfwd Sel1 Dest: 99 4. 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" Above all, I think this could be made a whole lot more intuitive and fool-proof if Sipura just added a feature into the firmware. |
| |||
| I have been working on this approach for the last 3 days, but couldn't get the last wrinkles out of the solution - the extremely clever bit was prefixing the callerid with the alpha. Well done. My system is now working exactly as I was hoping it would. Thanks! |
| |||
| What I did was create a dial plan that says: (S0<:10>) This S0 thing was listed in one of the release notes if I recall correctly. I also set my asterisk box as my proxy I've got the PSTN answer delay set to 12, but I want a bit of time to pick up the phone on my standard line before Asterisk picks up. You do need enough time for the caller-id to be delivered. On the asterisk end, I defined extension 10 in the sip.conf as how the Sipura registers. This is all under the advanced admin options for PSTN line. It works great. Asterisk picks up and gets caller-id. No additional processing is required. Is your solution doing something different? |
| |||
| Ah, I got you. When you say unanswered you really mean by unanswered by the phone company. In my solution the call is completed as soon as Sipura picks up. With this solution, I my asterisk box could look at the caller-id or do some processing before the phone company sees the call as being connected. Hopefully this post contributes something useful to the thread by explaining it to people as clueles as myself. |
| |||
| Hi, Yep - also with your setup, the caller is paying for the call while Asterisk is trying the extensions etc, with this way the call is only answered (and the caller paying) when someone or something (like voicemail) actually picks up the call. --ian |
| ||||
| In my own setup, everything either: 1. Goes straight to a VoiceMenu (therefore picking up is appropriate) 2. Goes straight to VoiceMail (i.e. I have a handset on my PSTN line and either pick it up or don't before Asterisk picks up) Either way, this is still clever.
__________________ Technical questions should be posted to the forums, not sent via PM to me. |
| |||
| as soon as i turn on: PSTN CID For VoIP CID: YES i get: chan_sip.c:7208 handle_request: Failed to authenticate user WIRELESS CALLER <sip:A9193<removed>@ apollo*CLI> sip show peers Name/username Host Dyn Nat ACL Mask Port Status 3100/3100 192.168.1.12 D 255.255.255.255 5060 OK (72 ms) 3000/3000 192.168.1.12 D 255.255.255.255 5060 OK (114 ms) spa3k/asterisk 192.168.1.14 255.255.255.255 5061 OK (22 ms) 2003/2003 192.168.1.14 D 255.255.255.255 5061 Unmonitored 2002/2002 192.168.1.14 D 255.255.255.255 5060 OK (17 ms) fwd/52766 69.90.155.70 255.255.255.255 5060 OK (47 ms) fwd-sip/428114 69.90.155.70 255.255.255.255 5060 OK (52 ms) 7 sip peers loaded [7 online , 0 offline] apollo*CLI> sip debug peer 2003 SIP Debugging Enabled for IP: 192.168.1.14:5061 apollo*CLI> Sip read: INVITE sip:2003@192.168.1.10:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.14:5061;branch=z9hG4bK-89b39f60 From: WIRELESS CALLER <sip:A919349REMOVED@192.168.1.10:5060>;tag=387c72a 723db44c8o1 To: <sip:2003@192.168.1.10:5060> Call-ID: 7fd00353-c9670c0c@192.168.1.14 CSeq: 101 INVITE Max-Forwards: 70 Contact: NO CALLER-ID <sip:A919REMOVED@192.168.1.14:5061> Expires: 240 Diversion: sipura <sip:2002@192.168.1.10:5060>;reason=user-busy User-Agent: Sipura/SPA3000-2.0.11(GWg) Content-Length: 233 Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER Supported: x-sipura Content-Type: application/sdp v=0 o=- 507076 507076 IN IP4 192.168.1.14 s=- c=IN IP4 192.168.1.14 t=0 0 m=audio 16434 RTP/AVP 0 100 101 a=rtpmap:0 PCMU/8000 a=rtpmap:100 NSE/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:30 a=sendrecv 15 headers, 12 lines Using latest request as basis request Sending to 192.168.1.14 : 5061 (non-NAT) Found RTP audio format 0 Found RTP audio format 100 Found RTP audio format 101 Peer audio RTP is at port 192.168.1.14:16434 Found description format PCMU Found description format NSE Found description format telephone-event Capabilities: us - 0x106(GSM|ULAW|G729A), peer - audio=0x4(ULAW)/video=0x0(EMPTY), combined - 0x4(ULAW) Non-codec capabilities: us - 0x1(G723), peer - 0x1(G723), combined - 0x1(G723) Found peer 'spa3k' Reliably Transmitting (no NAT): SIP/2.0 407 Proxy Authentication Required Via: SIP/2.0/UDP 192.168.1.14:5061;branch=z9hG4bK-89b39f60 From: WIRELESS CALLER <sip:A9193REMOVED7@192.168.1.10:5060>;tag=387c72a7 23db44c8o1 To: <sip:2003@192.168.1.10:5060>;tag=as513a35c9 Call-ID: 7fd00353-c9670c0c@192.168.1.14 CSeq: 101 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER Contact: <sip:2003@192.168.1.10> Proxy-Authenticate: Digest realm="asterisk", nonce="27b671b3" Content-Length: 0 to 192.168.1.14:5061 Scheduling destruction of call '7fd00353-c9670c0c@192.168.1.14' in 15000 ms apollo*CLI> Sip read: ACK sip:2003@192.168.1.10:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.14:5061;branch=z9hG4bK-89b39f60 From: WIRELESS CALLER <sip:A9193REMOVED@192.168.1.10:5060>;tag=387c72a72 3db44c8o1 To: <sip:2003@192.168.1.10:5060>;tag=as513a35c9 Call-ID: 7fd00353-c9670c0c@192.168.1.14 CSeq: 101 ACK Max-Forwards: 70 Contact: NO CALLER-ID <sip:A919REMOVED@192.168.1.14:5061> User-Agent: Sipura/SPA3000-2.0.11(GWg) Content-Length: 0 10 headers, 0 lines apollo*CLI> Sip read: INVITE sip:2003@192.168.1.10:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.14:5061;branch=z9hG4bK-5386f724 From: WIRELESS CALLER <sip:A91934REMOVED@192.168.1.10:5060>;tag=387c72a7 23db44c8o1 To: <sip:2003@192.168.1.10:5060> Call-ID: 7fd00353-c9670c0c@192.168.1.14 CSeq: 102 INVITE Max-Forwards: 70 Proxy-Authorization: Digest username="2003",realm="asterisk",nonce="27b671b3", uri="sip:2003@192.168.1.10:5060",algorithm=MD5,res ponse="7eafe51e22b9c7226cb3e9db017ec045" Contact: NO CALLER-ID <sip:A9193499847@192.168.1.14:5061> Expires: 240 Diversion: sipura <sip:2002@192.168.1.10:5060>;reason=user-busy User-Agent: Sipura/SPA3000-2.0.11(GWg) Content-Length: 233 Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER Supported: x-sipura Content-Type: application/sdp v=0 o=- 507076 507076 IN IP4 192.168.1.14 s=- c=IN IP4 192.168.1.14 t=0 0 m=audio 16434 RTP/AVP 0 100 101 a=rtpmap:0 PCMU/8000 a=rtpmap:100 NSE/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:30 a=sendrecv 16 headers, 12 lines Using latest request as basis request Sending to 192.168.1.14 : 5061 (non-NAT) Found RTP audio format 0 Found RTP audio format 100 Found RTP audio format 101 Peer audio RTP is at port 192.168.1.14:16434 Found description format PCMU Found description format NSE Found description format telephone-event Capabilities: us - 0x106(GSM|ULAW|G729A), peer - audio=0x4(ULAW)/video=0x0(EMPTY), combined - 0x4(ULAW) Non-codec capabilities: us - 0x1(G723), peer - 0x1(G723), combined - 0x1(G723) Found peer 'spa3k' Nov 27 02:56:56 NOTICE[8041]: chan_sip.c:7208 handle_request: Failed to authenticate user WIRELESS CALLER <sip:A9193REMOVED@192.168.1.10:5060>;tag=387c72a72 3db44c8o1 Reliably Transmitting (no NAT): SIP/2.0 403 Forbidden Via: SIP/2.0/UDP 192.168.1.14:5061;branch=z9hG4bK-5386f724 From: WIRELESS CALLER <sip:A9193REMOVED@192.168.1.10:5060>;tag=387c72a72 3db44c8o1 To: <sip:2003@192.168.1.10:5060>;tag=as513a35c9 Call-ID: 7fd00353-c9670c0c@192.168.1.14 CSeq: 102 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER Contact: <sip:2003@192.168.1.10> Content-Length: 0 to 192.168.1.14:5061 apollo*CLI> Sip read: ACK sip:2003@192.168.1.10:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.14:5061;branch=z9hG4bK-5386f724 From: WIRELESS CALLER <sip:A9193REMOVED@192.168.1.10:5060>;tag=387c72a72 3db44c8o1 To: <sip:2003@192.168.1.10:5060>;tag=as513a35c9 Call-ID: 7fd00353-c9670c0c@192.168.1.14 CSeq: 102 ACK Max-Forwards: 70 Proxy-Authorization: Digest username="2003",realm="asterisk",nonce="27b671b3", uri="sip:2003@192.168.1.10:5060",algorithm=MD5,res ponse="6c5ca22046cf5389c4f3855fbd4bd58e" Contact: NO CALLER-ID <sip:A9193499847@192.168.1.14:5061> User-Agent: Sipura/SPA3000-2.0.11(GWg) Content-Length: 0 11 headers, 0 lines Destroying call '7fd00353-c9670c0c@192.168.1.14' apollo*CLI> sip no debug SIP Debugging Disabled |
| |||
| Quote:
I changed the Selective forward from A* to * as a test and the SPA3000 is sending the username as the CID in that case. I changed the username to Asippstn on the off chance that would work and it did not. I think I need a way to match both A* and an empty CID and then tweak my asterisk config blocked CID calls to Line 1 get a different CID. On the whole this would be much easier if Sipura added an option to do this automatically. |
| |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Will Asterisk work with Mediatrix 1204 fxo gateway easily? | richie90 | Other Hardware/Software | 6 | January 29th, 2006 12:54 PM |
| SPA3000 FXO gateway to * without answering fails sometimes | djw | Linksys (Sipura) VoIP Support Forum | 0 | October 12th, 2005 03:02 PM |
| spa-3k gateway & answering machine | kendfw | Linksys (Sipura) VoIP Support Forum | 1 | September 20th, 2005 03:56 PM |
| SPA3000 FXO Gateway Multiple Calls Problem - SOLVED | m.list | Linksys (Sipura) VoIP Support Forum | 2 | May 18th, 2005 10:53 PM |
| Using the SPA3000 as an FXO for Asterisk | ichilton | Linksys (Sipura) VoIP Support Forum | 14 | October 26th, 2004 01:22 PM |