MOH not playing instead of rings

Hello there.
I have a very strange problem:

  1. The dialing flags are set to “Ttm”
  2. 2 chan_sip extensions + 1 pjsip extension

when i dial sip>sip i hear ringing (but i should hear moh default class)
when i dial pjsip>sip i hear music (normal behavior according to dial flags)

Also I have no “Play record” button in CDR reports (files are present, call list is present, just no play button)

This all happend after i upgraded Asterisk 12 > 13.
Now I’m using:
Asterisk 13.2
FreePbx 12 (latest version, modules updated too)
Ubuntu 14.04
CDRs work with cdr_odbc (MySQL backend)

Here is debug log of SIP > SIP call:

      == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [[email protected]:1] Set("SIP/411-000000c8", "__RINGTIMER=60") in new stack
    -- Executing [[email protected]:2] Macro("SIP/411-000000c8", "exten-vm,novm,400,0,0,0") in new stack
    -- Executing [[email protected]:1] Macro("SIP/411-000000c8", "user-callerid,") in new stack
    -- Executing [[email protected]:1] Set("SIP/411-000000c8", "TOUCH_MONITOR=1428418520.1387") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "AMPUSER=411") in new stack
    -- Executing [[email protected]:3] GotoIf("SIP/411-000000c8", "0?report") in new stack
    -- Executing [[email protected]:4] ExecIf("SIP/411-000000c8", "1?Set(REALCALLERIDNUM=411)") in new stack
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "AMPUSER=411") in new stack
    -- Executing [[email protected]:6] GotoIf("SIP/411-000000c8", "0?limit") in new stack
    -- Executing [[email protected]:7] Set("SIP/411-000000c8", "AMPUSERCIDNAME=User") in new stack
    -- Executing [[email protected]:8] GotoIf("SIP/411-000000c8", "0?report") in new stack
    -- Executing [[email protected]:9] Set("SIP/411-000000c8", "AMPUSERCID=411") in new stack
    -- Executing [[email protected]:10] Set("SIP/411-000000c8", "__DIAL_OPTIONS=Ttm") in new stack
    -- Executing [[email protected]:11] Set("SIP/411-000000c8", "CALLERID(all)="User" <411>") in new stack
    -- Executing [[email protected]:12] GotoIf("SIP/411-000000c8", "0?limit") in new stack
    -- Executing [[email protected]:13] ExecIf("SIP/411-000000c8", "0?Set(GROUP(concurrency_limit)=411)") in new stack
    -- Executing [[email protected]:14] GosubIf("SIP/411-000000c8", "7?sub-ccss,s,1(macro-exten-vm,400)") in new stack
    -- Executing [[email protected]:1] ExecIf("SIP/411-000000c8", "0?Return()") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "CCSS_SETUP=TRUE") in new stack
    -- Executing [[email protected]:3] GosubIf("SIP/411-000000c8", "0?monitor_config,1(macro-exten-vm,400):monitor_default,1(macro-exten-vm,400)") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/411-000000c8", "1?is_exten") in new stack
    -- Goto (sub-ccss,monitor_default,5)
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_monitor_policy)=generic") in new stack
    -- Executing [[email protected]:6] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_max_monitors)=5") in new stack
    -- Executing [[email protected]:7] Return("SIP/411-000000c8", "TRUE") in new stack
    -- Executing [[email protected]:4] GosubIf("SIP/411-000000c8", "7?agent_config,1():agent_default,1()") in new stack
    -- Executing [[email protected]:1] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_agent_policy)=generic") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_offer_timer)=30") in new stack
    -- Executing [[email protected]:3] Set("SIP/411-000000c8", "CALLCOMPLETION(ccbs_available_timer)=") in new stack
    -- Executing [[email protected]:4] Set("SIP/411-000000c8", "CALLCOMPLETION(ccnr_available_timer)=") in new stack
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_callback_macro)=ccss-default") in new stack
[2015-04-07 17:55:20] WARNING[2322][C-00000997]: ccss.c:1012 ast_set_cc_callback_macro: Usage of cc_callback_macro is deprecated.  Please use cc_callback_sub instead.
    -- Executing [[email protected]:6] ExecIf("SIP/411-000000c8", "1?Set(CALLCOMPLETION(cc_recall_timer)=)") in new stack
    -- Executing [[email protected]:7] ExecIf("SIP/411-000000c8", "1?Set(CALLCOMPLETION(cc_max_agents)=)") in new stack
    -- Executing [[email protected]:8] ExecIf("SIP/411-000000c8", "0?Set(CALLCOMPLETION(cc_agent_dialstring)=Local/[email protected])") in new stack
    -- Executing [[email protected]:9] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_callback_macro)=ccss-default") in new stack
