Link to home
Start Free TrialLog in
Avatar of wimpie_asg
wimpie_asgFlag for South Africa

asked on

Trixbox. SIIP Trunks

Hi all,

I am trying to find out how to create a SIP trunk for an 087 number in Trixbox. The steps I have followed and found so far is very broad. When I create a SIP trunk for an 087 number, and dial "0" for an outside line as I have specified in my dial plan, is just says "all circuits are bussy now, please try again later" I have the exact config from my provider which they say you have to add in Asterisk within /etc/astersik/users.conf, but would that be the same for Trixbox?

Please help, as I am head over hills with this SIP trunk.
Avatar of Roachy1979
Roachy1979
Flag of United Kingdom of Great Britain and Northern Ireland image

Can you ssh onto the trixbox and run

asterisk -rvvvvv

Then  try to dial the 087 numberand post the output here.....the output from this will give us a better idea of what is happening with the call :)
Avatar of wimpie_asg

ASKER

Hi,

Thx for the reply,

- The number I have dialed was 15551234, "1" for the outside line, 5551234 the actual number
- "MY_SIP_NUMBER" is the 087 number I am trying to dial from (The SIP trunk's number it self)
Thx allot, really appreciated!

 -- Executing [15551234@from-internal:1] Macro("SIP/200-08943c00", "user-callerid|SKIPTTL|") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/200-08943c00", "AMPUSER=200") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/200-08943c00", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/200-08943c00", "1|Set|REALCALLERIDNUM=200") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/200-08943c00", "AMPUSER=200") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/200-08943c00", "AMPUSERCIDNAME=200") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/200-08943c00", "0?report") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/200-08943c00", "AMPUSERCID=200") in new stack
    -- Executing [s@macro-user-callerid:8] Set("SIP/200-08943c00", "CALLERID(all)="200" <200>") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/200-08943c00", "REALCALLERIDNUM=200") in new stack
    -- Executing [s@macro-user-callerid:10] ExecIf("SIP/200-08943c00", "0|Set|CHANNEL(language)=") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("SIP/200-08943c00", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,20)
    -- Executing [s@macro-user-callerid:20] NoOp("SIP/200-08943c00", "Using CallerID "200" <200>") in new stack
    -- Executing [15551234@from-internal:2] Set("SIP/200-08943c00", "_NODEST=") in new stack
    -- Executing [15551234@from-internal:3] Macro("SIP/200-08943c00", "record-enable|200|OUT|") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/200-08943c00", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] AGI("SIP/200-08943c00", "recordingcheck|20090417-110534|1239959134.2") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
  recordingcheck|20090417-110534|1239959134.2: Outbound recording not enabled
    -- AGI Script recordingcheck completed, returning 0
    -- Executing [s@macro-record-enable:5] MacroExit("SIP/200-08943c00", "") in new stack
    -- Executing [15551234@from-internal:4] Macro("SIP/200-08943c00", "dialout-trunk|2|5551234||") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/200-08943c00", "DIAL_TRUNK=2") in new stack
    -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/200-08943c00", "0?sub-pincheck|s|1") in new stack
    -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/200-08943c00", "0?disabletrunk|1") in new stack
    -- Executing [s@macro-dialout-trunk:4] Set("SIP/200-08943c00", "DIAL_NUMBER=5551234") in new stack
    -- Executing [s@macro-dialout-trunk:5] Set("SIP/200-08943c00", "DIAL_TRUNK_OPTIONS=tr") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/200-08943c00", "OUTBOUND_GROUP=OUT_2") in new stack
    -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/200-08943c00", "0?nomax") in new stack
    -- Executing [s@macro-dialout-trunk:8] GotoIf("SIP/200-08943c00", "0?chanfull") in new stack
    -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/200-08943c00", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:10] Set("SIP/200-08943c00", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [s@macro-dialout-trunk:11] Macro("SIP/200-08943c00", "outbound-callerid|2") in new stack
    -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/200-08943c00", "0|SetCallerPres|") in new stack
    -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/200-08943c00", "0|Set|REALCALLERIDNUM=200") in new stack
    -- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/200-08943c00", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,6)
    -- Executing [s@macro-outbound-callerid:6] Set("SIP/200-08943c00", "USEROUTCID=200") in new stack
    -- Executing [s@macro-outbound-callerid:7] Set("SIP/200-08943c00", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("SIP/200-08943c00", "TRUNKOUTCID="MY_SIP_NUMBER"") in new stack
    -- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/200-08943c00", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,12)
    -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/200-08943c00", "1|Set|CALLERID(all)="MY_SIP_NUMBER"") in new stack
    -- Executing [s@macro-outbound-callerid:13] GotoIf("SIP/200-08943c00", "0?exit") in new stack
    -- Executing [s@macro-outbound-callerid:14] Set("SIP/200-08943c00", "CALLERID(all)=200") in new stack
    -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/200-08943c00", "0|SetCallerPres|prohib_passed_screen") in new stack
    -- Executing [s@macro-dialout-trunk:12] ExecIf("SIP/200-08943c00", "0|AGI|fixlocalprefix") in new stack
    -- Executing [s@macro-dialout-trunk:13] Set("SIP/200-08943c00", "OUTNUM=5551234") in new stack
    -- Executing [s@macro-dialout-trunk:14] Set("SIP/200-08943c00", "custom=SIP/trunk_1") in new stack
    -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/200-08943c00", "0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^)") in new stack
    -- Executing [s@macro-dialout-trunk:16] Macro("SIP/200-08943c00", "dialout-trunk-predial-hook|") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/200-08943c00", "") in new stack
    -- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/200-08943c00", "0?bypass|1") in new stack
    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/200-08943c00", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:19] Dial("SIP/200-08943c00", "SIP/trunk_1/5551234|300|") in new stack
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [s@macro-dialout-trunk:20] Goto("SIP/200-08943c00", "s-CHANUNAVAIL|1") in new stack
    -- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
    -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] GotoIf("SIP/200-08943c00", "1?noreport") in new stack
    -- Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
    -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:3] NoOp("SIP/200-08943c00", "TRUNK Dial failed due to CHANUNAVAIL (hangupcause: 3) - failing through to other trunks") in new stack
    -- Executing [15551234@from-internal:5] Macro("SIP/200-08943c00", "outisbusy|") in new stack
    -- Executing [s@macro-outisbusy:1] Playback("SIP/200-08943c00", "all-circuits-busy-now|noanswer") in new stack
    -- <SIP/200-08943c00> Playing 'all-circuits-busy-now' (language 'en')
    -- Executing [s@macro-outisbusy:2] Playback("SIP/200-08943c00", "pls-try-call-later|noanswer") in new stack
    -- <SIP/200-08943c00> Playing 'pls-try-call-later' (language 'en')
    -- Executing [s@macro-outisbusy:3] Macro("SIP/200-08943c00", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] ResetCDR("SIP/200-08943c00", "w") in new stack
    -- Executing [s@macro-hangupcall:2] NoCDR("SIP/200-08943c00", "") in new stack
    -- Executing [s@macro-hangupcall:3] GotoIf("SIP/200-08943c00", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,6)
    -- Executing [s@macro-hangupcall:6] GotoIf("SIP/200-08943c00", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [s@macro-hangupcall:9] GotoIf("SIP/200-08943c00", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,11)
    -- Executing [s@macro-hangupcall:11] Hangup("SIP/200-08943c00", "") in new stack
Have you got the outbound route set up?

You need to add an outbound route to push the call through the trunk.....an example outbound route would be

9|.

Check the trunk sequence points to the trunk you have set up....

The trunk should include the following in the outgoing settings...

host=
username=
secret=
type=peer

You should also remember to include the string under the dial rules for the trunk...for example the dial rules here for a UK number are:

44+0|XXXXXXXXXX

Also make sure that you have specified the maximum number of channels your provider has assigned to you....

If this doesn't work you can check the registration of the trunk using:

sip show peer <trunkname>

from the asterisk cli :)

