Difference between revisions of "Sipgate.co.uk"

From LinuxMCE
Jump to: navigation, search
Line 333: Line 333:
  
 
# get current ip of the router
 
# get current ip of the router
 +
 
CURRENT_IP=`/usr/bin/lynx -dump http://www.netins.net/dialup/tools/my_ip.shtml | grep -A2 "Your current IP Address is:" | tail -n2 | tr -d ' '`
 
CURRENT_IP=`/usr/bin/lynx -dump http://www.netins.net/dialup/tools/my_ip.shtml | grep -A2 "Your current IP Address is:" | tail -n2 | tr -d ' '`
  
 
# update the sip_nat.conf and re-read configs
 
# update the sip_nat.conf and re-read configs
 +
 
echo "externip=$CURRENT_IP" > /tmp/sip_nat.conf
 
echo "externip=$CURRENT_IP" > /tmp/sip_nat.conf
 +
 
echo "localnet=192.168.80.0/255.255.255.0" >> /tmp/sip_nat.conf
 
echo "localnet=192.168.80.0/255.255.255.0" >> /tmp/sip_nat.conf
 +
 
echo "externrefresh=5" >> /tmp/sip_nat.conf
 
echo "externrefresh=5" >> /tmp/sip_nat.conf
 +
 
echo "localnet=192.168.80.0/255.255.255.0"  >> /tmp/sip_nat.conf
 
echo "localnet=192.168.80.0/255.255.255.0"  >> /tmp/sip_nat.conf
 +
 
cat /tmp/sip_nat.conf > /etc/asterisk/sip_nat.conf
 
cat /tmp/sip_nat.conf > /etc/asterisk/sip_nat.conf
 +
 
chown asterisk.asterisk /etc/asterisk/sip_nat.conf
 
chown asterisk.asterisk /etc/asterisk/sip_nat.conf
 +
 
asterisk -rx reload
 
asterisk -rx reload
  

Revision as of 21:39, 13 August 2010

SIPGATE.CO.UK

CAVEAT

