Setting Up Asterisk

#1
Note that since 2014 the AsteriskNOW Linux distribution and GUI are maintained by the same developers as FreePBX. You may wish to refer to the latest settings found in the Setting up FreePBX post. The information below is retained for historical purposes only.


Here are sample asterisk configs for Voipfone:

<<== start of sip.conf ==>>
[general]
register => 30040041:123456@sip.voipfone.net/30040041

[voipfone]
type=friend
secret=123456
username=30040041
fromuser=30040041
fromdomain=sip.voipfone.net
host=sip.voipfone.net
insecure=very
dtmfmode= rfc2833
context=fromvoipfone # inbound calls falls in this context of dialplan
<<== end of sip.conf ==>>

This is example of minimal extensions.conf dialplan. It simply forwards
all incoming calls to user 123 over SIP.

<<== extensions.conf ==>>
[voipfone]
exten => ._,1,Dial(SIP/123)

If you have problems with your box unregistering add

RTPkeepalive=60 in sip.conf
Last edited by Customer Services on January 2nd, 2015, 3:00 pm, edited 1 time in total.
Reason: AsteriskNOW core changes since RedHat purchased CentOS
Regards,

Voipfone Customer Services

iNet Telecoms Ltd (Voipfone)
Sovereign House
227 Marsh Wall
London
E14 9SD
United Kingdom

Registered number: 05168033
Vat Registration Number 858850966

Telephone: 020 7043 5555
Fax: 020 7043 5556

Web: http://www.voipfone.co.uk
Blog: http://www.voipfoneblog.co.uk
Forum: http://www.voipfoneuserforum.co.uk
Twitter: http://www.twitter.com/voipfone

Re: Setting Up Asterisk

#4
I needed to do the following to make this work:

In sip.conf, under the entry for the VoipFone SIP trunk connection:

insecure=invite

rather than

insecure=very

I also had to leave off the extension in the "register => ..." line, though this might have been due to me not yet having a PBX account.

Each of these changes fixed a different error message in Asterisk. Currently only tested for incoming calls, which are now correctly handled by Asterisk.

Re: Setting Up Asterisk

#5
Using FreePBX (v.5.211.65-16, Asterisk v.11.12.0), I get the following error when receiving inbound calls (outbound calls are fine).

Code: Select all

Ext. s:6 @ from-sip-external: "Rejecting unknown SIP connection from 195.189.173.10"
I don't get this if I set the "Allow Anonymous Inbound SIP Calls" option, however this is not a permanent solution. I've played around with adding permit and deny options to allow the Voipfone subnet (195.189.172.0/23), but it hasn't made a difference. My configuration is exactly as is suggested above.

Any suggestions would be appreciated.

Re: Setting Up Asterisk

#6
So... After enabling SIP debugging an and looking up the A record for sip.voipfone.net (195.189.173.27), I realised that the SIP INVITE was coming in from a different IP address (195.189.173.10) from where the trunk is registereed. Setting the SIP host to 195.189.173.10 fixes the problem, Of course, this isn't really a permament solution as DNS records can change.

I'm guessing that there is load balancing going on here. I can't comment on whether this was accepted on previous versions of Asterisk, but it's certainly causing issues on v.11

Re: Setting Up Asterisk

#7
tipstrade wrote:So... After enabling SIP debugging an and looking up the A record for sip.voipfone.net (195.189.173.27), I realised that the SIP INVITE was coming in from a different IP address (195.189.173.10) from where the trunk is registereed. Setting the SIP host to 195.189.173.10 fixes the problem, Of course, this isn't really a permament solution as DNS records can change.

I'm guessing that there is load balancing going on here. I can't comment on whether this was accepted on previous versions of Asterisk, but it's certainly causing issues on v.11
195.189.173.10 is our old network and should not be used. 195.189.173.27 / sip.voipfone.net is our new network which should be being used.

I suspect you have sip.voipfone.co.uk or voipfone.co.uk somewhere in your settings which will be why the calls are coming from the .10 IP.

Please contact support so we can help you set up correctly avoiding the wrong network.
Regards,

Voipfone Customer Services

iNet Telecoms Ltd (Voipfone)
Sovereign House
227 Marsh Wall
London
E14 9SD
United Kingdom

Registered number: 05168033
Vat Registration Number 858850966

Telephone: 020 7043 5555
Fax: 020 7043 5556

Web: http://www.voipfone.co.uk
Blog: http://www.voipfoneblog.co.uk
Forum: http://www.voipfoneuserforum.co.uk
Twitter: http://www.twitter.com/voipfone

Re: Setting Up Asterisk

#8
Sorry, didn't get notified of any replies, and the SIP trunk has been working on the .10 IP - out of sight out of mind!

Anyhow, I did a quick grep on the asterisk configuration and discovered I'd been using sip.voipfone.co.uk in the REGISTER settings - don't quite know how that snuck in.

Thanks for the help.

Re: Setting Up Asterisk

#10
If you're using a version of Asterisk later than about 1.8 (and you really should be - that's from 2010 and EOL now) the example configs won't work.

However, I put up an example sip.conf which works for me - see
https://gist.github.com/talkingnews/2c5 ... 4187f96db1

HOWEVER! Please note that this is based on the old sip stack and therefore goes in sip.conf.

If you're using current versions of Asterisk, you should be using pjsip.conf - that said, while more flexible and far more advanced, it's a little more complex and I'm having trouble getting it to handle an incoming call via Voipfone. When I suss that out, I'll come back and update this post with a more modern config :)

Re: Setting Up Asterisk

#11
The example configs are STILL obsolete, but I made a video and guide which I hope will help others. Please leave any corrections or suggestions on the video or in this thread viewtopic.php?f=14&t=7158. This is NOT intended to be an in-depth guide, but it does focus on the basic level of security which any install should have.

The guide uses the latest Asterisk 13.10 and includes the recently announced Voipfone ip and subnet changes.

Video: https://youtu.be/h12NkJQwpYo
Full guide to follow along with: https://github.com/lardconcepts/asteris ... -Ubuntu.md

Hope this helps!

Re: Setting Up Asterisk

#12
Updated - see https://github.com/lardconcepts/asteris ... ne-config/

In particular, you will need to note that you cannot make chargeable outgoing calls without setting the following lines in pjsip_wizard.conf:

Code: Select all

endpoint/contact_user = ACCOUNTNUMBER*200
endpoint/from_user = ACCOUNTNUMBER*200
endpoint/from_domain = sip.voipfone.net
So, a complete config would look like this for an extension on 200:

Code: Select all

[voipfone-200]
type = wizard
sends_auth = yes
sends_registrations = yes
transport = simpletrans
remote_hosts = sip.voipfone.net:5060
outbound_auth/username = ACCOUNTNUMBER*200
outbound_auth/password = 53cur3Pa55w0rD
registration/contact_user = ACCOUNTNUMBER*200
endpoint/allow = alaw
endpoint/context = fromvoipfone
endpoint/language=en_GB
; this next part is essential if you want to make chargeable outgoing calls via Voipfone.
; if you don't even want to do that, leaving it out may add some security
endpoint/contact_user = ACCOUNTNUMBER*200
endpoint/from_user = ACCOUNTNUMBER*200
endpoint/from_domain = sip.voipfone.net

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Copyright 2004 - 2017, iNet Telecoms® Ltd. All rights reserved.


cron