Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.



397 posts

Ultimate Geek


Topic # 100651 16-Apr-2012 07:11 Send private message

I've never used asterisk before but wanted to see if I can set this up with a provider so I can use these SPA303 phones I bought.   I managed to get one phone working with 2talk by itself as per my other thread.

I've downloaded the latest pbxinaflash distro and installed that.   I changed the proxy on the spa303 to point to asterisk, setup an extension, and put in the password for that extension into the phone, and used that extension number ( 1000 ) as the phone id.   Freepbx reports that I do now have one IP phone registered.

I then altered the /etc/asterisk/sip.conf file so it looks like this one http://blog.2talk.co.nz/asterisk.html  but I am seeing these errors in the asterisk log


[2012-04-16 00:18:51] ERROR[1841] netsock2.c: getaddrinfo("2talk.co.nz", "(null)", ...): Temporary failure in name resolution
[2012-04-16 00:18:51] WARNING[1841] acl.c: Unable to lookup '2talk.co.nz'
[2012-04-16 00:18:51] WARNING[1841] acl.c: Cannot connect
[2012-04-16 00:18:51] WARNING[1841] chan_sip.c: sip_xmit of 0xb7403318 (len 385) to (null) returned -1: Invalid argument
[2012-04-16 00:18:51] NOTICE[1841] chan_sip.c: -- Registration for '[email protected]' timed out, trying again (Attempt #31)


I also tried plus.2talk.co.nz with the same results.

Do I need to add a sip trunk in 2talk for this to work or am I doing something else wrong.  And which of the many *.conf files should I be making these additions?  freepbx says I should not be doing it in sip.conf

View this topic in a long page with up to 500 replies per page Create new topic
 1 | 2 | 3 | 4


397 posts

Ultimate Geek


  Reply # 609793 16-Apr-2012 07:16 Send private message

Oh, and as per another thread i read here, I forwarded ports 5060, and the range 10,000 - 11,000 to asterisk.

18546 posts

Uber Geek
+1 received by user: 730

Moderator
Trusted
Biddle Corp
Subscriber

  Reply # 609813 16-Apr-2012 08:35 Send private message

You shouldn't edit sip.conf in a FreePBX distro. This file isn't designed to be edited, you should only edit the _custom files.

You also shouldn't add things like trunks or extensions to the config files directly when using FreePBX unless you fully understand what you're doing. The web GUI is there for this.

As for other help I can't help you sorry, I don't use 2talk. The issue looks like a DNS resolution issue though.

Port forwarding port 5060 and 10000-20000 also carries significant security risks, you should be aware of these if you're going to do that. Unless you need remote extensions this opens up massive security holes, and should only be used in conjunction with secure passwords and fail2ban. In an ideal world remote extensions should only ever be deployed over a VPN.

BDFL
47941 posts

Uber Geek
+1 received by user: 3542

Administrator
Trusted
Geekzone
Subscriber

  Reply # 609814 16-Apr-2012 08:39 Send private message

What sbiddle is saying about "security risk" comes down to this: you will see lots of probes into your network and as soon as they find there's a remote extension there they will keep trying until they get access using brute force or a vulnerability.

From that moment, the extension belongs to them - and you will see unexplained calls in your bill.







397 posts

Ultimate Geek


  Reply # 609870 16-Apr-2012 10:46 Send private message

Ok, I don't need remote extensions so I should just take out all the port forwarding?
But how will I be able to receive calls then?

I'll check DNS when I get home.  I presumed that this would be setup correctly in Centos.

I expect I will go with VFX eventually as my other lines are with them .. and this is just for testing/experience.  Are the settings that different?

18546 posts

Uber Geek
+1 received by user: 730

Moderator
Trusted
Biddle Corp
Subscriber

  Reply # 609873 16-Apr-2012 10:59 Send private message

gchiu: Ok, I don't need remote extensions so I should just take out all the port forwarding?
But how will I be able to receive calls then?

I'll check DNS when I get home.  I presumed that this would be setup correctly in Centos.

I expect I will go with VFX eventually as my other lines are with them .. and this is just for testing/experience.  Are the settings that different?


Port forwarding isn't necessarily needed as your router NAT keeps the pinhole open and will allow inbound traffic.

For added security you should also use iptables to restrict access only to the IP range used by your VoIP provider.
   

1678 posts

Uber Geek
+1 received by user: 223

Subscriber

  Reply # 609970 16-Apr-2012 12:46 Send private message

I had this trouble too.

I tried putting in the default gateway as the dns server and then tried putting the telecom dns straight in there. After that didnt work I just gave up and put 2Talk's IP address in instead of the domain name. Work sweet as after that.
But yea, don't edit any of the conf files. FreePBX does it all for you.



397 posts

Ultimate Geek


  Reply # 609985 16-Apr-2012 12:59 Send private message

Interesting .. I was going to try the IP address, or manually configure the hosts file.

Got a link to how I use freepbx to configure 2talk for me?

1678 posts

Uber Geek
+1 received by user: 223

Subscriber

  Reply # 610149 16-Apr-2012 18:07 Send private message

Just go to the trunks menu, pick add sip trunk. chuck in an outbound caller id if you want, but this only really works when calling from sip to sip so I didnt bother. Then you can put in dial rules, again, I dont use that bit as you can set dialing rules in 'outbound routes' so the way i figure is it just gets complicated if you use dialing rules here too.
and then just outgoing and incoming settings. this is where I had issues.
here is what I have in outgoing:
host=27.111.14.66
username=**username**
secret=**password**
type=peer
register=no
context=from-trunk

and incoming:
username=**username**
secret=**password**
context=from-trunk
host=27.111.14.66
insecure=very

When I first set this up I could ring out but not in. After lots of googling I found you have to put the 'insecure=very' part in. Also, I am using 2talk+, hence the host ip. If you just use normal sip trunking it will be 202.180.76.164 (trunk.2talk.co.nz). and apparently the 'register=no' bit is important too, cant remember why.
sbiddle will hopefully tell you if what I have in my settings is correct but it seems to work fine for me so im happy. I just set this box up to have a play and see what you can actually do on asterisk, which is quite a lot lol.

18546 posts

Uber Geek
+1 received by user: 730

Moderator
Trusted
Biddle Corp
Subscriber

  Reply # 610230 16-Apr-2012 21:16 Send private message

Settings for each VoIP provider can vary, so I have no view on what you should be using for 2talk, other than I'd be following what they say.

IP addresses are preferred over FQDN's in Asterisk due to a legacy DNS issue that's affected Asterisk from day one, and continues to be a problem still. Unless you're running DNSmasq or your Asterisk box or using a DNS server on your router IP's are always the best approach to avoid this.



397 posts

Ultimate Geek


  Reply # 610277 16-Apr-2012 22:28 Send private message

I haven't had a play with this yet as I just got home but I have fixed the DNS issue.

Using system-config-network I configured dns for eth0, and now I have one sip trunk registered. Can't actually make an outgoing call yet so time to do more fiddling.

295 posts

Ultimate Geek
+1 received by user: 9


  Reply # 610296 17-Apr-2012 02:11 Send private message

host=27.111.14.66
username=**username**
secret=**password**
type=peer
register=no
context=from-trunk

and incoming:
username=**username**
secret=**password**
context=from-trunk
host=27.111.14.66
insecure=very

If you put
type= friend then you do not need any incoming settings

I would use
Out going settings (only)
host=27.111.14.66
username=**phone number**
secret=**password**
type=friend
context=from-trunk
canreinvite=no
qualify=yes
disallow=all
allow=ulaw,alaw,gsm

and in the registry settings

phone number:[email protected]/phone number

Do not forward any ports it should not be needed, if you have a firewall in your router you may need
to open udp 5060 and udp 10000 to 20000 ports.

Hope that helps















Now on Slingshot Better Network and it's better.

Share Image



397 posts

Ultimate Geek


  Reply # 610402 17-Apr-2012 10:49 Send private message

Sadly not working. I get a message that call can not complete as dialled.

Dunno if this is relevant but when I created the route, it insisted I needed a dial pattern so I just made up a few like this

02ZNNNNNNN
0[3469]NXXXXXX
NXXXXXX


1678 posts

Uber Geek
+1 received by user: 223

Subscriber

  Reply # 610469 17-Apr-2012 12:29 Send private message

Are you running FreePBX 2.9.x.x?

You can't really stuff dial patterns in it. I just have a basic one to dial 1 to access the trunk just like most other phone systems.

Just create the outbound route, chuck in a '1|.' if you have an older version of freePBX and it should be good as gold. Once that is working then start playing around with more complicated dial patterns for selecting different trunks.

295 posts

Ultimate Geek
+1 received by user: 9


  Reply # 610585 17-Apr-2012 15:17 Send private message

you need to put the right dial plan into the spa303 or if you can't be bothered and just want to rely on Freepbx
you can use *x.|xx.

Then to get it all working you can just put x. or even just. (wildcard) in the outgoing settings and select your 2talk trunk.

and as chevrolux says you can muck around with the more complex dial plans later.




Now on Slingshot Better Network and it's better.

Share Image

295 posts

Ultimate Geek
+1 received by user: 9


  Reply # 610590 17-Apr-2012 15:21 Send private message

If you put a hash at the end of a dialled number it will tell asterisk that you have finished dialling and to dial the number straight away, without proper dial plans it saves time.




Now on Slingshot Better Network and it's better.

Share Image

 1 | 2 | 3 | 4
View this topic in a long page with up to 500 replies per page Create new topic








Twitter »
Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when new jobs are posted to our jobs board:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:




News »

Trending now »
Hot discussions in our forums right now:

MH370 - Call for Search & Rescue Help
Created by DS248, last reply by Sideface on 17-Apr-2014 17:28 (735 replies)
Pages... 47 48 49


Forms of government for New Zealand
Created by charsleysa, last reply by Sidestep on 21-Apr-2014 12:56 (123 replies)
Pages... 7 8 9


Whats the best wife friendly media centre?
Created by amorpeth, last reply by jonolynn on 19-Apr-2014 20:20 (14 replies)

Snap suffering Trans-Tasman congestion 18/04?
Created by Lias, last reply by NonprayingMantis on 19-Apr-2014 00:05 (26 replies)
Pages... 2


Help ! Home business connection and VDSL dead. yikes.
Created by Scotsman, last reply by Scotsman on 17-Apr-2014 21:10 (26 replies)
Pages... 2


galaxy s4 now on 4.4.2
Created by nzrock, last reply by jeffnz on 21-Apr-2014 12:52 (62 replies)
Pages... 3 4 5


TVNZ on Demand Jailbreak Detection
Created by TranceManNZ, last reply by hio77 on 18-Apr-2014 20:25 (12 replies)

Is it legal to rip your own DVD in New Zealand?
Created by PSlover14, last reply by Geektastic on 18-Apr-2014 11:40 (25 replies)
Pages... 2



Geekzone Live »
Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.