[2015-04-07 17:55:20] WARNING[2322][C-00000997]: ccss.c:1012 ast_set_cc_callback_macro: Usage of cc_callback_macro is deprecated.  Please use cc_callback_sub instead.
    -- Executing [[email protected]:10] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "DB(AMPUSER/411/ccss/last_number)=400") in new stack
    -- Executing [[email protected]:6] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:15] GotoIf("SIP/411-000000c8", "0?continue") in new stack
    -- Executing [[email protected]:16] ExecIf("SIP/411-000000c8", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
    -- Executing [[email protected]:17] Set("SIP/411-000000c8", "__TTL=64") in new stack
    -- Executing [[email protected]:18] GotoIf("SIP/411-000000c8", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,29)
    -- Executing [[email protected]:29] Set("SIP/411-000000c8", "CALLERID(number)=411") in new stack
    -- Executing [[email protected]:30] Set("SIP/411-000000c8", "CALLERID(name)=user") in new stack
    -- Executing [[email protected]:31] Set("SIP/411-000000c8", "CDR(cnum)=411") in new stack
    -- Executing [[email protected]:32] Set("SIP/411-000000c8", "CDR(cnam)=user") in new stack
    -- Executing [[email protected]:33] Set("SIP/411-000000c8", "CHANNEL(language)=ru") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "RingGroupMethod=none") in new stack
    -- Executing [[email protected]:3] Set("SIP/411-000000c8", "__EXTTOCALL=400") in new stack
    -- Executing [[email protected]:4] Set("SIP/411-000000c8", "__PICKUPMARK=400") in new stack
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "RT=") in new stack
    -- Executing [[email protected]:6] Gosub("SIP/411-000000c8", "sub-record-check,s,1(exten,400,dontcare)") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/411-000000c8", "0?initialized") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [[email protected]:3] Set("SIP/411-000000c8", "NOW=1428418520") in new stack
    -- Executing [[email protected]:4] Set("SIP/411-000000c8", "__DAY=07") in new stack
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "__MONTH=04") in new stack
    -- Executing [[email protected]:6] Set("SIP/411-000000c8", "__YEAR=2015") in new stack
    -- Executing [[email protected]:7] Set("SIP/411-000000c8", "__TIMESTR=20150407-175520") in new stack
    -- Executing [[email protected]:8] Set("SIP/411-000000c8", "__FROMEXTEN=411") in new stack
    -- Executing [[email protected]:9] Set("SIP/411-000000c8", "__MON_FMT=wav") in new stack
    -- Executing [[email protected]:10] NoOp("SIP/411-000000c8", "Recordings initialized") in new stack
    -- Executing [[email protected]:11] ExecIf("SIP/411-000000c8", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [[email protected]:12] Set("SIP/411-000000c8", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [[email protected]:13] ExecIf("SIP/411-000000c8", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [[email protected]:14] GotoIf("SIP/411-000000c8", "5?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [[email protected]:17] GotoIf("SIP/411-000000c8", "1?sub-record-check,exten,1") in new stack
    -- Goto (sub-record-check,exten,1)
    -- Executing [[email protected]:1] NoOp("SIP/411-000000c8", "Exten Recording Check between 411 and 400") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "CALLTYPE=internal") in new stack
    -- Executing [[email protected]:3] ExecIf("SIP/411-000000c8", "0?Set(CALLTYPE=)") in new stack
    -- Executing [[email protected]:4] Set("SIP/411-000000c8", "CALLEE=force") in new stack
    -- Executing [[email protected]:5] ExecIf("SIP/411-000000c8", "0?Set(CALLEE=dontcare)") in new stack
    -- Executing [[email protected]:6] GotoIf("SIP/411-000000c8", "0?callee") in new stack
    -- Executing [[email protected]:7] GotoIf("SIP/411-000000c8", "0?caller") in new stack
    -- Executing [[email protected]:8] ExecIf("SIP/411-000000c8", "2?Set(CALLER_PRI=10):Set(CALLER_PRI=0)") in new stack
    -- Executing [[email protected]:9] ExecIf("SIP/411-000000c8", "2?Set(CALLEE_PRI=10):Set(CALLEE_PRI=0)") in new stack
    -- Executing [[email protected]:10] GotoIf("SIP/411-000000c8", "1?caller:callee") in new stack
    -- Goto (sub-record-check,exten,13)
    -- Executing [[email protected]:13] Set("SIP/411-000000c8", "RECMODE=force") in new stack
    -- Executing [[email protected]:14] ExecIf("SIP/411-000000c8", "0?Set(RECMODE=dontcare)") in new stack
    -- Executing [[email protected]:15] ExecIf("SIP/411-000000c8", "0?Set(RECMODE=force)") in new stack
    -- Executing [[email protected]:16] Gosub("SIP/411-000000c8", "recordcheck,1(force,internal,400)") in new stack
    -- Executing [[email protected]:1] NoOp("SIP/411-000000c8", "Starting recording check against force") in new stack
    -- Executing [[email protected]:2] Goto("SIP/411-000000c8", "force") in new stack
    -- Goto (sub-record-check,recordcheck,5)
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "__REC_POLICY_MODE=FORCE") in new stack
    -- Executing [[email protected]:6] GotoIf("SIP/411-000000c8", "1?startrec") in new stack
    -- Goto (sub-record-check,recordcheck,16)
    -- Executing [[email protected]:16] NoOp("SIP/411-000000c8", "Starting recording: internal, 400") in new stack
    -- Executing [[email protected]:17] Set("SIP/411-000000c8", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack
    -- Executing [[email protected]:18] Set("SIP/411-000000c8", "__CALLFILENAME=internal-400-411-20150407-175520-1428418520.1387") in new stack
    -- Executing [[email protected]:19]MixMonitor("SIP/411-000000c8","2015/04/07/internal-400-411-20150407-175520-1428418520.1387.wav,ai(LOCAL_MIXMON_ID),") in new stack
  == Begin MixMonitor Recording SIP/411-000000c8
    -- Executing [[email protected]:20] Set("SIP/411-000000c8", "__MIXMON_ID=0x7ff7fc1a1f20") in new stack
    -- Executing [[email protected]:21] Set("SIP/411-000000c8", "__RECORD_ID=SIP/411-000000c8") in new stack
    -- Executing [[email protected]:22] Set("SIP/411-000000c8", "__REC_STATUS=RECORDING") in new stack
    -- Executing [[email protected]:23] Set("SIP/411-000000c8", "CDR(recordingfile)=internal-400-411-20150407-175520-1428418520.1387.wav") in new stack
    -- Executing [[email protected]:24] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:17] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:7] GotoIf("SIP/411-000000c8", "1?macrodial") in new stack
    -- Goto (macro-exten-vm,s,13)
    -- Executing [[email protected]:13] GosubIf("SIP/411-000000c8", "0?clrheader,1()") in new stack
    -- Executing [[email protected]:14] Macro("SIP/411-000000c8", "dial-one,,Ttm,400") in new stack
    -- Executing [[email protected]:1] Set("SIP/411-000000c8", "DEXTEN=400") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "DIALSTATUS_CW=") in new stack
    -- Executing [[email protected]:3] GosubIf("SIP/411-000000c8", "0?screen,1()") in new stack
    -- Executing [[email protected]:4] GosubIf("SIP/411-000000c8", "0?cf,1()") in new stack
    -- Executing [[email protected]:5] GotoIf("SIP/411-000000c8", "1?skip1") in new stack
    -- Goto (macro-dial-one,s,8)
    -- Executing [[email protected]:8] GotoIf("SIP/411-000000c8", "0?nodial") in new stack
    -- Executing [[email protected]:9] GotoIf("SIP/411-000000c8", "0?continue") in new stack
    -- Executing [[email protected]:10] Set("SIP/411-000000c8", "EXTHASCW=ENABLED") in new stack
    -- Executing [[email protected]:11] GotoIf("SIP/411-000000c8", "0?next1:cwinusebusy") in new stack
    -- Goto (macro-dial-one,s,23)
    -- Executing [[email protected]:23] GotoIf("SIP/411-000000c8", "1?next3:continue") in new stack
    -- Goto (macro-dial-one,s,24)
    -- Executing [[email protected]:24] ExecIf("SIP/411-000000c8", "0?Set(DIALSTATUS_CW=BUSY)") in new stack
    -- Executing [[email protected]:25] GotoIf("SIP/411-000000c8", "0?nodial") in new stack
    -- Executing [[email protected]:26] GosubIf("SIP/411-000000c8", "1?dstring,1():dlocal,1()") in new stack
    -- Executing [[email protected]:1] Set("SIP/411-000000c8", "DSTRING=") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "DEVICES=400") in new stack
    -- Executing [[email protected]:3] ExecIf("SIP/411-000000c8", "0?Return()") in new stack
    -- Executing [[email protected]:4] ExecIf("SIP/411-000000c8", "0?Set(DEVICES=00)") in new stack
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "LOOPCNT=1") in new stack
    -- Executing [[email protected]:6] Set("SIP/411-000000c8", "ITER=1") in new stack
    -- Executing [[email protected]:7] Set("SIP/411-000000c8", "THISDIAL=SIP/400,90,m") in new stack
    -- Executing [[email protected]:8] GosubIf("SIP/411-000000c8", "1?zap2dahdi,1()") in new stack
    -- Executing [[email protected]:1] ExecIf("SIP/411-000000c8", "0?Return()") in new stack
    -- Executing [[email protected]:2] Set("SIP/411-000000c8", "NEWDIAL=") in new stack
    -- Executing [[email protected]:3] Set("SIP/411-000000c8", "LOOPCNT2=1") in new stack
    -- Executing [[email protected]:4] Set("SIP/411-000000c8", "ITER2=1") in new stack
    -- Executing [[email protected]:5] Set("SIP/411-000000c8", "THISPART2=SIP/400,90,m") in new stack
    -- Executing [[email protected]:6] ExecIf("SIP/411-000000c8", "0?Set(THISPART2=DAHDI/400,90,m)") in new stack
    -- Executing [[email protected]:7] Set("SIP/411-000000c8", "NEWDIAL=SIP/400,90,m&") in new stack
    -- Executing [[email protected]:8] Set("SIP/411-000000c8", "ITER2=2") in new stack
    -- Executing [[email protected]:9] GotoIf("SIP/411-000000c8", "0?begin2") in new stack
    -- Executing [[email protected]:10] Set("SIP/411-000000c8", "THISDIAL=SIP/400,90,m") in new stack
    -- Executing [[email protected]:11] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:9] GotoIf("SIP/411-000000c8", "1?doset") in new stack
    -- Goto (macro-dial-one,dstring,12)
    -- Executing [[email protected]:12] Set("SIP/411-000000c8", "DSTRING=SIP/400,90,m&") in new stack
    -- Executing [[email protected]:13] Set("SIP/411-000000c8", "ITER=2") in new stack
    -- Executing [[email protected]:14] GotoIf("SIP/411-000000c8", "0?begin") in new stack
    -- Executing [[email protected]:15] Set("SIP/411-000000c8", "DSTRING=SIP/400,90,m") in new stack
    -- Executing [[email protected]:16] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:27] GotoIf("SIP/411-000000c8", "0?nodial") in new stack
    -- Executing [[email protected]:28] GotoIf("SIP/411-000000c8", "0?skiptrace") in new stack
    -- Executing [[email protected]:29] GosubIf("SIP/411-000000c8", "1?ctset,1():ctclear,1()") in new stack
    -- Executing [[email protected]:1] Set("SIP/411-000000c8", "DB(CALLTRACE/400)=411") in new stack
    -- Executing [[email protected]:2] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:30] Set("SIP/411-000000c8", "D_OPTIONS=Ttm") in new stack
    -- Executing [[email protected]:31] ExecIf("SIP/411-000000c8", "0?SIPAddHeader(Alert-Info: )") in new stack
    -- Executing [[email protected]:32] ExecIf("SIP/411-000000c8", "0?SIPAddHeader()") in new stack
    -- Executing [[email protected]:33] ExecIf("SIP/411-000000c8", "0?Set(CHANNEL(musicclass)=)") in new stack
    -- Executing [[email protected]:34] GosubIf("SIP/411-000000c8", "0?qwait,1()") in new stack
    -- Executing [[email protected]:35] Set("SIP/411-000000c8", "__CWIGNORE=") in new stack
    -- Executing [[email protected]:36] Set("SIP/411-000000c8", "__KEEPCID=TRUE") in new stack
    -- Executing [[email protected]:37] GotoIf("SIP/411-000000c8", "0?usegoto,1") in new stack
    -- Executing [[email protected]:38] GotoIf("SIP/411-000000c8", "0?godial") in new stack
    -- Executing [[email protected]:39] Gosub("SIP/411-000000c8", "sub-presencestate-display,s,1(400)") in new stack
