Configuring asterisk - part 4

April 20, 2018
In the previous post, I described how to configure devices and extensions in an asterisk network to dial out through a POTS line via the SPA 3000. This post will describe how to allow incoming calls on the analog line to be routed to the asterisk network.

To recap, this is what the SPA 3000 looks like close up:

Figure 1 - SPA 3000

During the configuration of sip.conf, we have set allowguest=np. asterisk will thus require the SPA 3000 to be registered before it can activate dial plans in asterisk. In the previous post, device 7000 has been defined, for the SPA 3000 to register, and this has been set up in the SPA 3000 under Subscriber Information, User ID and Password.

The approach is as follows:
  • We let an incoming call on the FXO port of the SPA 3000 ring for up to 8 seconds.
  • If no one answers, then the SPA 3000 will execute a specified dial plan (DP 2) in the SPA 3000. This dial plan will dial 8888 onto the VoIP network.
  • Extension 8888 on the asterisk is configured to whatever you want to do. For this tutorial, I will just route it to device 3008, a Zoiper app running on my Android phone.

So as a first step, I created extension 8888 in extensions.conf:
[from-SIPURA]
exten = 8888,1,Answer
exten = 8888,n,Dial(SIP/3008,16)
exten = 8888,n,Hangup
Remember that the PSTN Line device is registered to the asterisk as device 7000 with a context of from-SIPURA. Hence, this extension 8888 will be activated if the PSTN Line device dials 8888, which is something we will set up next.

There are two ways to forward incoming calls onto asterisk. The first uses the PSTN-To-VoIP Gateway Setup. The settings on the PSTN Line page are:
  • PSTN-To-VoIP Gateway Setup, Enable: yes
  • PSTN-To-VoIP Gateway Setup, PSTN CID For VoIP CID: : no
  • PSTN-To-VoIP Gateway Setup, PSTN Caller Default DP: 2. This is the dial plan that will be triggered when there is an incoming call from the PSTN side.
  • FXO Timer Values, PSTN Answer Delay: 16 - the delay before DP 2 will be activated.
  • Dial Plans, Dial Plan 2: <:8888> This syntax (or here) means to ignore whatever was dialed (which is nothing in our case) and simply transmit 8888, which will trigger extension 8888 defined above to ring device 3008.

That is all! I can now dial from another phone to the number of the line connected to the SPA 3000, and extension 3008 will ring!

Hope you have equal success.

You might want to modify the extension 8888 dial plan to let the caller punch in the extension he wants to reach.

Comments

Popular posts from this blog

Things that go missing