Hi,

Thanks for your reply...


SIP Trunk:

I have added an "1" for a outside line to use my trunk called "trunk_1" which is my SIP trunk,
I have added my maximum channels = 5

I have added my "PEER details which are:
host=sip99.telfreesa.com
username=55512345
secret=5551234
type=peer

Outbound Route:

Route Name: SIPProvider
Dial Patterns: 1|.
Trunk Sequence: Trunk_1

When I run the following command:

sip show peer trunk_1

  * Name       : trunk_1
  Secret       : <Set>
  MD5Secret    : <Not set>
  Context      : from-sip-external
  Subscr.Cont. : <Not set>
  Language     :
  AMA flags    : Unknown
  Transfer mode: open
  CallingPres  : Presentation Allowed, Not Screened
  Callgroup    :
  Pickupgroup  :
  Mailbox      :
  VM Extension : *97
  LastMsgsSent : 32767/65535
  Call limit   : 0
  Dynamic      : No
  Callerid     : "" <>
  MaxCallBR    : 384 kbps
  Expire       : -1
  Insecure     : no
  Nat          : Always
  ACL          : No
  T38 pt UDPTL : No
  CanReinvite  : Yes
  PromiscRedir : No
  User=Phone   : No
  Video Support: Yes
  Trust RPID   : No
  Send RPID    : No
  Subscriptions: Yes
  Overlap dial : Yes
  DTMFmode     : rfc2833
  LastMsg      : 0
  ToHost       : sip99.telfreesa.com
  Addr->IP     : 196.46.138.29 Port 5060
  Defaddr->IP  : 0.0.0.0 Port 0
  Def. Username: 5551234
  SIP Options  : (none)
  Codecs       : 0x28000c (ulaw|alaw|h263|h264)
  Codec Order  : (ulaw:20,alaw:20)
  Auto-Framing:  No
  Status       : Unmonitored
  Useragent    :
  Reg. Contact :

