No outgoing or incomming calls via sip-trunk

Hello guys!

I have a problem establishing calls via a sip-trunk.
calling an internally between extensions work like a charm.
It would be great if someone could help me.

I tested connecting a softphone directly to the LAN-Port which is configured for VoIP by the provider and i was able to receive an to initiate calls.

So then i set up my asterisk. I have two nics 1 connected to the provider and the second is connected to my LAN. SIP trunk is registered and the extensions are also registered.

FreePBX latest 2.11.X
Asterisk v11.7.0

I’m new to asterisk and freepbx so it might also be a one click solution.

When trying an outbound call from one of my extensions, i get immediately the “all-circuits-busy-now&pls-try-call-later”.

And thats the log: (sry i don’t know exactly from which line it’s relevant)

[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] Set(“SIP/3501-00000021”, “DIAL_TRUNK=1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:2] GosubIf(“SIP/3501-00000021”, “0?sub-pincheck,s,1()”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:3] GotoIf(“SIP/3501-00000021”, “0?disabletrunk,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:4] Set(“SIP/3501-00000021”, “DIAL_NUMBER=0123456789”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:5] Set(“SIP/3501-00000021”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:6] Set(“SIP/3501-00000021”, “OUTBOUND_GROUP=OUT_1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:7] GotoIf(“SIP/3501-00000021”, “0?nomax”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:8] GotoIf(“SIP/3501-00000021”, “0?chanfull”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:9] GotoIf(“SIP/3501-00000021”, “0?skipoutcid”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:10] Set(“SIP/3501-00000021”, “DIAL_TRUNK_OPTIONS=Tt”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:11] Macro(“SIP/3501-00000021”, “outbound-callerid,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] ExecIf(“SIP/3501-00000021”, “0?Set(CALLERPRES()=)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:2] ExecIf(“SIP/3501-00000021”, “0?Set(REALCALLERIDNUM=35)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:3] GotoIf(“SIP/3501-00000021”, “1?normcid”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Goto (macro-outbound-callerid,s,6)
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:6] Set(“SIP/3501-00000021”, “USEROUTCID=”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:7] Set(“SIP/3501-00000021”, “EMERGENCYCID=”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:8] Set(“SIP/3501-00000021”, “TRUNKOUTCID=0658220956”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:9] GotoIf(“SIP/3501-00000021”, “1?trunkcid”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Goto (macro-outbound-callerid,s,14)
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:14] ExecIf(“SIP/3501-00000021”, “1?Set(CALLERID(all)=0658220956)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:15] ExecIf(“SIP/3501-00000021”, “0?Set(CALLERID(all)=)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:16] ExecIf(“SIP/3501-00000021”, “0?Set(CALLERID(all)=)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]ro-outbound-callerid:17] ExecIf(“SIP/3501-00000021”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:18] Set(“SIP/3501-00000021”, “CDR(outbound_cnum)=0658220956”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:19] Set(“SIP/3501-00000021”, “CDR(outbound_cnam)=”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:12] GosubIf(“SIP/3501-00000021”, “0?sub-flp-1,s,1()”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:13] Set(“SIP/3501-00000021”, “OUTNUM=0123456789”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:14] Set(“SIP/3501-00000021”, “custom=SIP/Cablelink SIP”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:15] ExecIf(“SIP/3501-00000021”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Tt)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:16] ExecIf(“SIP/3501-00000021”, “0?Set(DIAL_TRUNK_OPTIONS=TtM(confirm))”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:17] Macro(“SIP/3501-00000021”, “dialout-trunk-predial-hook,”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] MacroExit(“SIP/3501-00000021”, “”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:18] GotoIf(“SIP/3501-00000021”, “0?bypass,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:19] ExecIf(“SIP/3501-00000021”, “1?Set(CONNECTEDLINE(num,i)=0123456789)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:20] ExecIf(“SIP/3501-00000021”, “1?Set(CONNECTEDLINE(name,i)=CID:0658220956)”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:21] GotoIf(“SIP/3501-00000021”, “0?customtrunk”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:22] Dial(“SIP/3501-00000021”, “SIP/Cablelink SIP/0123456789,300,Tt”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] netsock2.c: == Using SIP RTP TOS bits 184
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] netsock2.c: == Using SIP RTP CoS mark 5
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] app_dial.c: – Called SIP/Cablelink SIP/0123456789
[2014-04-11 08:40:40] WARNING[3430][C-00000014] chan_sip.c: Received response: “Forbidden” from ‘sip:[email protected];tag=as4f69788b’
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] app_dial.c: == Everyone is busy/congested at this time (1:0/0/1)
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:23] NoOp(“SIP/3501-00000021”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:24] GotoIf(“SIP/3501-00000021”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] Set(“SIP/3501-00000021”, “RC=21”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:2] Goto(“SIP/3501-00000021”, “21,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Goto (macro-dialout-trunk,21,1)
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] Goto(“SIP/3501-00000021”, “continue,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Goto (macro-dialout-trunk,continue,1)
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] NoOp(“SIP/3501-00000021”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:2] Set(“SIP/3501-00000021”, “CALLERID(number)=35”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:6] Macro(“SIP/3501-00000021”, “outisbusy,”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] Progress(“SIP/3501-00000021”, “”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:2] GotoIf(“SIP/3501-00000021”, “0?emergency,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:3] GotoIf(“SIP/3501-00000021”, “0?intracompany,1”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:4] Playback(“SIP/3501-00000021”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
[2014-04-11 08:40:40] VERBOSE[8212][C-00000014] file.c: – <SIP/3501-00000021> Playing ‘all-circuits-busy-now.gsm’ (language ‘de’)
[2014-04-11 08:40:42] VERBOSE[8212][C-00000014] file.c: – <SIP/3501-00000021> Playing ‘pls-try-call-later.gsm’ (language ‘de’)
[2014-04-11 08:40:44] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:5] Congestion(“SIP/3501-00000021”, “20”) in new stack
[2014-04-11 08:40:44] WARNING[8212][C-00000014] channel.c: Prodding channel ‘SIP/3501-00000021’ failed
[2014-04-11 08:40:44] VERBOSE[8212][C-00000014] app_macro.c: == Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/3501-00000021’ in macro ‘outisbusy’
[2014-04-11 08:40:44] VERBOSE[8212][C-00000014] pbx.c: == Spawn extension (from-internal, 0123456789, 6) exited non-zero on ‘SIP/3501-00000021’
[2014-04-11 08:40:44] VERBOSE[8212][C-00000014] pbx.c: – Executing [[email protected]:1] Hangup(“SIP/3501-00000021”, “”) in new stack
[2014-04-11 08:40:44] VERBOSE[8212][C-00000014] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/3501-00000021’
</code

Is your firewall set up properly? UDP 5060 forwarded to your server, 10000-20000 forwarded? Is the external IP set (settings,sip settings),in your freepbx config?

If so I would check the trunk config and match it to what your trunk provider wants. I use VOIPMS and they provide an exact trunk configuration that must be entered.

Thanks for your reply. My firewall is configured fine and the external IP is set correct.

I managed to solve the problems by adding a few configurations to the trunk settings:

insecure=invite
after this definition incomming calls worked

fromdomain= (was the same as host=)
fromuser= (was the same as username=)
with these two lines finally outgoing calls worked too