Finally back. For how long this time? Lol.
Yup. I don’t have much to say, I guess that’s normal to change priorities around. Let’s try to close this series of posts.
Updates
I am not using my pbx setup anymore, this because of - mainly - Europe new roaming regulations. It depends from country to country, but my actual plan is quite ok. For 60 Euros per month I have a phone, unlimited calls within EU and USA, unlimited internet traffic within Luxembourg, 25 GB of internet traffic in EU. The use case for having the pbx between the two counties does not exist anymore. I am looking at you, euroskeptic guy that despises EU, this is - just - one of the advantages of being part of the european union.
Let’s setup Central PBX
Asterisk is extemely versatile, at this point I think we got the idea. What we want to do is to connect two asterisk box located in different physical places, so we can send calls around as we prefer.
To do this I used iax, what you’d need to do is to read this [section][iaxconf] of the Asterisk configuration manual and change the iax.conf according to your needs. In
What you want to do is set it up so the two pbx can connect as ‘friends’. You can check part [one][1] of this series of posts to get an example of iax.conf.
Now we also need to setup the call forwarding between the multiple PBXs. Here’s an example of a desidered extension plan on the Central PBX:
/etc/asterisk/extensions.conf - Central PBX
[incoming_countrya]
; Routing calls from COUNTRY A raspberry -> COUNTRY B raspberry
exten => dialcountrybgsm,1,Answer()
same => n,Verbose(Routing call received from Country A to Country B)
same => n,Dial(IAX2/countryb/dialmyself,60)
same => n,Hangup()
[incoming_countryb]
exten => dialtocountrybselection,1,Answer()
same => n,Festival(Press 0 for available extensions)
same => n,WaitExten(15)
same => n,Goto(1,1)
same => n,Hangup()
exten => 0,1,Festival(Extension list)
same => n,Festival(Press one to call mom, two to call dad)
same => n,WaitExten(10)
same => n,Hangup()
exten => 1,1,Festival(Calling mom)
same => n,Dial(IAX2/countrya/dialmomgsm,60)
exten => 2,1,Festival(Calling dad)
same => n,Dial(IAX2/countrya/dialdadgsm,60)
/etc/asterisk/extensions.conf - Country B PBX
TODO: Add dial plan for call forwarding on CALLER ID MATCHING.
[from_trunk]
exten => YOURCOUNTRYAPHONENUMBER,1,Verbose(Incoming call from ${CALLERID(num)})
same => n,Dial(IAX2/central/dialcountrybgsm,60)
same => n,Hangup()
[incoming_central]
exten => dialmyself,1,Dial(Dongle/dongle0/MYPHONENUMBERCOUNTRYB)
We already have a diaplan in country A, each and every call coming from the dongle trunk will be forwarded to dialcountryb. dialcountryb will consequently trigger dialmyself on the remote country b asterisk.
This will be the final leg of the call, with the country B raspberry calling you to your mobile phone in country B.
On the other hand, if you call the number of the SIM card that you installed on country B pbx, the dial plan will check the callerid number and if matching, it will forward the call to dialtocountrybselection on central pbx.
Then you can decide to directly select an extension - if you remember which one -, or to wait and hear for the list of available extensions.
That’s basically it. As I already said from the start, this is probably not the best efficient configuration, but in the end it worked for me, without any issue - except the minor downsides mentioned on part two of the post. You can - for example - use only two pbx, one on each raspberry. You don’t - necessarily - need a third one.
The end
Asterisk is an extremely versatile and useful software, let’s send our thanks to Mr. Mark Spencer for having created another free and open very useful and beautyful piece of software.