When I dial a 1 to specify that I want to dial through my SIP trunk, followed by the whole number, all I get is "all circuits are bussy now - please try again later"
I am new at creating 087 SIP trunks, but I am not that new in installing Digium.Sangoma cards and breaking out on landline, but for the life of me I just cant get the SIP trunk to work.

Thx again for the help!
What handsets are you using....?

I ask because we have a similar issue, but it is  timeout related and I have not had a chance to fix it.  The temp fix is that users have to dial on-hook and then hit the dial button or lift the receiver...regardless of how quickly they dial it times out otherwise....

I have a SNOM 300, but I have installed X-Lite soft-phone to confirm... And I am getting it on both the phones...

Appart from creating the trunk and outbound route in the GUI, that is all I have configured for my SIP trunk, I have not configured anything else...So I thought it could be that there is no credit available in my 087 accounts, but regardless, you shoul be able to phone from 087 to 087 that is hosted by the same provider for free, and I have confirmed this with two SIP soft phones installed on 2x diffrent computers, the accounts can phone each other, that is if they are registered with the SIP service provider directly.

But with the all channels are busy error, that tels me the problem lays with Trixbox, and not the provider...
It could be the trixbox or it could be the registration of the trixbox with the provider....

I'm going over to the office where ours is located in a short while so I'll place some test calls in debug mode and see what a "good call" looks like (although we have IAX2 trunks so it might be a little different!)

Can I just confirm that outbound traffic on the SIP UDP ports are permitted on your firewall?  Sorry to have to ask - but it's worth checking.... you can test this by downloading and installing nmap on your trixbox (yum install nmap) and running

nmap yoursipproviderip -p 5060

You should get a port status of Open or filtered

If you can run the trixbox in debug mode that would be handy.....

sip set debug peer <peername>

ASKER CERTIFIED SOLUTION
Avatar of Roachy1979
Roachy1979
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have, with your help, managed to make calls from Trixbox using my SIP trunks, and my CID registers with the number I am dialing as my SIP number, this is an awsum day! I got this to work by changing my protocol I was using from G729 "because I have not purchased any licenses for this protocol" to ulaw protocol, and the message of "all channels are bussy now - please try again later" had dissapeared, but I had to restart the whole Asterisk box after I have changed the protocol, it did not work by just applying new settings... "That through me off a bit" So, Question, The no channels being available issue, was that because of the G729 protocol not being purchased?

Any way, so, now I have 5x SIP trunks, which shows under PBX status as registered, and if one is bussy, the next one would make a call. And if all 5 are bussy, my next trunk available which is my Sangoma card 4x FXO ports would handle the calls.

I have one problem though "I know, I am full of problems" This is the last question though...
I can now make calls on my 087 trunks, but, wait for it...I cant receive calls on them... If I dial any of the 087 numbers that I can make a call on, it says "The number is not in use" I take the same number, register it on X-Lite soft phone, and I call the number again, and it rings... So from X-Lite, I can make and receive calls with a 087 number, but I cannot make a call to the Trixbox to my 087 numbers...

