FreeNum.org calling ISN:1234*256

Catalog of dial plans
Post Reply
mnipp
Posts: 192
Joined: Sat Oct 03, 2009 9:48 am
Location: NSW Australia

FreeNum.org calling ISN:1234*256

Post by mnipp » Sat Jan 23, 2010 1:15 pm

I was looking at the freenum.org site that maps dialled numbers like this example

1234*256 to a sip:address 1234@loligo.com

So I tried a ENUM Lookup with the following form and was surprised it worked.

Code: Select all

sys.Dial(sys.ENUMLookup("1234.256.freenum.org"))
So I tried this in my speed dial list for numbers of 2 or more digits in front of a * with 2 or more following digits and bracket those two sets of digits into the ENUMLookup function and dial.

Code: Select all

when /^(\d{2,})\*(\d{2,})$/ then sys.Dial(sys.ENUMLookup("#{$1}.#{$2}.freenum.org"))
This works with 1234*256(sip:1234@loligo.com) and 3246*426 (sip:3246@sip.iptel.org) (aka echo@iptel.org: echo test, no announcement)

Numbers you can call.

Code: Select all

xxx*256           to dial xxx@loligo.com
xxx*1089          to dial xxx@proxy01.sipphone.com (gizmo5)
xxx*426           to dial xxx@iptel.org
xxx*1219          to dial xxx@sipsorcery.com
888xxxxxxx*1220   to dial 888xxxxxxx@incoming.pennytel.com (only numbers with this pattern goto pennytel.)
378 09xxxxxx*1220 to dial 09xxxxxx on MyNetFone (only 2 Lines may get busy.)

The last two is using my assigned number to redirect pennytel or MyNetFone numbers. Thanks to my dial plan, I could add other incoming peers if their number patterns are unique.
Last edited by mnipp on Tue Feb 09, 2010 8:53 am, edited 2 times in total.
billion 7404VGP
dialplan (<9*:*>[0-9*][0-9*].T<:@sipbroker>|[0-9*].T)

mnipp
Posts: 192
Joined: Sat Oct 03, 2009 9:48 am
Location: NSW Australia

Post by mnipp » Mon Feb 01, 2010 9:22 am

How to give all your Friends, Family a ISN: number. Even those on a normal fixed line. ISN:<<prefix>><<num>>*<<tdsn>>

First apply for a *<<tdsn>> number on the freenum.org website.
Login into your sipsorcery account and add a new sipaccount for example JoBoggsPBX and set it for incoming only
Goto Dial Plans and add the inplan below name it anything you like and set it as the inplan on your new sipaccount.
In the first lines of the inplan set a small prefix number you like and set myPBXacc to the name of your new sipaccount.
Also set the first line in the dialler to your local TimeZone example tz=10 is (GMT+10 hours) TimeZone.

To test the script dial this sip:address example <<prefix>><<num>>.<<myPBXacc>>@sipsorcery.com
change <<myPBXacc>> to the name of your new sipaccount eg JoBoggsPBX, and try the test number sip:1234.JoBoggsPBX@sipsorcery.com

Once you recieve your *<<tdsn>> number goto freenum.org login page and select send me password with your email address.
Login and change the Wildcard from

Code: Select all

!^\\+*([^\\*]*)!sip:\\1@sip.big.edu!
to example

Code: Select all

!^\\+*([^\\*]*)!sip:\\1.JoBoggsPBX@sipsorcery.com!
It will stay inactive while the state of the freenum.org entry is NEW. Once it changes to OK your update and *<<tdsn>> number is active.

In my case update the entry Saturday wait until late Monday afternoon for an active service.

Any further changes to the freenum.org Wildcard may take a hour or two to spread though the Domain Name system.

Happy Dialling.

Code: Select all

#  dial this pattern ISN:<<prefix>><<num>>*<<tdsn>> into private number list.

prefix   = '321'           # Set a small common prefix on all private numbers. 
myPBXacc = 'JoBoggsPBX'    # Name of added sipaccount this inplan was applied to.IMPORTANT THIS IS CORRECT
status   = 'no known number' # default status message

# Setup dialler with local presets eg.(GMT+10 hours)TimeZone, 7:30am opentime, 11:00pm closetime in 24 hour time.

