No Audio with SIPSTATION and SIP/PJSIP configured

I’ve been struggling to get this working solid for a few weeks now. It works once in a while and then other times it doesn’t. I can’t nail down what I’m doing wrong.

So this is a fresh install of FreePBX 13 on 192.168.0.50
Firewall/Router has port 5060 and 10000-20000 open to the PBX
FreePBX firewall is disabled.

SIP listening to 5061 and PJSIP on 5060

I’m using SIPSTATION for my trunks

The Firewall test on sip station passes.

On the general SIP settings I verified that the external IP is correct as well as the internal network range and RTP range.

The CHANSIP settings have NAT set to YES and the IP Config is using the external IP (also tried using the public ip setting without any change in performance)

The PJSIP CHAN also has the eternal IP address and local network address entered correctly.

When I dial out from this system into another freePBX It rings once and than hangs up:

 Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/fpbx-1-ZngagTqK5mNz/9729529205
    -- SIP/fpbx-1-ZngagTqK5mNz-00000013 is ringing
    -- SIP/fpbx-1-ZngagTqK5mNz-00000013 is making progress passing it to SIP/1001-00000012
    -- SIP/fpbx-1-ZngagTqK5mNz-00000013 redirecting info has changed, passing it to SIP/1001-00000012
    -- SIP/fpbx-1-ZngagTqK5mNz-00000013 is busy
  == Everyone is busy/congested at this time (1:1/0/0)
    -- Executing [s@macro-dialout-trunk:24] NoOp("SIP/1001-00000012", "Dial failed for some reason with DIALSTATUS = BUSY and HANGUPCAUSE = 19") in new stack
    -- Executing [s@macro-dialout-trunk:25] GotoIf("SIP/1001-00000012", "0?continue,1:s-BUSY,1") in new stack
    -- Goto (macro-dialout-trunk,s-BUSY,1)
    -- Executing [s-BUSY@macro-dialout-trunk:1] NoOp("SIP/1001-00000012", "Dial failed due to trunk reporting BUSY - giving up") in new stack
    -- Executing [s-BUSY@macro-dialout-trunk:2] PlayTones("SIP/1001-00000012", "busy") in new stack
    -- Executing [s-BUSY@macro-dialout-trunk:3] Busy("SIP/1001-00000012", "20") in new stack
  == Spawn extension (macro-dialout-trunk, s-BUSY, 3) exited non-zero on 'SIP/1001-00000012' in macro 'dialout-trunk'
  == Spawn extension (restrictedroute-426ce6f8feb7acb896953e90e72870a3, 9729529205, 6) exited non-zero on 'SIP/1001-00000012'
    -- Executing [h@restrictedroute-426ce6f8feb7acb896953e90e72870a3:1] Hangup("SIP/1001-00000012", "") in new stack
  == Spawn extension (restrictedroute-426ce6f8feb7acb896953e90e72870a3, h, 1) exited non-zero on 'SIP/1001-00000012'

If I dial into the system I get a failure but don’t even see the call come into the FreePBX. I’m completely confused.
If i dial from the system to my cell phone the call completes but no audio, If i hand up one end the other hangs up too. If I try and dial in from my cell phone to the system I get an “invalid number” but the DID is correct.

The few times i’ve gotten it to work usually involved changing the CHANSIP external ip from public to static, back and forth a few times and then at some point it would work and I just won’t touch it afterwards. That hasn’t fixed it lately though. Ideas anyone?

Works sometimes and doesn’t work sometimes (in my experience) is always a Firewall or Fail2Ban error.

Check your SIPStation port (coming back to you) and double-check the port. If they are trying to talk to your 5060 port, you need to concentrate on PJ-SIP. If they are talking to port 5061, you need to concentrate on Chan-SIP. If they are talking to port 5061, you need to make sure your firewall passes that in.

Don’t add a bunch of extra complexity by troubleshooting something that isn’t part of the problem.

You have a restricted route set up. Did you do that on purpose, and if so, could that be part of your problem?