1)this guide is what worked for me, It is intentionally "dumbed down" because.
a) I have no indepth knowledge and,
b)it's intended for the totally virgin Windows' refugee with negligible cli experience and limited typing skills
2)If it insults your intelligence, and you get nothing from it GOOD...it means you've been lucky enough to have gained a fair amount of knowledge....USE it & when you've found the answer to your problem, PLEASE come back & share it with us lesser mortals
3)All credit for any accuracy goes to Zaerc and Colinjones
4)I've cut and pasted most of the material,and hopefully credited the sources, :if not, my apologies for plaugiarising your work.
5) ALL errors are mine, please do not repeat them without giving me credit  : )
  • ASSUMPTIONS uk user, ISP= British TelecoN, router/modem= BT.HomeHub, dynamic IP address (section on static should work but I can't test) ......you may have to modify for any other combination

'PREPARE'

READ, READ , READ....check out the links at the end for good starting points
  • get fixed in your mind that "external ip"in all(?) mon-LMCE docs means the internet isp provided ip.NOT the ip of your Hybrid's "external" nic, ie the one that connects to the router
  • get a pen &paper....make a clear note of settings as you go along ...DON'T trust to memory....
  • bookmark usefull sites...open atleast four tabs in firefox for: google, pluto web admin,forums, homeHub adminpage, and put their bookmarks on the toolbar,don't close tabs/firefox on shutdown/reloads ....restore last session when you restart firefox.
  • beware of hidden html code when cutting/pasting

GET INFO

voip provider

  • google "free voip" to find a provider, preferably free, pay as you go, free phone No. .. in your preffered region, according to your anticipated usage .. #check out the forums at VOXILLA for uptodate good/bad guys ...
I chose SIPGATE>CO>UK 'cos it ticked all the boxes and there is some barebones wiki material/and a ready made trunk allready.
Register ,print off your details,.. your loginP/wd/user name for the website are NEVER used in any of this setup ...you'll need the 7 digit numeric sipID (usernam trunk id ), 7 digit sip password, the only place the actual localDID is used is for caller ID  ?????CHECK????
  • IF YOU CAN..-.beg, borrow, or steal, a windows laptop and install Xlite from spgate/settigs/help centre--it comes pre configured, - test the connection out. ::TEST IN and OUT using landline/mobile ....bear in mind the Sipgate online status page is only valid at login time.so you may have to log out and back in to check your installation's registration.

Dynamic DNS

Choose a Dynamic domain name sever provider , loads on google, get a free one,

  • READ help/howtos
(I chose DynDNS ,free , well known and it makes life a bit easier later) READ the instructions -
  • register -- wait for login e-mail (2 mins)
  • choose any (host)name for your hybrid,choose an extension eg. homeip.net-- take the wild card option,
  • --set IP type either static/dynamic..set ttl according to IP type.....
  • find the providers test apps and follow instructions,
TEST name resolution ,
CHECK for any blocked ports, make a note of current dynamic IP address.




BT HomeHub

  • Does your internet connection have a static or a dynamic ip address ?
If it's dynamic (most domestic BT BROADBAND) and you don't begrudge them the extra £5 pcm you pay for the privelige,get them to change it to static.wait for notificatin/check in HOMEHUB that it's in effect. It will make installation simpler, and allegedly is more reliable than alternatives.
........at the same time get them to disable their own voip service, and do it yourself as well ,-if you are using their supplied HomeHub........


login => advanced => telephony=> uncheck the "enable telephony " box (no idea if the textphone option has an impact.)

YOU MUST disable BT BROADBAND TALK

while youre in Hub admin, go into IP Adresses and note the range of DHCP pool (mine is LAN_private 192.168.1.64 - 192.168.1.237 & Gateway (your HOMEHUB ) 192.168.1.254

NAT

  • admin/advanced/application sharing / create new game/Manual Entry of Port Maps /
name(I used "sipserver")... click next
check the new name is correct
click ENTER
fill in the boxes, as follows
protocl UDP from5060 to 5080 translate to 5060 Trigger protocol ANY Trigger Port leave blank ADD
protocl UDP from10000 to 20000 translate to 10001 Trigger protocol ANY Trigger Port leave blank ADD

CHECK SETTINGS its a PITAto do it later

Click APPLY

MISC

GOTO FIREWALL .. set at standard
GOTO DEVICES .. establish which entry is the HYBRID ,it SHOULD be the one at the IP youset for it earlier (if it shows a mac address, check in Pluto admin/network/network settings for a match)

CLICK EDIT

CHANGE name to the hostname you picked at DynDNS earlier,just the name not the (for e.g. .is-a-geek.net)
GAME or SERVICE dropdown ...... pick the application ( "sipserver") you created earlier..

CLICK ADD

NOTE if you need to edit the "application" in anyway, you must first unassign it from your Hybrid, make the alterations, then remember to reassign it to the hybrid


LMCE

go into Web (pluto) admin on your core/Hybrid,login (your password is whatever you entered as first user during initial AV wizard)
  • -wizard/ basic/keyboard setup.. and select relevant country (if you haven't

allready) ../ update button ==Network settings==:

  • -wizard/advanced/network/network settings .... change radio button to use a static IP address
    • fill in cores/Hybrids ip address as 192.165.2.X where X is outside the private lan dhcp pool for e.g 250
subnetmask 255.255.255.0
gateway/dns1/dns2 all same as your HomeHubs address (probably) 192.168.1.254
press green UPDATE button

Firewall

  • - advanced/network/firewall rules... and use the boxes untill the rules look exactly like this,
BE PATIENT & ACCURATE ....sometimes the progress bar seems to
freeze...leave it alone untill it's done it's thing


udp....4569 to 0.......0...............core_input..............Delete
udp....5060 to 0.......0...............core_input..............Delete
udp....2000 to 0.......0...............core_input..............Delete
tcp....2000 to 0.......0...............core_input..............Delete
tcp....3877 to 3877....3877...192.168.80.1...port_forward......Delete
udp....10001 to 20000 0...............core_input..............Delete

(port 4569 is iax protocol 5060 is sip 10001to 20000 carries the audio NB some docs say use 10000 rather than 10001 don't FreePBX uses that for it's web panel

  • -wizard/restart/reload router (not strictly necessary in this case but it is in others ,-get into the habit,- it doesn't cost you anything, besides, its time for tea/smoke /sex whatever takes your fancy.


Phone Lines

GOTO ... pluto admin/wizard /devices/phone lines
  • 1)Check When dialing a local number, automatically prepend the area code and specify the areacode you would like to have prepended when dialing a local number, for instance mine is 0114 (sheffield)
  • 2. Uncheck Also prepend a digit (1 for US/Canada, 0 for Europe) (also optional).
  • 3. Local Number Length 7 (the default).
Hit the Update button.
Choose provider sipgate (try for free, pay as you go)
  • 1. Username <SipID from provider....>
  • 2. Password SipPasswordfrom provider>
  • 3. Phone number <SipID from provider... AGAIN......NOT the DID ie local number.>
  • 4. Host <sipgate.co.uk>
  • 5. Hit the Submit button.
  • 6. Hit the Deactivate Automatic Configuration button and the following Yes button.
  • 7. Click the click here link (next to "Manual configuration activated. To configure AMP, click")
  • 8. Click Trunks, and Trunk SIP/sipgate
  • 9. Under "Outgoing Dial Rules" change Dial Rules to
112
999
0114+XXXXXXX
9|.


1. This will recognize 112,999, the emergency numbers
2. Seven digit local numbers will get 0114 prepended.
3 A nine will dial out no matter how many digits.
4You now can (optionally) modify other settings to your liking as well, however do NOT change the Trunk Name (leave it at the default sipgate). When done hit Submit Changes.
5Click Reload Required Apply Configuration Changes
and Continue with reload.

GOTO Go back to pluto admin/Wizard > Devices > Phone Lines and hit the Activate Automatic Configuration button, followed by the Yes and keep my advanced settings button.

FreePBX

GOTO ... pluto admin/wizard /advanced/config./phone setup , which puts you into FreePBX webadmin
  • CLICK "TRUNKS" on left hand side
  • CLICK "sipgate" on right hand side
  • CHECK settings are as below

PEER DETAILS allow=alaw&alaw&ulaw&g729&gsm&slinear auth=md5 authuser=SIP ID callerid=SIP ID canreinvite=no context=from-trunk dtmfmode=inband fromdomain=sipgate.co.uk fromuser=SIP ID host=sipgate.co.uk insecure=very nat=yes qualify=no secret=SIP Pwd type=peer user=SIP ID username=SIP ID


USER CONTEXT SIP ID

USER DETAILS

allow=alaw&alaw&ulaw&g729&gsm&slinear auth=md5 authuser=SIP ID callerid=SIP ID canreinvite=no context=from-trunk dtmfmode=inband fromdomain=sipgate.co.uk fromuser=SIP ID host=sipgate.co.uk insecure=very nat=yes qualify=no secret=SIP Pwd type=user user=SIP ID username=SIP ID

REGISTER STRING SIP ID:SIP password@sipgate.co.uk/SIP ID

click submit button
then..
clickorange config bar at top of page


make sure pluto admin/advanced/configuration/phones setup..... FreePBX...../outbound route / 0sipgate settings are as below

...trunk sequence 0 (drop down =) SIP/sipgate

click submit button
then..
clickorange config bar at top of page

Asterisk

[(RIP-OFF FROM) freepbx.org/support/documentation/howtos/howto-resolving-audio-problems]

DYNAMIC ADDRESS

        1. NEED TO CHECK/change file PERMISSIONS  ????HOW


  • Once you get a DynDNS or other address that identifies your system on the Internet, put it in your etc/hosts file. For example, if you are assigned foo.dyndns.net, then open etc/hosts in your favorite text editor

(I use joe...it's very simple....konsole/...........sudoapt-get install joe)

  • joe /etc/hosts
(use UP, DOWN, LEFT RIGHT arrows to navigate, Ctrl k x to save Ctrl h for help)


127.0.0.1 localhost

DO NOT REMOVE OR CHANGE THAT LINE. On a NEW line directly underneath it, place this line: 127.0.0.1 foo.dyndns.net

But substitute YOUR address, of course......

save & exit


Add some information to your /etc/asterisk/sip_nat.conf file

        1. NEED TO CHECK PERMISSIONS  ????HOW
sudo joe /etc/asterisk/sip_nat.conf..................(your password is linuxmce)

nat=yes externhost=YOUR FULL DynDNS address e.g dummy.is-a-geek.net externrefresh=10 localnet=192.168.80.0/255.255.255.0

save and exit


STATIC ADDRESS

Make use that your system knows its own name.


        1. NEED TO CHECK/change file PERMISSIONS  ????HOW

Once you get a DynDNS or other address that identifies your system on the Internet, put it in your etc/hosts file. For example, if you are assigned foo.dyndns.net, then open etc/hosts in your favorite text editor I use joe...it's very simple....konsole/...........sudoapt-get install joe

                                joe /etc/hosts

(use UP, DOWN, LEFT RIGHT arrows to navigate, Ctrl k x to save Ctrl h for help)


127.0.0.1 localhost

DO NOT REMOVE OR CHANGE THAT LINE. On a NEW line directly underneath it, place this line:

127.0.0.1 foo.dyndns.net

But substitute YOUR address, of course......save & exit

Add some information to your /etc/asterisk/sip_nat.conf file

        1. NEED TO CHECK PERMISSIONS  ????HOW
sudo joe /etc/asterisk/sip_nat.conf..................(your password is linuxmce)

nat=yes externip=your.external.dotted.IPaddess

fromdomain=YOUR DynDNS name in full localnet=192.168.80.0/255.255.255.0

save and exit


ALL

Check your /etc/asterisk/rtp.conf file

sudo joe /etc/asterisk/rtp.conf


It should contain these two lines:

rtpstart=10001

rtpend=20000

"If the port values are any different, change them. N.B. These MUST match what you opened in your firewall, and DO NOT start with port 10000, because it conflicts with usage in FreePBX Webmin Some people feel the need to open fewer than 10,000 ports. I don't recommend this because six months from now when you start having audio problems you may not remember that you opened fewer than the recommended number of ports, and may spend hours troubleshooting the issue. But if you are simply obsessive about open ports, remember that each open SIP connection may require as many as FOUR concurrent ports, so don't cut it down to some ridiculously small number. For the non-paranoid, I suggest sticking with the recommendations above (and remember, if a hacker is looking at ports on your system, he's going to scan ALL of them, so having fewer UDP ports open really doesn't make you any more secure)."


save & exit


Keeping Asterisk current

You can use this sh script. run it from the crontab, maybe every 4 hours and on boot..

  1. !/bin/sh
  1. get current ip of the router

CURRENT_IP=`/usr/bin/lynx -dump http://www.netins.net/dialup/tools/my_ip.shtml | grep -A2 "Your current IP Address is:" | tail -n2 | tr -d ' '`

  1. update the sip_nat.conf and re-read configs

echo "externip=$CURRENT_IP" > /tmp/sip_nat.conf

echo "localnet=192.168.80.0/255.255.255.0" >> /tmp/sip_nat.conf

echo "externrefresh=5" >> /tmp/sip_nat.conf

echo "localnet=192.168.80.0/255.255.255.0" >> /tmp/sip_nat.conf

cat /tmp/sip_nat.conf > /etc/asterisk/sip_nat.conf

chown asterisk.asterisk /etc/asterisk/sip_nat.conf

asterisk -rx reload



PERL SCRIPT from/www.freepbx.org/support/documentation/howtos/howto-resolving-audio-problems

when i tried this it threw errors.....needs a linux man for this section}}}


YOU'RE ALMOST DONE !

exit Konsole

GOTO ... pluto admin/wizard /advanced/config./phone setup

if the orange bar is showing in FreePBX click it

GOTO pluto admin/wizard/restart/ click reboot


GET TEA...(smoke/ have sex etc)

pickup cell/landline dial the local number sipgate gave you.....the rest , if it works should be obvious

TROUBLESHOOTING

if it does'nt work {A run perl checkip.pl}

1 check your ISP hasn't changed your IP address 2 check everything, form square one for typos 3 goto Dyndns and run their name resolver 4 consider posting in user forum-- AFTER you've had a break, freshened up, and RECHECKED EVERYTHING CAREFULLY



ONCE YOU'RE RUNNING

TEST TEST TEST

  • read up on dial plans and tweak to your own desires
  • read up on extensions/mds/voicemail/IVRs and configure to your own desires

PLEASE

  • .....keep it simple and test each step as you go -it makes troubleshooting so much easier
  • --- take notes, post/wiki any new knowledge



LINKS

BT HomeHub.........................http://www.frequencycast.co.uk/homehub.html WIKI...............................http://wiki.linuxmce.org/index.php/Category:Phone_Lines

http://wiki.linuxmce.org/index.php/LinuxMCE_telecom_features


FreePBX.............................http://www.freepbx.org/support/documentation other voip providers/setups.........http://www.freepbx.org/support/documentation/howtos/howto-setting-up-voip-provider-trunks


THE O'reiley book..................http://www.digium.com/elqNow/elqRedir.htm?ref=http://downloads.oreilly.com/books/9780596510480.pdf






A Insert non-formatted text here