def dialler(tocall, tz=10, starttime="0730", stoptime="2300")
  t = Time.now.utc + (tz*60*60)
  hhmm = t.strftime("%H%M")
  openhours = stoptime < starttime ? !((stoptime...starttime) === hhmm) : (starttime...stoptime) === hhmm
     if openhours
         sys.log("calling #{tocall}")
      status = sys.Dial(tocall)
         sys.log("failed call to #{tocall}")
     else
         hhmm = t.strftime("%I:%M %p")             # Time (HH:MM AM) format
         sys.log("to late to call #{tocall}")
         sys.Respond(480, "(#{hhmm}) call later")  # response if middle of their night.
     end
   return status
end

req.URI.User.to_s =~ /^(.*)\.#{myPBXacc}/ # get dialled number in front of sipaccount name into $1

num     = $1   # copy into num
fullnum = num  # copy into fullnum

   # pass on a CallerID from caller.
      fromname = req.Header.From.FromName.to_s
      fromuser = req.Header.from.FromURI.User.to_s
      fromhost = req.Header.from.FromURI.Host.to_s
     if fromuser =~ /^[0-9]*[0-9]$/
         if fromname == "" or fromuser == fromname
           sys.SetFromHeader(fromhost, fromuser, nil) 
         else 
           sys.SetFromHeader(fromname, fromuser, nil) 
         end 
     else 
         if fromname == "" 
           sys.SetFromHeader("#{fromuser} #{fromhost}", nil, nil) 
         else 
           sys.SetFromHeader(fromname, nil, nil) 
         end 
     end 

# Test numbers as dialled no prefix.
  case num
    when '1234'  then status = sys.Dial("1234@loligo.com")  # John Todds screaming monkeys followed by echo test
    when '12345' then status = sys.Dial("echo@iptel.org")   # echo test on iptel.org

  # Well Known numbers to be used directly no private prefix, use dialler for time friendly calling.
   when '765765' then status = dialler("#{num}@friendssip.com",0) # know this london sip number.Use 0 TimeZone
   when '890890' then status = dialler("#{num}@local")         # pass this number to sipsorcery.com aus TimeZone
   when /^888\d{7}$/ then status = sys.Dial("#{num}@incoming.pennytel.com")
   when /^378(09\d{5,})$/
                   status = sys.Dial("#{$1}@mynet1[fu=09xxxxx8]") # MyNetFone line 1 09xxxxx8
                   status = sys.Dial("#{$1}@mynet2[fu=09xxxxx9]") # MyNetFone line 2 09xxxxx9
  end

# remove prefix from front of number
prelen = prefix.length
   if num[0..(prelen-1)] == prefix then 
      num = num[prelen..50]
 
# private number list with prefix removed, use dialler for time friendly calling.
  case num
    when '01' then status = dialler("buddy1@sipsorcery.com")             # dial buddy1 in AUSTRALIA TIMEZONE on sipsorcery
    when '02' then status = dialler("buddy2@iptel.org",-5)               # buddy2 in NEW YORK TIMEZONE on iptel.org
    when '03' then status = dialler("0287654321@ptel",10,"0800","2200")  # |02 8765 4321 phone number with pennytel account
  end                                                                    # |no calling after 10:00pm (GMT+10) Time
end

code = 480
if status.to_s == 'Failed'
     status = 'Busy Number'
     code = 486
end

sys.log("#{fullnum} failed, reason #{status}")
sys.Respond(code, "#{fullnum} #{status}") # exit if invalid number
billion 7404VGP
dialplan (<9*:*>[0-9*][0-9*].T<:@sipbroker>|[0-9*].T)

av8rdude
Posts: 2
Joined: Mon Feb 15, 2010 4:08 am
Location: Milton, Georgia

Post by av8rdude » Mon Feb 15, 2010 5:30 pm

Can you explain in high level terms what this allows a newbie to do? I can follow your post and plan, but does this allow you to dial out or allow people to call you? Can you call a landline with this or can a landline call you?
Sorry for the newbie questions...but I'm learning as fast as I can :)
Scott

mnipp
Posts: 192
Joined: Sat Oct 03, 2009 9:48 am
Location: NSW Australia

Post by mnipp » Tue Feb 16, 2010 2:15 pm

Code: Select all