[2015-04-07 17:55:20] WARNING[2322][C-00000997]: func_presencestate.c:133 presence_read: PRESENCE_STATE unknown
    -- Executing [[email protected]:1] Goto("SIP/411-000000c8", "state-,1") in new stack
    -- Goto (sub-presencestate-display,state-,1)
    -- Executing [[email protected]:1] Set("SIP/411-000000c8", "PRESENCESTATE_DISPLAY=") in new stack
    -- Executing [[email protected]:2] Return("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:40] Set("SIP/411-000000c8", "CONNECTEDLINE(name,i)=Олег А Котляров") in new stack
    -- Executing [[email protected]:41] Set("SIP/411-000000c8", "CONNECTEDLINE(num)=400") in new stack
    -- Executing [[email protected]:42] Set("SIP/411-000000c8", "D_OPTIONS=TtmI") in new stack
    -- Executing [[email protected]:43] Macro("SIP/411-000000c8", "dialout-one-predial-hook,") in new stack
    -- Executing [[email protected]:1] MacroExit("SIP/411-000000c8", "") in new stack
    -- Executing [[email protected]:44] Dial("SIP/411-000000c8", "SIP/400,90,m,,TtmI") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/400
    -- Started music on hold, class 'default', on channel 'SIP/411-000000c8'
[2015-04-07 17:55:20] WARNING[2322][C-00000997]: translate.c:392 framein: no samples for ulawtolin
    -- SIP/400-000000c9 is ringing
    -- Stopped music on hold on SIP/411-000000c8
  == Spawn extension (macro-dial-one, s, 44) exited non-zero on 'SIP/411-000000c8' in macro 'dial-one'
  == Spawn extension (macro-exten-vm, s, 14) exited non-zero on 'SIP/411-000000c8' in macro 'exten-vm'
  == Spawn extension (from-internal, 400, 2) exited non-zero on 'SIP/411-000000c8'
    -- Executing [[email protected]:1] Hangup("SIP/411-000000c8", "") in new stack
  == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/411-000000c8'
  == MixMonitor close filestream (mixed)
  == End MixMonitor Recording SIP/411-000000c8

Any ideas?

Ok, 30days, no help at all.
Additional information:
Clean install:
Asterisk 13.3.2
FreePBX (12 with all updates)
Same problem.
Also in asteriskcdrdb “recodingfile” field is empty.
On call recordings i hear music, in phone a hear rings.