{"id":319,"date":"2010-04-23T21:37:18","date_gmt":"2010-04-24T05:37:18","guid":{"rendered":"http:\/\/www.adrianandgenese.com\/blogger\/?p=319"},"modified":"2013-04-10T16:27:02","modified_gmt":"2013-04-11T00:27:02","slug":"how-to-setup-asterisk-with-ooma-voip-and-a-linksys-spa-3102","status":"publish","type":"post","link":"http:\/\/www.adrianandgenese.com\/blogger\/2010\/04\/23\/how-to-setup-asterisk-with-ooma-voip-and-a-linksys-spa-3102\/","title":{"rendered":"How to setup Asterisk with Ooma voip using a Linksys SPA-3102"},"content":{"rendered":"<p style=\"text-align: left;\">Asterisk is one of the coolest pieces of open source software that I have come across. Its possibilities are endless, and its almost completely free (aside from all the cool gadgets you buy to expand its functionality). The reason for this blog post is to provide a\u00c2\u00a0better guide for setting up asterisk to communicate with an spa-3102 and interface it with ooma. In this setup, I have asterisk 1.4 running on an NSLU2 running unslung 6.10beta. Being that the nslu2 does not have much in terms of support for fxo\/fxs built in or through its USB ports, the super handy dandy and small form factor of the SPA-3102 is a perfect option to get an FXO port to interface with asterisk via ethernet and be able to make and receive calls with asterisk to the PSTN (in this case to\u00c2\u00a0dial out and receive calls from\u00c2\u00a0my ooma hub).<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/Asterisk.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-334 alignnone\" title=\"Asterisk\" alt=\"\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/Asterisk.jpg?resize=300%2C168\" width=\"300\" height=\"168\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/Asterisk.jpg?resize=300%2C168 300w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/Asterisk.jpg?w=456 456w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p style=\"text-align: left;\">The real motivation for me to use asterisk and ooma was to save moolah. With ooma, albeit with\u00c2\u00a0the up-front cost of $200, one can cancel their phone line and stop paying those pesky monthly bills. Our monthly bills were not as absorbitant as others, yet the reasoning behind me getting it was to get more for the same. I\u00c2\u00a0canceled my ATT $10 internet (768k down)\u00c2\u00a0and $10 phone with only local calling&#8230;(total monthly charge of $32-$37 with taxes and long distance charges that we didnt make), and opted for a 12mb down 512k up cable internet connection for $37.99. I would then still have a\u00c2\u00a0home phone number which I could take with me if I moved, and have super fast internet (in my standards). With asterisk in the mix, I could then share out my ooma with my family and allow them to make calls to the US for free as well (my sister lives in australia). Also, if I am overseas, I can make free calls to the US.\u00c2\u00a0I also have gizmo5 and google voice working together to provide my individual extensions in asterisk with\u00c2\u00a0DID numbers, but thats for another post.<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/41TUv85GkML._SL500_AA280_.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-343\" title=\"Ooma core\" alt=\"\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/41TUv85GkML._SL500_AA280_.jpg?resize=280%2C280\" width=\"280\" height=\"280\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/41TUv85GkML._SL500_AA280_.jpg?w=280 280w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/41TUv85GkML._SL500_AA280_.jpg?resize=150%2C150 150w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" data-recalc-dims=\"1\" \/><\/a>For those of you who do not know what <a title=\"OOMA VOIP\" href=\"http:\/\/ooma.com\" target=\"_blank\">ooma<\/a> is, its\u00c2\u00a0a VOIP hardware solution which gives you a dedicated phone line and &#8220;unlimited&#8221; calling to the US, all you need is an internet connection. I got my ooma core from radio shack\u00c2\u00a0for $199 and will never have to pay phone bills again (ooma core does not have an annual regulatory fee, while the ooma telo, and ooma\u00c2\u00a0hub only,\u00c2\u00a0does). Ooma makes its money off the upfront cost of hardware, and also by selling its ooma premier service. This service gives you cool features, but features that asterisk allows you to do and with more customization (and maybe for a little more effort). The Linksys SPA-3102 is an ethernet voice gateway with FXO port that has the added functionality of routing, and it also acts as an ATA to allow your regular analog phone to connect with a VOIP provider using the FXS port (If you don&#8217;t have an SPA-3102 yet, you can get one from <a href=\"http:\/\/www.amazon.com\/gp\/product\/B000FKP55U\/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000FKP55U&amp;linkCode=as2&amp;tag=realjuic-20\" target=\"_blank\">here<\/a>).<\/p>\n<p style=\"text-align: left;\"><strong><span style=\"text-decoration: underline;\">Ooma hub wiring setup<\/span><\/strong><\/p>\n<p style=\"text-align: left;\">The Ooma hub\u00c2\u00a0can be hooked up to your existing\u00c2\u00a0phone lines in several ways. Currently, I have my ooma phone port plugged directly into my existing home wiring jack\u00c2\u00a0with a splitter which also has my fax\/answering machine plugged into it. This configuration allows all the\u00c2\u00a0phone jacks\u00c2\u00a0in\u00c2\u00a0my home to access the ooma hub without the use of the ooma scout. This is essentially the same wiring configuration as one\u00c2\u00a0receiving\u00c2\u00a0phone service from the telco. However, you lose the instant second line feature you would otherwise be provided when using the ooma scout adapter. To\u00c2\u00a0connect the SPA-3102, just plug a phone cord from the Line port on the adapter to a jack in the wall, or if it is near the ooma hub, into a splitter which shares a line\u00c2\u00a0plugged into the Phone port on the Ooma hub (or directly into the hubs phone port without a splitter). If you are on a call using a phone plugged into\u00c2\u00a0my wiring configuration and dial out using asterisk through the Line port on the SPA, the adapter will report a 503 message to asterisk and stop the call from taking place and interrupting.<\/p>\n<p style=\"text-align: left;\">If one wants to make sure the line is not busy when receiving\/making\u00c2\u00a0a call when using the ooma as a regular analog telephone line as well, another\u00c2\u00a0configuration one can use, is to hook up the ooma scout and connect it directly to the ooma hubs\u00c2\u00a0&#8216;wall&#8217; port via phone line.\u00c2\u00a0One would then connect a phone line\u00c2\u00a0from the\u00c2\u00a0SPA-3102 Line port to the scouts\u00c2\u00a0&#8216;wall&#8217; port.\u00c2\u00a0This enables the scout to communicate with the ooma hub and\u00c2\u00a0enables the instant second line feature should the first line be active when a call out from\u00c2\u00a0the asterisk box takes place.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/linksys-31021.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-344\" title=\"linksys-3102\" alt=\"\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/linksys-31021.jpg?resize=255%2C300\" width=\"255\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/linksys-31021.jpg?resize=255%2C300 255w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/linksys-31021.jpg?w=318 318w\" sizes=\"auto, (max-width: 255px) 100vw, 255px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Linksys SPA-3102 Configuration<\/strong><\/span><\/p>\n<p><span style=\"text-decoration: underline;\">SPA-3102 Remote Management for LAN Setup<\/span><\/p>\n<p>The SPA-3102 has four interface ports in the rear, Internet, Ethernet,\u00c2\u00a0Phone, and Line. If you plug in a computer to the ethernet port via cable, it will provide your computer with an ip address with which you can then enter in the gateway address from an ipconfig and hit the spa3102 web gui. With this web gui, youll be able to configure the device. We dont want to have to plug in a cable each time to configure the device, so we will enable the web interface on the spa3102 when it is connected to the Internet port (with which it will receive a dhcp address handed out to it from your router currently on your network).<\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">-Log into the webgui for the spa-3102 when you are connected to the ethernet port<br \/>\n-Click on the admin and advanced links at the top right to get the elevated setup access<br \/>\n-Goto &#8216;WAN Setup&#8217;\u00c2\u00a0Tab<br \/>\n-Change &#8216;remote management&#8217; option to &#8216;yes&#8217;<br \/>\n-Click the &#8216;submit all changes&#8217; button at the bottom.<\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">-Connect your spa-3102 to your network via the internet port.<br \/>\n-Log into your spa-3102 and look at the status screen with\u00c2\u00a0the\u00c2\u00a0computer still plugged into the ethernet port on spa3102. You will find the dhcp address the spa-3102 received from your router which is connected to the Internet port.<br \/>\n-Disconnect your computer from the ethernet port on the spa-3102<br \/>\n-Log into your\u00c2\u00a03102 via the dhcp address that it received from the internet port.<\/p>\n<p><span style=\"text-decoration: underline;\">SPA-3102 PSTN Line\u00c2\u00a0Setup:<\/span><\/p>\n<p>Now we begin the configuration of the SPA to be used with asterisk. In this setup, I will not enable\u00c2\u00a0Line1 which makes the SPA-3102 an ATA adapter as well (allowing calls made\u00c2\u00a0to your voip provider to ring the analog phone connected to the\u00c2\u00a0PHONE port). In this setup, I just use the SPA as a gateway which allows\u00c2\u00a0me to make and receive calls (using the\u00c2\u00a0LINE port on the SPA) from any extension that is connected to my asterisk pbx. Under the LINE 1 tab in the SPA, ive set\u00c2\u00a0&#8220;Line enable&#8221; to no.<\/p>\n<p>NOTE: When things are configured properly, and the PSTN Line is registering with asterisk, the LINE LED on the SPA will light up and remain lit (same with the Phone port if Line 1 is enabled). If things arent communicating correctly, the LED will not be lit (I have the spa registering to asterisk).<\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">-Log into the SPA web gui<br \/>\n-Click on the admin and advanced links at the top right to get the elevated setup access<br \/>\n-Click the &#8216;PSTN Line&#8217; tab<\/p>\n<div id=\"attachment_322\" style=\"width: 713px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-322\" class=\"size-full wp-image-322  \" title=\"Proxy Information\" alt=\"Proxy information\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/1.jpg?resize=625%2C230\" width=\"625\" height=\"230\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/1.jpg?w=703 703w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/1.jpg?resize=300%2C110 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-322\" class=\"wp-caption-text\">Where you enter in your asterisk server IP info and whether or not it will register to asterisk.<\/p><\/div>\n<p><span style=\"text-decoration: underline;\">Proxy and Registration<\/span><\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">&#8211;<strong>Proxy<\/strong> &#8211; Change\u00c2\u00a0192.168.1.77 to the ip address asterisk is on your network. I put the ip in the outbound proxy, its not necessary\u00c2\u00a0as &#8216;Use Outbound Proxy&#8217; is set to &#8216;no.&#8217;<br \/>\n&#8211;<strong>Register<\/strong> &#8211; &#8216;yes&#8217;<br \/>\n&#8211;<strong>Make call without reg and Ans call without reg<\/strong> &#8211; Change options\u00c2\u00a0to &#8216;no&#8217;<\/p>\n<p><span style=\"text-decoration: underline;\">Subscriber Information<\/span><\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">&#8211;<strong>Display name<\/strong> &#8211; can be anything<br \/>\n&#8211;<strong>User Id &#8211; <\/strong>can be anything but for simplicity sakes when configuring asterisk, use a name without spaces<br \/>\n&#8211;<strong>Password<\/strong> -\u00c2\u00a0can be anything<\/p>\n<div id=\"attachment_324\" style=\"width: 734px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-324\" class=\"size-full wp-image-324\" title=\"Dialplan stuff\" alt=\"Dialplan stuff\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/2.jpg?resize=625%2C366\" width=\"625\" height=\"366\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/2.jpg?w=724 724w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/2.jpg?resize=300%2C175 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-324\" class=\"wp-caption-text\">This is where you enter dialplan information, and options to configure sending calls from asterisk to the pstn port.<\/p><\/div>\n<p><span style=\"text-decoration: underline;\">Dial Plans<\/span><\/p>\n<p>This section of dial plans are accessed\u00c2\u00a0by the entire page of the SPA PSTN Line tab. There are eight DP fields because\u00c2\u00a0it allows you to create different dial plan\u00c2\u00a0options\u00c2\u00a0to be used throughout this tab. Voip-to-PSTN, and PSTN-to-VOIP sections both reference these dialplan fields as &#8216;DP.&#8217; As you can see in my screenshot, Dial Plan 2: is filled out.\u00c2\u00a0In my setup, this command\u00c2\u00a0tells the SPA that any calls answered after the PSTN-to-VOIP gateway option answer delay is reached, to\u00c2\u00a0be sent to the S extension in asterisk. You may enter any extension such as (S0&lt;:102@asteriskIP&gt;).<\/p>\n<p><span style=\"text-decoration: underline;\">VOIP-to-PSTN Gateway Setup<\/span><\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">&#8211;<strong>VOIP-to-PSTN gateway enable<\/strong> &#8211; &#8216;yes&#8217;<br \/>\n&#8211;<strong>Line caller DP<\/strong> &#8211; set to &#8216;1&#8217; (this option references Dial Plan 1:\u00c2\u00a0 and the default (xx.). This\u00c2\u00a0just passes anything sent from asterisk to the SPA without any change)<br \/>\n&#8211;<strong>One Stage Dialing<\/strong> &#8211; set to &#8216;yes.&#8217; If set to no, then the SPA uses 2 stage dialing, and it screws up asterisks calling out to the Line port.<\/p>\n<div id=\"attachment_328\" style=\"width: 738px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/31.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-328\" class=\"size-full wp-image-328 \" title=\"gateway\" alt=\"voip spa-3102\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/31.jpg?resize=625%2C369\" width=\"625\" height=\"369\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/31.jpg?w=728 728w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/31.jpg?resize=300%2C177 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-328\" class=\"wp-caption-text\">The PSTN-to-VOIP configuration, where you configure how to send calls from the Line port (pstn) to asterisk<\/p><\/div>\n<p><span style=\"text-decoration: underline;\">PSTN-to-VOIP Gateway Setup<\/span><\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">&#8211;<strong>PSTN-to-VOIP Gateway enable<\/strong> -\u00c2\u00a0&#8216;yes&#8217; (in the screenshot above, i have it set to &#8216;no&#8217; as I do not want the spa to pick up the line and forward to my extension <a href=\"mailto:s@192.168.1.77\">s@192.168.1.77<\/a> as defined in Dial Plan 2:. This essentially\u00c2\u00a0turns off any calls\u00c2\u00a0going to my asterisk system. I have my asterisk system setup to forward the\u00c2\u00a0call from the pstn\u00c2\u00a0to my cell phone when this is turned on, and only used while traveling far\u00c2\u00a0away from home.\u00c2\u00a0When I am not traveling I have a fax\/answering machine on my ooma and want it to pick up instead, so it is disabled.<\/p>\n<p>If you are in an asterisk\/voip only configuration and want all calls to be routed straight to your asterisk system without worrying about any analog answering machines or fax picking up\/ringing, then set to &#8216;yes&#8217;<\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">&#8211;<strong>PSTN CID For VoIP CID<\/strong> &#8211; set to &#8216;yes&#8217; if you want callerid to be passed onto your asterisk system<br \/>\n&#8211;<strong>PSTN Caller Default DP<\/strong> &#8211; set to &#8216;2&#8217; as in my Dial Plan 2: it allows calls to be routed from Line port (pstn), to extension S on my asterisk pbx<\/p>\n<p><span style=\"text-decoration: underline;\">FXO timer values (sec)<\/span><\/p>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">&#8211;<strong>PSTN answer delay <\/strong>&#8211; this option is to change the length of time the SPA-3102 picks up the call coming in from the PSTN and forwards it to your asterisk system. The default is 16 which allows the line to ring for a little too long before sending it off to Asterisk. A number of 3-5\u00c2\u00a0should be good for callerid to be gathered and sent along with the\u00c2\u00a0call to asterisk.<br \/>\n&#8211;<strong>PSTN Dial Digit Len<\/strong> &#8211; set to .1\/.1 otherwise calls may take longer to start connecting. This essentially shortens the speed at which digits are dialed at. You dont want digits to take forever to be entered do you?<\/p>\n<p>Awesome. You are now\u00c2\u00a0finished configuring your SPA-3102 to act as a SIP trunk on the SPA-3102 side. All you need from here to configure asterisk is the username and password you specified in the Proxy and\u00c2\u00a0Registration section. Now on to the Asterisk side of things&#8230;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Asterisk Configuration<\/strong><\/span><\/p>\n<p>This setup is for asterisk 1.4. I found that many guides found on the internet do not seem to work for my setup. I was not able to set my SPA as a peer, but had to configure my\u00c2\u00a03102 to register to asterisk as an extension in order for everything to work correctly. I also found many internet\u00c2\u00a0guides had sip trunk settings which were no longer used for version 1.4. Now lets tell asterisk theres a device\u00c2\u00a0to communicate with in the Users.conf (for you it might be Sip.conf) file\u00c2\u00a0in the asterisk directory.<\/p>\n<p><span style=\"text-decoration: underline;\">Users.conf or Sip.conf<\/span><\/p>\n<div id=\"attachment_330\" style=\"width: 497px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/4.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-330\" class=\"size-full wp-image-330 \" title=\"Users.conf\" alt=\"\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/4.jpg?resize=487%2C217\" width=\"487\" height=\"217\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/4.jpg?w=487 487w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/4.jpg?resize=300%2C133 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-330\" class=\"wp-caption-text\">Users.conf or sip.conf configuration in asterisk. this command sets up the SPA to be used as an extension from which calls can be made and received.<\/p><\/div>\n<p style=\"padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;\">&#8211;<strong>[pstn] &#8211; <\/strong>Put the username you specified on the SPA-3102 in between brackets. In my example above, replace [pstn] with your username. The tricky part here is that the name between brackets is your username, even if you specify username = as something else, asterisk will not allow your 3102 to register with it.<br \/>\n&#8211;<strong>type = friend <\/strong>&#8211; Sets as an extension which can be dialed out from (<a title=\"SIP Trunk 411\" href=\"http:\/\/www.trixbox.org\/forums\/trixbox-forums\/trunks\/sip-trunk-peer-details-type-peer-vs-type-friend\" target=\"_blank\">see here<\/a> for more info)<br \/>\n&#8211;<strong>port<\/strong> &#8211; I saw several guides saying to put in port = 5061, this is unecessary as this configuration automatically connects to this port. You may need this if it was set to type=peer, but I was never able to get it to work as one.<br \/>\n&#8211;<strong>disallow<\/strong> &#8211; This configuration also disallows any voice codec other than ulaw, alaw, and gsm as the NSLU2 does not have enough horsepower to transcode the higher compression the other codecs use.<br \/>\n&#8211;<strong>context = pstn-in<\/strong> &#8211; this is the label for where incoming calls are sent to in my extensions.conf file.<br \/>\n&#8211;<strong>host = dynamic<\/strong> &#8211; as the spa is registering to asterisk, the ip address of the 3102 does not need to be specified here and will be obtained during the spa-3102 device registration. I could change the ip address of the spa-3102 on the unit and it would still register with asterisk.<br \/>\n&#8211;<strong>secret = passwd <\/strong>&#8211; replace &#8216;passwd&#8217; with\u00c2\u00a0the password you\u00c2\u00a0entered in the spa-3102<\/p>\n<p>Other than that, this is all thats needed for the PSTN Line to register to asterisk and send and receive calls.<\/p>\n<p><span style=\"text-decoration: underline;\">Extensions.conf<\/span><\/p>\n<p>Extensions.conf is the the file which tells asterisk how to handle incoming\/outgoing phone\u00c2\u00a0calls.<br \/>\nLets configure outgoing calls first, as it requires very little configuration. Below is all i need to put into my default context in order to make outgoing calls out of the Line port (we previously specified &#8216;pstn&#8217; as\u00c2\u00a0a trunk\/user in\u00c2\u00a0users.conf\/sip.conf) on my SPA-3102. Below, the _XXXX. tells asterisk that any number dialed with more than 4 digits should go out through the SPA (I have 4 digit extension numbers configured). Without this configuration, asterisk would try to place a call to an\u00c2\u00a0internal extension number, only to find that the extension\u00c2\u00a0(the phone number dialed) did not exist.<\/p>\n<div id=\"attachment_364\" style=\"width: 456px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/6.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-364\" class=\"size-full wp-image-364 \" title=\"outgoing extension\" alt=\"Outgoing to pstn\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/6.jpg?resize=446%2C74\" width=\"446\" height=\"74\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/6.jpg?w=446 446w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/6.jpg?resize=300%2C49 300w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-364\" class=\"wp-caption-text\">Simple outgoing dialplan used in the default context in my extensions.conf<\/p><\/div>\n<p style=\"text-align: left;\">In my users.conf (maybe your sip.conf) file, I had the pstn user (pstn is the username specified in the spa3102) use context pstn-in as the label to goto which contains the code for how to handle the calls coming in from the Line port or PSTN.<\/p>\n<div id=\"attachment_332\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/5.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-332\" class=\"size-full wp-image-332 \" title=\"extensions.conf\" alt=\"extensions.conf\" src=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/5.jpg?resize=490%2C112\" width=\"490\" height=\"112\" srcset=\"https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/5.jpg?w=490 490w, https:\/\/i0.wp.com\/www.adrianandgenese.com\/blogger\/wp-content\/uploads\/2010\/04\/5.jpg?resize=300%2C68 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-332\" class=\"wp-caption-text\">Extensions.conf tells asterisk how to handle a call. pstn-in is the context defined in my users.conf\/sip.conf<\/p><\/div>\n<p style=\"text-align: left;\">In my spa-3102, my Dial Plan 2:\u00c2\u00a0had code (S0&lt;:s@192.168.1.77&gt;). This essentially sent the incoming call from\u00c2\u00a0the PSTN Line\u00c2\u00a0to the\u00c2\u00a0S extension in asterisk. Asterisk knows that the call\u00c2\u00a0is coming\u00c2\u00a0from the pstn user defined in the users.conf\/sip.conf file, and found that context pstn-in was specified. It then initiated the commands under the pstn-in section. The commands listed above, answers the call, plays a sound file that nobody is\u00c2\u00a0available\u00c2\u00a0to take the call, then says &#8220;call-forwarding&#8221; and proceeds to ring my cell phone number (8001112222 is\u00c2\u00a0the cell number, change it as desired. proxy01.sipphone.com is my gizmo account which forwards it out through a google voice DID number).<\/p>\n<p style=\"text-align: left;\">Alternatively, if you just want to have the incoming pstn call\u00c2\u00a0sent to\u00c2\u00a0several or all\u00c2\u00a0extensions on your asterisk system, you can substitute my &#8216;Dial&#8217; line with the one below and change my extension numbers to match yours\u00c2\u00a0(where 6000, 6100, 6200 are my\u00c2\u00a0extensions\/phones registered with asterisk):<\/p>\n<p style=\"text-align: left;\">exten = s,n,Dial(SIP\/6000&amp;SIP\/6100&amp;SIP\/6200,20)<\/p>\n<p style=\"text-align: left;\">Thats all there is to it, good luck!<\/p>\n<div id=\"wp_fb_like_button\" style=\"margin:5px 0;float:none;height:100px;\"><script src=\"http:\/\/connect.facebook.net\/en_US\/all.js#xfbml=1\"><\/script><fb:like href=\"http:\/\/www.adrianandgenese.com\/blogger\/2010\/04\/23\/how-to-setup-asterisk-with-ooma-voip-and-a-linksys-spa-3102\/\" send=\"true\" layout=\"standard\" width=\"450\" show_faces=\"true\" font=\"arial\" action=\"like\" colorscheme=\"light\"><\/fb:like><\/div>","protected":false},"excerpt":{"rendered":"<p>How to configure asterisk 1.4 to dial out with ooma using the spa-3102 from linksys. This setup is on an NSLU2 running unslung 6.10beta. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[25,20,11],"tags":[61,66,64,60,62,65,63,59],"class_list":["post-319","post","type-post","status-publish","format-standard","hentry","category-computers","category-hack","category-home-improvement","tag-asterisk","tag-ata","tag-linksys","tag-ooma","tag-pbx","tag-pstn","tag-spa-3102","tag-voip"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/preRH-59","_links":{"self":[{"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":46,"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":891,"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/posts\/319\/revisions\/891"}],"wp:attachment":[{"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/media?parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/categories?post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.adrianandgenese.com\/blogger\/wp-json\/wp\/v2\/tags?post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}