# Speed Dial SIP addresses with 01 or 02 etc.. dialled number
case req.URI.User 
    when '01' then sys.Dial("buddy1@sipsorcery.com") # dial buddy1 on sipsorcery 
    when '02' then sys.Dial("buddy2@iptel.org")      # buddy2 on iptel.org 
    when '03' then sys.Dial("0287654321@ptel")   # speed dial 02 8765 4321 phone number with ptel account 

 # 9*+sipbroker number dialling (eg 9*234..to *234..@sipbroker.com) 
    when /^9\*/ then sys.Dial("${dst:1}@sipbroker.com[rm=a]") 

 # freenum.org style dialling eg 1234*256 for sip:1234@loligo.com 
    when /^(\d{2,})\*(\d{2,})$/ then sys.Dial(sys.ENUMLookup("#{$1}.#{$2}.freenum.org")) 

 # end of speed dial list

else
   sys.Dial("ptel") # default dialout account for phone numbers
end
Like Sipbroker this is a method to dial sip addresses using only a phone key-pad. Where a *num is the sip host and the number that follows on sipbroker is the user account number or in the freenum case the leading number.

example:
With sipbroker *747 is a gizmo5 host number so dialling *74712220000321 to sipbroker.com is the same as 12220000321@proxy01.sipphone.com.
With freenum.org *1089 is the same so dialling 12220000321*1089 also works.

This helps people ring each other over the internet for free by staying off the fixed line numbers.

My second post shows a way to get your own *ITAD number on the freenum system so you can use sipsorcery to assign your own user numbers to contacts that can be called from any voip phone system that supports ISN: freenum dialling.

sipsorcery already has a *ITAD number *1219, so any number based username in your account can be dialled from another system with username*1219 for username@sipsorcery.com.

http://nerdvittles.com/?p=621
http://atlaug.com/stuff/Presentations/A ... 06-isn.pdf
http://www.mysipswitch.com/forum/viewto ... 1&start=10
Last edited by mnipp on Tue Mar 30, 2010 11:24 am, edited 2 times in total.
billion 7404VGP
dialplan (<9*:*>[0-9*][0-9*].T<:@sipbroker>|[0-9*].T)

DoDo
Posts: 182
Joined: Wed May 20, 2009 7:16 pm

Post by DoDo » Tue Feb 16, 2010 4:19 pm

SipBroker Access Via Inum-Voxalot

Code: Select all

when /^02$/ then sys.Dial("883510074022302@Voxalot")

mnipp
Posts: 192
Joined: Sat Oct 03, 2009 9:48 am
Location: NSW Australia

Post by mnipp » Sun Feb 21, 2010 4:57 am

It seems sipbroker is best handled by the phones dialplan for best results.

Code: Select all

 # 9*+sipbroker number dialling (eg 9*234..to *234..@sipbroker.com) 
    when /^9\*/ then sys.Dial("${dst:1}@sipbroker.com[rm=a]")
This works ok but does not like being forwarded to a sipsorcery address.

To place the same into a phone dialplan here are some examples.

old X-LITE and eyebeam

Code: Select all

 This is the X-LITE default plan
 
#1\a\a.T;match=1;prestrip=2;

 This is the X-LITE sipbroker.com plan where 9*xxx becomes *xxx@sipbroker.com
 
#1\a\a.T|9*[0-9*].T;match=1;prestrip=2;match=2;prestrip=1;post=@sipbroker.com;
billion 7404VGP

Code: Select all

In the billion first goto your VoIP Wizard page then bottom link VoIP User-defined Profiles and add

Profile Name: sipbroker
Registrar Address: sipbroker.com
Phone Number: anon
password and other settings to stay blank, apply and save

In the Billion VoIP Dial Plan I replaced the x.T with these two(2) rules for numbers with a * in them
and 9*xxx to *xxx@sipbroker

(<9*:*>x[0-9*].T<:@sipbroker>|[0-9*][0-9*].T)
SPA3000 Dialplan

Code: Select all

adding this to the dialplan should see 9*xxx goto *xxx@sipbroker.com (not tested)

<9*:*>[0-9*].<:@sipbroker.com> SPA3000 Dialplan
Bria and maybe the new X-LITE

Code: Select all

The Bria does not use a sip address formed in the dial plan sending instead this to sipsorcery. sip:*xxx%40sipbroker.com@sipsorcery.com

instead add a second account to Bria
Account name: sipbroker
UserID: anon
Domain: sipbroker.com
Password and the rest blank

and Dial #2*xxx becomes *xxx@sipbroker.com 

If correctly setup this number which uses sipbrokers freenum.org prefix should work.
dial 9*0121234*256 for *0121234*256@sipbroker.com forwarded to 1234@loligo.com
billion 7404VGP
dialplan (<9*:*>[0-9*][0-9*].T<:@sipbroker>|[0-9*].T)

Post Reply