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.


gchiu

1211 posts

Uber Geek

Trusted
DR

#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 '028xxxxxx@2talk.co.nz' 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
gchiu

1211 posts

Uber Geek

Trusted
DR

  #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.



sbiddle
30853 posts

Uber Geek

Retired Mod
Trusted
Biddle Corp
Lifetime subscriber

  #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.

freitasm
BDFL - Memuneh
79253 posts

Uber Geek

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

  #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.





Please support Geekzone by subscribing, or using one of our referral links: Samsung | AliExpress | Wise | Sharesies | Hatch | GoodSyncBackblaze backup




gchiu

1211 posts

Uber Geek

Trusted
DR

  #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?

sbiddle
30853 posts

Uber Geek

Retired Mod
Trusted
Biddle Corp
Lifetime subscriber

  #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.
   

chevrolux
4962 posts

Uber Geek
Inactive user


  #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.

gchiu

1211 posts

Uber Geek

Trusted
DR

  #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?

 
 
 

Cloud spending continues to surge globally, but most organisations haven’t made the changes necessary to maximise the value and cost-efficiency benefits of their cloud investments. Download the whitepaper From Overspend to Advantage now.
chevrolux
4962 posts

Uber Geek
Inactive user


  #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.

sbiddle
30853 posts

Uber Geek

Retired Mod
Trusted
Biddle Corp
Lifetime subscriber

  #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.

gchiu

1211 posts

Uber Geek

Trusted
DR

  #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.

techmeister
310 posts

Ultimate Geek


  #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:password@27.111.14.66/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












gchiu

1211 posts

Uber Geek

Trusted
DR

  #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


chevrolux
4962 posts

Uber Geek
Inactive user


  #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.

techmeister
310 posts

Ultimate Geek


  #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.

techmeister
310 posts

Ultimate Geek


  #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.

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





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









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.