The restricted route was configured by the auto-generate of sipstation. So far after wiping the keys and reinstalling the activation keys I’m now able to receive calls with audio but if I place calls i’m not able to hear or I get immediately disconnected after 1 ring. Here is a test cal to 933. I noticed that SIPSTATION hadn’t assigned an outgoing caller id. I entered my DID as the outgoing caller ID after this call but that call also didn’t work. I could call myself but not hear anything.

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [933@from-internal:1] Macro("SIP/1001-00000001", "user-callerid,LIMIT") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/1001-00000001", "TOUCH_MONITOR=1462826099.1") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/1001-00000001", "AMPUSER=1001") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/1001-00000001", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/1001-00000001", "1?Set(REALCALLERIDNUM=1001)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/1001-00000001", "AMPUSER=1001") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/1001-00000001", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/1001-00000001", "AMPUSERCIDNAME=Ext 1001") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/1001-00000001", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/1001-00000001", "AMPUSERCID=1001") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/1001-00000001", "__DIAL_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-user-callerid:11] Set("SIP/1001-00000001", "CALLERID(all)="Ext 1001" <1001>") in new stack
    -- Executing [s@macro-user-callerid:12] GotoIf("SIP/1001-00000001", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:13] ExecIf("SIP/1001-00000001", "1?Set(GROUP(concurrency_limit)=1001)") in new stack
    -- Executing [s@macro-user-callerid:14] ExecIf("SIP/1001-00000001", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:15] GotoIf("SIP/1001-00000001", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,29)
    -- Executing [s@macro-user-callerid:29] Set("SIP/1001-00000001", "CALLERID(number)=1001") in new stack
    -- Executing [s@macro-user-callerid:30] Set("SIP/1001-00000001", "CALLERID(name)=Ext 1001") in new stack
    -- Executing [s@macro-user-callerid:31] Set("SIP/1001-00000001", "CDR(cnum)=1001") in new stack
    -- Executing [s@macro-user-callerid:32] Set("SIP/1001-00000001", "CDR(cnam)=Ext 1001") in new stack
    -- Executing [s@macro-user-callerid:33] Set("SIP/1001-00000001", "CHANNEL(language)=en") in new stack
    -- Executing [s@macro-user-callerid:34] ExecIf("SIP/1001-00000001", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:35] GosubIf("SIP/1001-00000001", "0?app-check-classofservce,s,1()") in new stack
    -- Executing [933@from-internal:2] Set("SIP/1001-00000001", "ROUTEUSER=1001") in new stack
    -- Executing [933@from-internal:3] GotoIf("SIP/1001-00000001", "1?notblind") in new stack
    -- Goto (from-internal,933,6)
    -- Executing [933@from-internal:6] GotoIf("SIP/1001-00000001", "1?restrictedroute-5efd141b93064d7d416f239d0d5472d1,933,2:outbound-allroutes,933,2") in new stack
    -- Goto (restrictedroute-5efd141b93064d7d416f239d0d5472d1,933,2)
    -- Executing [933@restrictedroute-5efd141b93064d7d416f239d0d5472d1:2] Gosub("SIP/1001-00000001", "sub-record-check,s,1(out,933,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("SIP/1001-00000001", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("SIP/1001-00000001", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("SIP/1001-00000001", "NOW=1462826099") in new stack
    -- Executing [s@sub-record-check:4] Set("SIP/1001-00000001", "__DAY=09") in new stack
    -- Executing [s@sub-record-check:5] Set("SIP/1001-00000001", "__MONTH=05") in new stack
    -- Executing [s@sub-record-check:6] Set("SIP/1001-00000001", "__YEAR=2016") in new stack
    -- Executing [s@sub-record-check:7] Set("SIP/1001-00000001", "__TIMESTR=20160509-153459") in new stack
    -- Executing [s@sub-record-check:8] Set("SIP/1001-00000001", "__FROMEXTEN=1001") in new stack
    -- Executing [s@sub-record-check:9] Set("SIP/1001-00000001", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("SIP/1001-00000001", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("SIP/1001-00000001", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("SIP/1001-00000001", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("SIP/1001-00000001", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("SIP/1001-00000001", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("SIP/1001-00000001", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("SIP/1001-00000001", "Outbound Recording Check from 1001 to 933") in new stack
    -- Executing [out@sub-record-check:2] Set("SIP/1001-00000001", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("SIP/1001-00000001", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("SIP/1001-00000001", "recordcheck,1(dontcare,out,933)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/1001-00000001", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("SIP/1001-00000001", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("SIP/1001-00000001", "") in new stack
    -- Executing [out@sub-record-check:8] Return("SIP/1001-00000001", "") in new stack
    -- Executing [933@restrictedroute-5efd141b93064d7d416f239d0d5472d1:3] ExecIf("SIP/1001-00000001", "0 ?Set(CDR(accountcode)=)") in new stack
    -- Executing [933@restrictedroute-5efd141b93064d7d416f239d0d5472d1:4] Set("SIP/1001-00000001", "EMERGENCYROUTE=YES") in new stack
    -- Executing [933@restrictedroute-5efd141b93064d7d416f239d0d5472d1:5] Set("SIP/1001-00000001", "MOHCLASS=default") in new stack
    -- Executing [933@restrictedroute-5efd141b93064d7d416f239d0d5472d1:6] Set("SIP/1001-00000001", "_NODEST=") in new stack
    -- Executing [933@restrictedroute-5efd141b93064d7d416f239d0d5472d1:7] Macro("SIP/1001-00000001", "dialout-trunk,3,933,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/1001-00000001", "DIAL_TRUNK=3") in new stack
    -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/1001-00000001", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/1001-00000001", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:4] Set("SIP/1001-00000001", "DIAL_NUMBER=933") in new stack
    -- Executing [s@macro-dialout-trunk:5] Set("SIP/1001-00000001", "DIAL_TRUNK_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/1001-00000001", "OUTBOUND_GROUP=OUT_3") in new stack
    -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/1001-00000001", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,9)
    -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/1001-00000001", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:10] Set("SIP/1001-00000001", "DIAL_TRUNK_OPTIONS=Tt") in new stack
    -- Executing [s@macro-dialout-trunk:11] Macro("SIP/1001-00000001", "outbound-callerid,3") in new stack
    -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/1001-00000001", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/1001-00000001", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:3] ExecIf("SIP/1001-00000001", "0?Set(REALCALLERIDNUM=1001)") in new stack
    -- Executing [s@macro-outbound-callerid:4] GotoIf("SIP/1001-00000001", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,7)
    -- Executing [s@macro-outbound-callerid:7] Set("SIP/1001-00000001", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("SIP/1001-00000001", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:9] Set("SIP/1001-00000001", "TRUNKOUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:10] GotoIf("SIP/1001-00000001", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,15)
    -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/1001-00000001", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:16] ExecIf("SIP/1001-00000001", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:17] ExecIf("SIP/1001-00000001", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:18] ExecIf("SIP/1001-00000001", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:19] ExecIf("SIP/1001-00000001", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:20] Set("SIP/1001-00000001", "CDR(outbound_cnum)=1001") in new stack
    -- Executing [s@macro-outbound-callerid:21] Set("SIP/1001-00000001", "CDR(outbound_cnam)=Ext 1001") in new stack
    -- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/1001-00000001", "0?sub-flp-3,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:13] Set("SIP/1001-00000001", "OUTNUM=933") in new stack
    -- Executing [s@macro-dialout-trunk:14] Set("SIP/1001-00000001", "custom=SIP/fpbx-1-ZngagTqK5mNz") in new stack
    -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/1001-00000001", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Tt)") in new stack
    -- Executing [s@macro-dialout-trunk:16] ExecIf("SIP/1001-00000001", "0?Set(DIAL_TRUNK_OPTIONS=TtM(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:17] Macro("SIP/1001-00000001", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/1001-00000001", "") in new stack
    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/1001-00000001", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:19] ExecIf("SIP/1001-00000001", "1?Set(CONNECTEDLINE(num,i)=933)") in new stack
    -- Executing [s@macro-dialout-trunk:20] ExecIf("SIP/1001-00000001", "1?Set(CONNECTEDLINE(name,i)=CID:1001)") in new stack
    -- Executing [s@macro-dialout-trunk:21] ExecIf("SIP/1001-00000001", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)1001)") in new stack
    -- Executing [s@macro-dialout-trunk:22] GotoIf("SIP/1001-00000001", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:23] Dial("SIP/1001-00000001", "SIP/fpbx-1-ZngagTqK5mNz/933,300,Tt") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/fpbx-1-ZngagTqK5mNz/933
    -- SIP/fpbx-1-ZngagTqK5mNz-00000002 answered SIP/1001-00000001
    -- Channel SIP/fpbx-1-ZngagTqK5mNz-00000002 joined 'simple_bridge' basic-bridge <9905b454-2fc3-467d-9061-e72487c47931>
    -- Channel SIP/1001-00000001 joined 'simple_bridge' basic-bridge <9905b454-2fc3-467d-9061-e72487c47931>
       > 0x7f8b400200b0 -- Probation passed - setting RTP source address to 192.168.0.108:12100
    -- Channel SIP/1001-00000001 left 'simple_bridge' basic-bridge <9905b454-2fc3-467d-9061-e72487c47931>
    -- Channel SIP/fpbx-1-ZngagTqK5mNz-00000002 left 'simple_bridge' basic-bridge <9905b454-2fc3-467d-9061-e72487c47931>
  == Spawn extension (macro-dialout-trunk, s, 23) exited non-zero on 'SIP/1001-00000001' in macro 'dialout-trunk'
  == Spawn extension (restrictedroute-5efd141b93064d7d416f239d0d5472d1, 933, 7) exited non-zero on 'SIP/1001-00000001'
    -- Executing [h@restrictedroute-5efd141b93064d7d416f239d0d5472d1:1] Hangup("SIP/1001-00000001", "") in new stack
  == Spawn extension (restrictedroute-5efd141b93064d7d416f239d0d5472d1, h, 1) exited non-zero on 'SIP/1001-00000001'

To eliminate the firewall possibility I wired an external IP directly to the PBX,

was able to place and receive calls via sip station
audio was find on incoming calls but outgoing still had no audio

I disabled the trunks and set the up on a soft phone client using the same SIPSTATION account with the same results. I could get incoming calls and audio but outgoing calls had no audio

I signed up for a trial account of sip station ( the other account was a full paid account) and with the trial account i was able to place and receive calls on both the PBX and the soft phone.

not sure what i could be doing wrong.