Outbound calls busy, Inbound fine with Broadvoice SIP Trunk

I’m losing my mind over this! Broadvoice support can’t help, I can’t track down the problem. The trunk is registered, I’m accepting inbound calls, but my local asterisk server is issuing a “Forbidden” response, preventing any outbound calls from even reaching Broadvoice, although we are pinging each other fine. And the configuration worked one day and then died the next.

Furthermore, I’ve wavered back and forth between a HANGUPCAUSE=21 and HANGUPCAUSE=18, with a emphasis on the former.

show sip peers yields 2 peers responding OK

PEER DETAILS
username=8436363398
host=206.15.130.13
type=friend
trustrpid=yes
sendrpid=yes
qualify=yes
nat=no
insecure=very
canreinvite=nonat
disallow=all
allow=ulaw&g729
dtmfmode=rfc2833

And that was after bouncing between Broadvoice techs and the best advice the internet has to offer (forums, voip-info, asterisk docs, etc)

I can’t find the problem for the life of me, and the only other forum I could find on a similar issue was a dead end.

I’m stumped. I’m attaching my asterisk log output during an outbound call on one of two near identical trunks (server in Boston and another in LA, with same log output).

If anyone cares to take a look and let me know if I’m doing something stupid, I’d appreciate it!

May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:1] Set(“SIP/6-00000000”, “AMPUSER=6”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:2] GotoIf(“SIP/6-00000000”, “0?report”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:3] ExecIf(“SIP/6-00000000”, “1?Set(REALCALLERIDNUM=6)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:4] Set(“SIP/6-00000000”, “AMPUSER=6”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:5] Set(“SIP/6-00000000”, “AMPUSERCIDNAME=Logan”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/6-00000000”, “0?report”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:7] Set(“SIP/6-00000000”, “AMPUSERCID=6”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:8] Set(“SIP/6-00000000”, “CALLERID(all)=“Logan” <6>”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:9] ExecIf(“SIP/6-00000000”, “0?Set(CHANNEL(language)=)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:10] GotoIf(“SIP/6-00000000”, “1?continue”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-user-callerid,s,19)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:19] Set(“SIP/6-00000000”, “CALLERID(number)=6”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:20] Set(“SIP/6-00000000”, “CALLERID(name)=Logan”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-user-callerid:21] NoOp(“SIP/6-00000000”, “Using CallerID “Logan” <6>”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [9199238123@from-internal:2] NoOp(“SIP/6-00000000”, “Calling Out Route: All”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [9199238123@from-internal:3] Set(“SIP/6-00000000”, “MOHCLASS=default”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [9199238123@from-internal:4] Set(“SIP/6-00000000”, “_NODEST=”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [9199238123@from-internal:5] Macro(“SIP/6-00000000”, “record-enable,6,OUT,”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-record-enable:1] GotoIf(“SIP/6-00000000”, “1?check”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-record-enable,s,4)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-record-enable:4] ExecIf(“SIP/6-00000000”, “0?MacroExit()”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-record-enable:5] GotoIf(“SIP/6-00000000”, “0?Group:OUT”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-record-enable,s,15)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-record-enable:15] GotoIf(“SIP/6-00000000”, “0?IN”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-record-enable:16] ExecIf(“SIP/6-00000000”, “1?MacroExit()”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [9199238123@from-internal:6] Macro(“SIP/6-00000000”, “dialout-trunk,2,9199238123,”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:1] Set(“SIP/6-00000000”, “DIAL_TRUNK=2”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/6-00000000”, “0?sub-pincheck,s,1”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/6-00000000”, “0?disabletrunk,1”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:4] Set(“SIP/6-00000000”, “DIAL_NUMBER=9199238123”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:5] Set(“SIP/6-00000000”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:6] Set(“SIP/6-00000000”, “OUTBOUND_GROUP=OUT_2”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/6-00000000”, “0?nomax”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/6-00000000”, “0?chanfull”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/6-00000000”, “0?skipoutcid”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:10] Set(“SIP/6-00000000”, “DIAL_TRUNK_OPTIONS=”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/6-00000000”, “outbound-callerid,2”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/6-00000000”, “0?Set(CALLERPRES()=)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/6-00000000”, “1?Set(REALCALLERIDNUM=6)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/6-00000000”, “1?normcid”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-outbound-callerid,s,6)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:6] Set(“SIP/6-00000000”, “USEROUTCID=<8436363398>”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:7] Set(“SIP/6-00000000”, “EMERGENCYCID=8436363398”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:8] Set(“SIP/6-00000000”, “TRUNKOUTCID=<8436363398>”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/6-00000000”, “1?trunkcid”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-outbound-callerid,s,12)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/6-00000000”, “1?Set(CALLERID(all)=<8436363398>)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/6-00000000”, “1?Set(CALLERID(all)=<8436363398>)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/6-00000000”, “0?Set(CALLERID(all)=)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/6-00000000”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/6-00000000”, “0?sub-flp-2,s,1”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:13] Set(“SIP/6-00000000”, “OUTNUM=9199238123”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:14] Set(“SIP/6-00000000”, “custom=SIP/Broadvoice”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/6-00000000”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:16] Macro(“SIP/6-00000000”, “dialout-trunk-predial-hook,”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/6-00000000”, “”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/6-00000000”, “0?bypass,1”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/6-00000000”, “0?customtrunk”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:19] Dial(“SIP/6-00000000”, “SIP/Broadvoice/9199238123,300,”) in new stack
May 28 14:02:46 VERBOSE [6102] netsock2.c:
== Using SIP RTP TOS bits 184
May 28 14:02:46 VERBOSE [6102] netsock2.c:
== Using SIP RTP CoS mark 5
May 28 14:02:46 VERBOSE [6102] app_dial.c:
– Called SIP/Broadvoice/9199238123
May 28 14:02:46 WARNING [5856] chan_sip.c:
Received response: “Forbidden” from '“8436363398” sip:[email protected];tag=as02e0f0de’
May 28 14:02:46 VERBOSE [6102] app_dial.c:
== Everyone is busy/congested at this time (1:0/0/1)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:20] NoOp(“SIP/6-00000000”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s@macro-dialout-trunk:21] Goto(“SIP/6-00000000”, “s-CHANUNAVAIL,1”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/6-00000000”, “RC=21”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/6-00000000”, “21,1”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-dialout-trunk,21,1)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [21@macro-dialout-trunk:1] Goto(“SIP/6-00000000”, “continue,1”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-dialout-trunk,continue,1)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [continue@macro-dialout-trunk:1] GotoIf(“SIP/6-00000000”, “1?noreport”) in new stack
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Goto (macro-dialout-trunk,continue,3)
May 28 14:02:46 VERBOSE [6102] pbx.c:
– Executing [continue@macro-dialout-trunk:3] NoOp(“SIP/6-00000000”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack

It may also be worth noting that Broadvoice doesn’t require registration, they connect based on your provided IP address for SIP trunks. So we are peered, we don’t need any authuser or secret in the trunk config.

that you are sending? and if so, are you sending a caller id that matches one they have listed for you? some sip providers do this as a security measure.

They are looking at the CID, and it is the one assigned to the trunk.

that is coming back from your provider. the outbound caller id you are passing is 8436363398 - is this the phone number they have registered for you?

yes it is.

insecure=very is not correct, that is an old Asterisk command, should be insecure=port,invite

You also should not have the username and insecure options set, I would delete the username since you are authenticating on IP.

Your inbound probably is not actually working correctly. My guess is you have SIP guest on and the call is arriving as a guest.

Do you have a g.729 license? If not you need to remove that CODEC.

you to have?

unless they tell you differently you might not need more thantype=friend
dtmfmode=auto
host=[whatever ip address they give you]
context=from-trunk
disallow=all
allow=ulaw&alaw&gsm
insecure=port,invite
canreinvite=no
you have need something about nat depending on your network setup - but the key is to take your lead from them. i prefer ip authentication but it does require more firewall setup than registration.
i would run tcpdmp, make a couple of call attempts and then look at the call flow with wireshark - t should be clear where it is breaking.

I don’t think allowing GSM is a good idea. Most provider that a ways don’t permit it. You only need alaw if you are calling international.

left over garbage…it is late…

Now it’s late :slight_smile:

Just trying to keep from adding more confusion.