SIP Trunk not registring

Hi guys, I am quite new to this whole thing, so please bear with me.

The thing is, I’ve gotten PBX and Asteriks setup on my Ubuntu box, 9.10, Karmic, updated. Verions are: Asterisk 1.6.2.0~rc2-0ubuntu1.1 and FreePBX 2.5.2.1.

I can log in just fine. But, now is the thing, for the live of me I cannot get the darn thing to DO anything. My softphone, X-Lite, can’t connect. My SIP trunk with my VOIP provider doesn’t get registered.

I log on via asterisk -r, do a sip show registry and all I get is:

ruby*CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
0 SIP registrations.

I think I entered everything correctly, but I am not to sure anyomore. Before this attempt with FreePBX, I manually tried to wing it with editing extensions.conf and sip.conf by hand. It didn’t allow for calls, but that setup DID allow to register. Ie, I could get the asterisk box to register my SIP line with the provider. And my softphone to register with Asterisk. Grantend, I never got it to actually do anything besides trying to route every call internally, but now I am even further from home.

In short, I want to have Asterisk connect to my VOIP provider, my Softphones to Asterisk and be able to receive and place calls to normal POST type phones.

Any help would be greatly appreciated, I tried to be as verbose as possible. One final thing, I am using TweakPhone/TweakDSL, a Dutch VOIP provider. If I load up my X-Lite softphone with their data directly, ie, without NAT and with direct network access, that works fine. So I believe at least the credentials are solid.

My current config looks like this;

sip_additional.conf

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

[10]
deny=0.0.0.0/0.0.0.0
type=friend
secret=xxxx
qualify=yes
port=5060
pickupgroup=
permit=0.0.0.0/0.0.0.0
nat=yes
mailbox=10@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/10
context=from-internal
canreinvite=no
callgroup=
callerid=device <10>
accountcode=
call-limit=50

[TweakIn]
fromuser=############
username=############
secret=XXXXXX
host=sip.tweakphone.nl
nat=yes
type=friend

[TweakOut]
fromuser=###########
username=###########
secret=XXXXX
host=sip.tweakphone.nl
insecure=port,invite
nat=yes
qualify=yes
srvloopup=yes
type=friend

If the PBX is set up correctly there’s no trick to setting up an X-Lite phone.

Step 1 - set up an extension for it under “extensions” in the left side menu of the freepbx screen.

Example:

  • Click on extensions
  • Leave the device setting as (Generic SIP Extension)
  • Click submit
  • Put a number like 6005 in the User Extension field
  • Put a name like Crimson Rider in the Display Name field
  • Put a password like 6005cr in the Secret field (has to contain letters and numbers)
  • Scroll down to the Voicemail & Directory section
  • “Enable” it using the drop down
  • make the password 6005 since you can’t dial letters with a normal phone and voicemail doesn’t require strong passwords
  • click submit
  • click apply changes (orange bar)
  • When your extension appears on the right, click on it
  • Scroll down to where it says “nat yes” and change the yes to no
  • scroll down
  • click submit
  • click apply changes

Step 2 setup Xlite

  • Open Xlite if it doesn’t prompt you for settings at open click the Down arrow/triangle icon at the top of the phone
  • If there are no accout entries click on add on the right
  • If you have tried to create an account that’s not working double click it to edit
  • Put Crimson Rider in the display name field
  • Put 6005 in the username field
  • Put 6005cr in the password field
  • Put 6005 in the Autorization User Name field
  • Put the IP address of the Asterisk PBX in the Domain field
  • make sure Register with a domain and Recieve incoming calls is checked
  • Click OK
  • Click Close
  • Your phone should now register
  • If it does you will see Ready and Your User Name is 6005 in the display

Go back to asterisk and do sip show peers in the CLI or look at the FreePBX status screen and see if you show 1 phone registered

If that works you can move onto registering a trunk. I might be able to help you but will need to know the name of the provider and see their instructions for registering through FreePBX/Asterisk.

Thank you very much for your reply, I will try it as soon as I am able.

For the record, my provider is TweakPhone, I do have a ‘working’ SIP/Extension file that I did manually some time back. That does register, but does nothing else.

This file registers, but doesn’t show anything in PBX

sip.conf:

[general]
context=default
bindport=5060
bindaddr = 0.0.0.0
srvlookup=yes
sipdebug = yes
register => [email protected]/xxxxxxxxxxxxxx
externip = xxxxxxxxxxxx
localnet=192.168.40.0/255.255.255.0
nat=yes

[tweak-out]
type=peer
secret=xxxxxxxx
username=xxxxxxxx
fromuser=xxxxxxxx
fromdomain=sip.tweakphone.nl
host=sip.tweakphone.nl
realm=sip.tweakphone.nl
call-limit=5
dtmfmode=auto
context=default
insecure=port,invite
qualify=no
nat=no
canreinvite=no
disallow=all
allow=alaw
allow=ulaw
allow=all

I would not edit extensions.conf or sip.conf while using FreePBX as your changes will normally be overwritten when you “apply changes”

Only edit sip_custom.conf or extensions_custom.conf if it is required and it shouldn’t be in most cases.

The following piece should probably be in your “Trunk” definition in the “PEER Details” section and not manually entered.

Trunk definition FreePBX trunk screen

Trunk name - in the outgoing section

tweak-out

PEER Details Box

type=peer
secret=secret
username=xxxxxxxx
fromuser=xxxxxxxx
fromdomain=sip.tweakphone.nl
host=sip.tweakphone.nl
realm=sip.tweakphone.nl
call-limit=5
dtmfmode=auto
context=default
insecure=port,invite
qualify=no
nat=no
canreinvite=no
disallow=all
allow=ulaw&alaw&gsm

Remove the tweak-out section from sip.conf

AND your registration string should be at the bottom of that page

Registration string box

[email protected]/xxxxxxxxxxxxxx

Take out the line you have for it in the above [general] section

The sip.conf file should be returned to it’s default if you want to use FreePBX to manage your system.

Otherwise you will break other parts of the FreePBX config that are in #Includes.

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;
; This file is part of FreePBX.
;
; FreePBX is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 2 of the License, or
; (at your option) any later version.
;
; FreePBX is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with FreePBX. If not, see http://www.gnu.org/licenses/.
;
; Copyright © 2004 Coalescent Systems Inc (Canada)
; Copyright © 2006 Why Pay More 4 Less Pty Ltd (Australia)
; Copyright © 2007 Astrogen LLC (USA)

[general]

; These files will all be included in the [general] context
;
#include sip_general_additional.conf

;sip_general_custom.conf is the proper file location for placing any sip general
;options that you might need set. For example: enable and force the sip jitterbuffer.
;If these settings are desired they should be set the sip_general_custom.conf file.
;
; jbenable=yes
; jbforce=yes
;
;It is also the proper place to add the lines needed for sip nat’ing when going
;through a firewall. For nat’ing you’d need to add the following lines:
; nat=yes , externip= , localhost= , and optionally fromdomain= .
;
#include sip_general_custom.conf

;sip_nat.conf is here for legacy support reasons and for those that upgrade
;from previous versions. If you have this file with lines in it please make
;sure they are not duplicated in sip_general_custom.conf, if so remove them
;from sip_nat.conf as sip_general_custom.conf will have precedence.
#include sip_nat.conf

;sip_registrations_custom.conf is for any customizations you might need to do to
;the automatically generated registrations that FreePBX makes.
;
#include sip_registrations_custom.conf
#include sip_registrations.conf

; These files should all be expected to come after the [general] context
;
#include sip_custom.conf
#include sip_additional.conf

;sip_custom_post.conf If you have extra parameters that are needed for a
;extension to work to for example, those go here. So you have extension
;1000 defined in your system you start by creating a line 1000 in this
;file. Then on the next line add the extra parameter that is needed.
;When the sip.conf is loaded it will append your additions to the end of
;that extension.
;
#include sip_custom_post.conf

I put together a website called PBX in a Flash for Newbies. PBX in a Flash is a distribtuion of Asterisk that uses FreePBX for configuration. I have several pages on configuring SIP phones, X-lite, PSTN, etc… You’ll find that most of the time you do NOT manually configure the config files. You configure through FreePBX.

Those files were made before I used PBX, just Asterisk then. But i’ll keep it in mind.

Once more, many thanks for the answers. I’ll try em as soon as I can and will try the Flash site as well.

I just noticed that I left the secret go unblanked in one of my post, could you remove that bit mwilson75? It shows up in your quote.

Also, I’ve put back the original conf files. Thank you again.

Sorry,

I didn’t catch it earlier