[Asterisk-Users] WANTED: Toll-Free gateways in Europe/Asia/Africa/South America

John Todd jtodd at loligo.com
Thu Jan 15 19:19:02 MST 2004


The freenum.org project wants to use your trunks!  The freenum.org project is an ENUM parallel tree,  which has as an eventual goal the distribution of ENUM numbering in nations or areas which due to political or other issues are not able to get secure, inexpensive, or functional ENUM capabilities.

As a preliminary round, we're putting toll-free gateways into the system for various nations.  We are looking for SIP gateways in multiple nations that would allow their "unused" trunks to be used by the general VoIP community.  If you have SIP trunks that are unused, and you'd like to participate and allow others to send toll-free calls out for your national country code, please let me know at jtodd at loligo.com and I'll insert appropriate NAPTR records.  See below for "How do I get my gateways added?" instructions if you're willing to participate.

To donate trunks, you'll need at least a PRI (T1 or E1) into your local nation's switching system that has at least 20% free capacity at PEAK hours.  In other words, if you're at 100% during your peaks, you probably don't want to volunteer.  Also notable is that you are responsible for your own security to prevent dialing holes.  Asterisk people have no problem with this, as limiting dialed numbers is pretty simple (I include a server-side example below, as well - look towards the bottom.)  

We already have North America and Austria covered at this point, and Holland is currently "pending".  More providers are welcome; we can round-robin the replies to spread load, though Asterisk users won't be able to have cascading failover due to that feature not existing in Asterisk at this point (I'm uncertain about SER.)

We're looking for:
  Western/Eastern Europe
    Germany
    France
    Poland
    Italy
    Russia
    Spain
    Portugal
    and any others!
  Asia
    Korea
    Japan
    China
    India
    Pakistan
    Indonesia
    Phillipines
    Israel
    and any others!
  South America
    Brazil
    Chile
    Argentina
    and any others!
  
There are no guarantees as to trunk availability at this time; consider this "beta" service for now.


WHY WOULD I USE THIS SERVICE?

Because dialing toll-free numbers from outside of the nation in which the numbers are provided is often impossible.  If you have a toll-free number that you found on a document of some type that was printed in country X, but you're in country Y, it's possibly the case that you can't dial the toll-free number directly.

Secondly, because it's an interesting proof-of-concept for ENUM across international borders. 


HOW DO I USE FREENUM.ORG AND CALL THROUGH THOSE TOLL FREE GATEWAYS?

To use the freenum.org project from within Asterisk right now, follow the recipe below.  As additional nations are added, they will transparently become available to you as they appear in the freenum.org zone.

sip.conf should contain something like the following:

  [general] 
  search => freenum.org
  search => e164.arpa