My User Details in my SIP trunk looks as follow...

username=XXXXXXXXXX
canreinvite=no
type=user
nat=true
secret=XXXXXXXXXX
qualify=yes
insecure=very
host=proxy01.sipphone.com
dtmfmode=rfc2833
context=from-trunk

Register String:
myusername:mypassword@sip99.telfreesa.com/myusername

Thank-You so much for the help sop far, I am halfway there!

Really glad this is working for you.....

You are obviously registering with your SIP provider to make calls.....your inbound and outbound trunks should contain the same information....

There are a few things to check....

1) Your public IP address is registered with the SIP provider
2) Your firewall is configured to receive & allow inbound traffic through
3) The trixbox is configured to receive the calls
4) The trixbox is configured to do something with the calls when  they are received.

We need to establish where in the sequence of events the problem is.

You can see whether the call is getting as far as the trixbox with the asterisk -rvvvv comand again....you will see the call hitting the device if you  dial from another phone....if you see the call getting through to the asterisk as an event, then it's an issue with the call routing in the asterisk....if not we need to look at the networking side of things...

If not, from the trixbox command line type iptables -L and post the output, just to confirm iptables is accepting inbound traffic.....you will also need to confirm that your public internet facing firewall is also configured for SIP (there are a lot of ports to allow.....which is one of the reasons why I prefer IAX2 trunks if you have a provider that supports them).  

Hi,

I have done as you suggested:

When I run SIP set debug in the CLI, and when I phone one of my SIP trunks, every single time it tells me number does not exist when I try and phone my SIP trunk, it comes up with the following line:

--- (7 headers 0 lines) ---
Really destroying SIP dialog 'ejndbjonaddcbibo.1@-991168375-6109' Method: ACK

<------------>
Scheduling destruction of SIP dialog 'ejndbjonaddcbibo.1@-991168375-6109' in 32000 ms (Method: INVITE)
trixbox1*CLI>
<--- SIP read from 196.46.138.29:5060 --->
ACK SIP_trunk_number:@196.211.12.243 SIP/2.0
Via: SIP/2.0/UDP 196.46.138.29:5060;branch=z9hG4bK-Koncept-citymoon-out-6a017c7f4c290b5b-1--Koncept;rport
To: SIP_trunk_number<sip:SIP_trunk_number@sip99.telfreesa.com>;tag=as5fe183bb
From: CALL_number_from<sip:CALL_number_from@196.46.138.28>;tag=37f87932
Call-ID: ejndbjonaddcbibo.1@-991168375-6109
CSeq: 1 ACK
Content-Length: 0

Thats it, nothing else. So I guess the call does reach Trixbox, but for some strange reason, it just says the number does not exist. My PEER details and my USER details are all the same under trunk settings, and I can succesfully make calls from my SIP trunk, but I cannot receive, and when I try and phone my SIP number, it does register with Trixbox, with the SIP debugging as we saw, but it comes up with number does not exist. I have opened both ways port 5060, TCP and UDP, I have opened and forwarded RTP group ports from 10000 - 20000 UDP to my trix box "Hence the phone calls working" and other ports "because I was desperate" for example port 2000, 6600, 5600 all TCP and UDP. And still the inbound call does not work, but does register with Trixobox!

Please help...Thanks in advanced!
I'm a little baffled here myself......

Just to go back to basics and to confirm this in my head, we have :

1) Got outbound working - you can register the trunk and...
2) Place outbound calls....

You cannot receive inbound via SIP, but we can via fixed line....the call presents itself in the Asterisk CLI though....

...Have you got "allow anonymous inbound sip calls" set in the general tab?  

Under the trunk incoming settings do you have the following (as well as any other settings):

secret=***password***
type=friend
context=from-trunk



Hi,

This is the settings I have under my "incomming" trunk settinings

disallow=all
allow=ulaw
context=DID_trunk_2
hasexten=no
hasiax=no
hassip=yes
host=sip99.telfreesa.com
port=5060
registeriax=no
registersip=yes
secret=hb25go96p
trunkname=Custom - TelFree
trunkstyle=customvoip
username=877507856
callerid=877507856
fromuser=877507856
fromdomain=sip99.telfreesa.com
permit=196.46.138.29/29
insecure=very
qualify=no
canreinvite=no
type=peer

Should the context, and the peer settings change?