Your dialplan in extensions.conf should look something like the example below.  Sorry for the North American bias; we use "011" as a prefix for any international numbers, and almost all toll-free numbers appear to be long distance, and thus require a leading "1" in front of the area code, which happily is also our "country" code for NANP.)   This example is for people who are using SIP or IAX only as your protocols (no H.323):

 [from-my-desktop-phones]
 ;
 ; Let's see if the number is an ENUM-enabled number...
 ; 
 exten => _011X.,1,EnumLookup(${EXTEN:3})
 ;
 ; EnumLookup will result in success, which goes to n+1, or
 ;  if a tel: answer is provided, it jumps to n+51, and if 
 ;  the lookup fails entirely it will jump to n+101.  The two
 ;  failure cases (n+51 and n+101) should just jump to the
 ;  pointer for normal case dialing out an analog or other
 ;  path.
 ;
 exten => _011X.,52,Goto(normal-dial,${EXTEN},1)
 exten => _011X.,102,Goto(normal-dial,${EXTEN},1)
 ;
 ; So, we have a successful lookup!  Let's continue and see if we
 ;  can use it to actually create a VoIP dial method.  EnumLookup
 ;  sets the ${ENUM} variable to the dial string that we should
 ;  use for the dial attempt.
 ;
 ; Are the first three digits of the returned value of ${ENUM} are
 ;  either SIP or IAX?  If not,  we ignore and pass to normal
 ;  dialing path at priority 4.
 ;
 exten => _011X.,2,GotoIf($[$[${ENUM:0:3} = SIP}] | $[${ENUM:0:3} = IAX]]?3:4)
 ;
 ; Dial the number; end of routine.
 ;
 exten => _011X.,3,Dial(${ENUM})
 ;
 ; Oops!  We got an error of some type back from the Dial. 
 ;  This could be for many reasons, but let's assume that
 ;  we should continue sending the call out through other
 ;  methods.  We handle both the busy and "other" error 
 ;  cases, which jump to n+101 and n+1 cases.
 ;
 exten => _011X.,4,Goto(normal-dial,${EXTEN},1)
 exten => _011X.,104,Goto(normal-dial,${EXTEN},1)
 ;
 ;
 ; Now that we've handled international numbers, let's repeat the
 ;  process but for North American numbers, which are dialed differently
 ;  from international numbers.  We look for 1-800, 1-866, 1-877, and 1-888
 ; This is the same methodology for international, but without comments, and
 ;  we leave the leading "1" on the number when we do the lookup.
 ; 
 exten => _18[88,77,66,00]X.,1,EnumLookup(${EXTEN})
 exten => _18[88,77,66,00]X.,52,Goto(normal-dial,${EXTEN},1)
 exten => _18[88,77,66,00]X.,102,Goto(normal-dial,${EXTEN},1)
 exten => _18[88,77,66,00]X.,2,GotoIf($[$[${ENUM:0:3} = SIP}] | $[${ENUM:0:3} = IAX]]?3:4)
 exten => _18[88,77,66,00]X.,3,Dial(${ENUM})
 exten => _18[88,77,66,00]X..,4,Goto(normal-dial,${EXTEN},1)
 exten => _18[88,77,66,00]X.,104,Goto(normal-dial,${EXTEN},1)
 ;
 ;
 [normal-dial]
 ; this context would be where you typically handle outbound
 ;  calls - something like this should already exist in your
 ;  extensions.conf file, and it's where you hand off calls
 ;  currently.  




HOW DO I SET UP MY ASTERISK SERVER TO ACCEPT TOLL FREE CALLS FROM OTHERS FOR MY NATION?

To allow others to use your PRI or T1/E1 connections into your local phone system, you'll need to add the following settings:

Here's what sip.conf would look like to accept any inbound SIP calls and send them to a context that was built specially to handle anonymous calls:

 [general]
 port=5060
 bindaddr=0.0.0.0
 context=from-sip-external


Here's what extensions.conf would look like for a Belgium example, where only numbers that start with 0800 would be accepted (toll-free):

 [from-sip-external]
 ;
 ; First, set a maximum time limit on this call so we don't get
 ;  zombie SIP channels locking up our ports. 30 minutes should work.
 ;
 exten => _0800X.,1,AbsoluteTimeout(1800)
 ;
 ; Match against any number coming in that has 0800 as the first
 ;  four digits, and has at least two other valid digits after that
 ;  prefix, and send them to my Group1 (g1) batch of Zap channels
 ;  which are connected to this particular server via E1.
 ;
 exten => _0800X.,2,Dial(Zap/g1/${EXTEN})
 ;
 ; Hmm... the dial failed.  Send a congestion tone and hangup.
 ;
 exten => _0800X.,3,Congestion
 exten => _0800X.,4,Hangup
 ;
 ; The dial failed with a "busy" note.  Send a congestion tone
 ;  and hangup.
 ;
 exten => _0800X.,104,Congestion
 exten => _0800X.,104,Hangup
 ;
 ; include the standard "invalid" and "hangup" clauses
 ;
 exten => h,1,Hangup
 exten => i,1,Hangup 
 ; 

Now, in this same example, the owner of the gateway would need to send the following string to jtodd at loligo.com so that it could be added in the freenum.org "root" tree.   The following example means that some remote user would dial "3280012345" which would then be translated into "080012345" as it's sent to the remote gateway residing at gateway.mycompany.com (which could actually have SRV records associated with it, as well - that is up to the owner of the DNS for mycompany.com.)

$ORIGIN 0.0.8.2.3.freenum.org.
*  3600 IN NAPTR 100 10 "u" "E2U+sip" "!^\\+32800(.*)$!sip:0800\\1 at gateway.mycompany.com!" .
   3600 IN NAPTR 100 10 "u" "E2U+voice:sip" "!^\\+32800(.*)$!sip:0800\\1 at gateway.mycompany.com!" .



WHAT ARE THE DISCLAIMERS ON THIS?

THIS SERVICE IS PROVIDED BY THE PROVIDER ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE PROVIDER BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SERVICE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.






More information about the asterisk-users mailing list