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 [400@from-internal:1] Set("SIP/411-000000c8", "__RINGTIMER=60") in new stack
    -- Executing [400@from-internal:2] Macro("SIP/411-000000c8", "exten-vm,novm,400,0,0,0") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("SIP/411-000000c8", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/411-000000c8", "TOUCH_MONITOR=1428418520.1387") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/411-000000c8", "AMPUSER=411") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/411-000000c8", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/411-000000c8", "1?Set(REALCALLERIDNUM=411)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/411-000000c8", "AMPUSER=411") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/411-000000c8", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/411-000000c8", "AMPUSERCIDNAME=User") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/411-000000c8", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/411-000000c8", "AMPUSERCID=411") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/411-000000c8", "__DIAL_OPTIONS=Ttm") in new stack
    -- Executing [s@macro-user-callerid:11] Set("SIP/411-000000c8", "CALLERID(all)="User" <411>") in new stack
    -- Executing [s@macro-user-callerid:12] GotoIf("SIP/411-000000c8", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:13] ExecIf("SIP/411-000000c8", "0?Set(GROUP(concurrency_limit)=411)") in new stack
    -- Executing [s@macro-user-callerid:14] GosubIf("SIP/411-000000c8", "7?sub-ccss,s,1(macro-exten-vm,400)") in new stack
    -- Executing [s@sub-ccss:1] ExecIf("SIP/411-000000c8", "0?Return()") in new stack
    -- Executing [s@sub-ccss:2] Set("SIP/411-000000c8", "CCSS_SETUP=TRUE") in new stack
    -- Executing [s@sub-ccss:3] GosubIf("SIP/411-000000c8", "0?monitor_config,1(macro-exten-vm,400):monitor_default,1(macro-exten-vm,400)") in new stack
    -- Executing [monitor_default@sub-ccss:1] GotoIf("SIP/411-000000c8", "1?is_exten") in new stack
    -- Goto (sub-ccss,monitor_default,5)
    -- Executing [monitor_default@sub-ccss:5] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_monitor_policy)=generic") in new stack
    -- Executing [monitor_default@sub-ccss:6] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_max_monitors)=5") in new stack
    -- Executing [monitor_default@sub-ccss:7] Return("SIP/411-000000c8", "TRUE") in new stack
    -- Executing [s@sub-ccss:4] GosubIf("SIP/411-000000c8", "7?agent_config,1():agent_default,1()") in new stack
    -- Executing [agent_config@sub-ccss:1] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_agent_policy)=generic") in new stack
    -- Executing [agent_config@sub-ccss:2] Set("SIP/411-000000c8", "CALLCOMPLETION(cc_offer_timer)=30") in new stack
    -- Executing [agent_config@sub-ccss:3] Set("SIP/411-000000c8", "CALLCOMPLETION(ccbs_available_timer)=") in new stack
    -- Executing [agent_config@sub-ccss:4] Set("SIP/411-000000c8", "CALLCOMPLETION(ccnr_available_timer)=") in new stack
    -- Executing [agent_config@sub-ccss: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 [agent_config@sub-ccss:6] ExecIf("SIP/411-000000c8", "1?Set(CALLCOMPLETION(cc_recall_timer)=)") in new stack
    -- Executing [agent_config@sub-ccss:7] ExecIf("SIP/411-000000c8", "1?Set(CALLCOMPLETION(cc_max_agents)=)") in new stack
    -- Executing [agent_config@sub-ccss:8] ExecIf("SIP/411-000000c8", "0?Set(CALLCOMPLETION(cc_agent_dialstring)=Local/411_400@from-ccss-)") in new stack
    -- Executing [agent_config@sub-ccss: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 [agent_config@sub-ccss:10] Return("SIP/411-000000c8", "") in new stack
    -- Executing [s@sub-ccss:5] Set("SIP/411-000000c8", "DB(AMPUSER/411/ccss/last_number)=400") in new stack
    -- Executing [s@sub-ccss:6] Return("SIP/411-000000c8", "") in new stack
    -- Executing [s@macro-user-callerid:15] GotoIf("SIP/411-000000c8", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:16] ExecIf("SIP/411-000000c8", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
    -- Executing [s@macro-user-callerid:17] Set("SIP/411-000000c8", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:18] GotoIf("SIP/411-000000c8", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,29)
    -- Executing [s@macro-user-callerid:29] Set("SIP/411-000000c8", "CALLERID(number)=411") in new stack
    -- Executing [s@macro-user-callerid:30] Set("SIP/411-000000c8", "CALLERID(name)=user") in new stack
    -- Executing [s@macro-user-callerid:31] Set("SIP/411-000000c8", "CDR(cnum)=411") in new stack
    -- Executing [s@macro-user-callerid:32] Set("SIP/411-000000c8", "CDR(cnam)=user") in new stack
    -- Executing [s@macro-user-callerid:33] Set("SIP/411-000000c8", "CHANNEL(language)=ru") in new stack
    -- Executing [s@macro-exten-vm:2] Set("SIP/411-000000c8", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("SIP/411-000000c8", "__EXTTOCALL=400") in new stack
    -- Executing [s@macro-exten-vm:4] Set("SIP/411-000000c8", "__PICKUPMARK=400") in new stack
    -- Executing [s@macro-exten-vm:5] Set("SIP/411-000000c8", "RT=") in new stack
    -- Executing [s@macro-exten-vm:6] Gosub("SIP/411-000000c8", "sub-record-check,s,1(exten,400,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("SIP/411-000000c8", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("SIP/411-000000c8", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("SIP/411-000000c8", "NOW=1428418520") in new stack
    -- Executing [s@sub-record-check:4] Set("SIP/411-000000c8", "__DAY=07") in new stack
    -- Executing [s@sub-record-check:5] Set("SIP/411-000000c8", "__MONTH=04") in new stack
    -- Executing [s@sub-record-check:6] Set("SIP/411-000000c8", "__YEAR=2015") in new stack
    -- Executing [s@sub-record-check:7] Set("SIP/411-000000c8", "__TIMESTR=20150407-175520") in new stack
    -- Executing [s@sub-record-check:8] Set("SIP/411-000000c8", "__FROMEXTEN=411") in new stack
    -- Executing [s@sub-record-check:9] Set("SIP/411-000000c8", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("SIP/411-000000c8", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("SIP/411-000000c8", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("SIP/411-000000c8", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("SIP/411-000000c8", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("SIP/411-000000c8", "5?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("SIP/411-000000c8", "1?sub-record-check,exten,1") in new stack
    -- Goto (sub-record-check,exten,1)
    -- Executing [exten@sub-record-check:1] NoOp("SIP/411-000000c8", "Exten Recording Check between 411 and 400") in new stack
    -- Executing [exten@sub-record-check:2] Set("SIP/411-000000c8", "CALLTYPE=internal") in new stack
    -- Executing [exten@sub-record-check:3] ExecIf("SIP/411-000000c8", "0?Set(CALLTYPE=)") in new stack
    -- Executing [exten@sub-record-check:4] Set("SIP/411-000000c8", "CALLEE=force") in new stack
    -- Executing [exten@sub-record-check:5] ExecIf("SIP/411-000000c8", "0?Set(CALLEE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:6] GotoIf("SIP/411-000000c8", "0?callee") in new stack
    -- Executing [exten@sub-record-check:7] GotoIf("SIP/411-000000c8", "0?caller") in new stack
    -- Executing [exten@sub-record-check:8] ExecIf("SIP/411-000000c8", "2?Set(CALLER_PRI=10):Set(CALLER_PRI=0)") in new stack
    -- Executing [exten@sub-record-check:9] ExecIf("SIP/411-000000c8", "2?Set(CALLEE_PRI=10):Set(CALLEE_PRI=0)") in new stack
    -- Executing [exten@sub-record-check:10] GotoIf("SIP/411-000000c8", "1?caller:callee") in new stack
    -- Goto (sub-record-check,exten,13)
    -- Executing [exten@sub-record-check:13] Set("SIP/411-000000c8", "RECMODE=force") in new stack
    -- Executing [exten@sub-record-check:14] ExecIf("SIP/411-000000c8", "0?Set(RECMODE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:15] ExecIf("SIP/411-000000c8", "0?Set(RECMODE=force)") in new stack
    -- Executing [exten@sub-record-check:16] Gosub("SIP/411-000000c8", "recordcheck,1(force,internal,400)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/411-000000c8", "Starting recording check against force") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("SIP/411-000000c8", "force") in new stack
    -- Goto (sub-record-check,recordcheck,5)
    -- Executing [recordcheck@sub-record-check:5] Set("SIP/411-000000c8", "__REC_POLICY_MODE=FORCE") in new stack
    -- Executing [recordcheck@sub-record-check:6] GotoIf("SIP/411-000000c8", "1?startrec") in new stack
    -- Goto (sub-record-check,recordcheck,16)
    -- Executing [recordcheck@sub-record-check:16] NoOp("SIP/411-000000c8", "Starting recording: internal, 400") in new stack
    -- Executing [recordcheck@sub-record-check:17] Set("SIP/411-000000c8", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack
    -- Executing [recordcheck@sub-record-check:18] Set("SIP/411-000000c8", "__CALLFILENAME=internal-400-411-20150407-175520-1428418520.1387") in new stack
    -- Executing [recordcheck@sub-record-check: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 [recordcheck@sub-record-check:20] Set("SIP/411-000000c8", "__MIXMON_ID=0x7ff7fc1a1f20") in new stack
    -- Executing [recordcheck@sub-record-check:21] Set("SIP/411-000000c8", "__RECORD_ID=SIP/411-000000c8") in new stack
    -- Executing [recordcheck@sub-record-check:22] Set("SIP/411-000000c8", "__REC_STATUS=RECORDING") in new stack
    -- Executing [recordcheck@sub-record-check:23] Set("SIP/411-000000c8", "CDR(recordingfile)=internal-400-411-20150407-175520-1428418520.1387.wav") in new stack
    -- Executing [recordcheck@sub-record-check:24] Return("SIP/411-000000c8", "") in new stack
    -- Executing [exten@sub-record-check:17] Return("SIP/411-000000c8", "") in new stack
    -- Executing [s@macro-exten-vm:7] GotoIf("SIP/411-000000c8", "1?macrodial") in new stack
    -- Goto (macro-exten-vm,s,13)
    -- Executing [s@macro-exten-vm:13] GosubIf("SIP/411-000000c8", "0?clrheader,1()") in new stack
    -- Executing [s@macro-exten-vm:14] Macro("SIP/411-000000c8", "dial-one,,Ttm,400") in new stack
    -- Executing [s@macro-dial-one:1] Set("SIP/411-000000c8", "DEXTEN=400") in new stack
    -- Executing [s@macro-dial-one:2] Set("SIP/411-000000c8", "DIALSTATUS_CW=") in new stack
    -- Executing [s@macro-dial-one:3] GosubIf("SIP/411-000000c8", "0?screen,1()") in new stack
    -- Executing [s@macro-dial-one:4] GosubIf("SIP/411-000000c8", "0?cf,1()") in new stack
    -- Executing [s@macro-dial-one:5] GotoIf("SIP/411-000000c8", "1?skip1") in new stack
    -- Goto (macro-dial-one,s,8)
    -- Executing [s@macro-dial-one:8] GotoIf("SIP/411-000000c8", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:9] GotoIf("SIP/411-000000c8", "0?continue") in new stack
    -- Executing [s@macro-dial-one:10] Set("SIP/411-000000c8", "EXTHASCW=ENABLED") in new stack
    -- Executing [s@macro-dial-one:11] GotoIf("SIP/411-000000c8", "0?next1:cwinusebusy") in new stack
    -- Goto (macro-dial-one,s,23)
    -- Executing [s@macro-dial-one:23] GotoIf("SIP/411-000000c8", "1?next3:continue") in new stack
    -- Goto (macro-dial-one,s,24)
    -- Executing [s@macro-dial-one:24] ExecIf("SIP/411-000000c8", "0?Set(DIALSTATUS_CW=BUSY)") in new stack
    -- Executing [s@macro-dial-one:25] GotoIf("SIP/411-000000c8", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:26] GosubIf("SIP/411-000000c8", "1?dstring,1():dlocal,1()") in new stack
    -- Executing [dstring@macro-dial-one:1] Set("SIP/411-000000c8", "DSTRING=") in new stack
    -- Executing [dstring@macro-dial-one:2] Set("SIP/411-000000c8", "DEVICES=400") in new stack
    -- Executing [dstring@macro-dial-one:3] ExecIf("SIP/411-000000c8", "0?Return()") in new stack
    -- Executing [dstring@macro-dial-one:4] ExecIf("SIP/411-000000c8", "0?Set(DEVICES=00)") in new stack
    -- Executing [dstring@macro-dial-one:5] Set("SIP/411-000000c8", "LOOPCNT=1") in new stack
    -- Executing [dstring@macro-dial-one:6] Set("SIP/411-000000c8", "ITER=1") in new stack
    -- Executing [dstring@macro-dial-one:7] Set("SIP/411-000000c8", "THISDIAL=SIP/400,90,m") in new stack
    -- Executing [dstring@macro-dial-one:8] GosubIf("SIP/411-000000c8", "1?zap2dahdi,1()") in new stack
    -- Executing [zap2dahdi@macro-dial-one:1] ExecIf("SIP/411-000000c8", "0?Return()") in new stack
    -- Executing [zap2dahdi@macro-dial-one:2] Set("SIP/411-000000c8", "NEWDIAL=") in new stack
    -- Executing [zap2dahdi@macro-dial-one:3] Set("SIP/411-000000c8", "LOOPCNT2=1") in new stack
    -- Executing [zap2dahdi@macro-dial-one:4] Set("SIP/411-000000c8", "ITER2=1") in new stack
    -- Executing [zap2dahdi@macro-dial-one:5] Set("SIP/411-000000c8", "THISPART2=SIP/400,90,m") in new stack
    -- Executing [zap2dahdi@macro-dial-one:6] ExecIf("SIP/411-000000c8", "0?Set(THISPART2=DAHDI/400,90,m)") in new stack
    -- Executing [zap2dahdi@macro-dial-one:7] Set("SIP/411-000000c8", "NEWDIAL=SIP/400,90,m&") in new stack
    -- Executing [zap2dahdi@macro-dial-one:8] Set("SIP/411-000000c8", "ITER2=2") in new stack
    -- Executing [zap2dahdi@macro-dial-one:9] GotoIf("SIP/411-000000c8", "0?begin2") in new stack
    -- Executing [zap2dahdi@macro-dial-one:10] Set("SIP/411-000000c8", "THISDIAL=SIP/400,90,m") in new stack
    -- Executing [zap2dahdi@macro-dial-one:11] Return("SIP/411-000000c8", "") in new stack
    -- Executing [dstring@macro-dial-one:9] GotoIf("SIP/411-000000c8", "1?doset") in new stack
    -- Goto (macro-dial-one,dstring,12)
    -- Executing [dstring@macro-dial-one:12] Set("SIP/411-000000c8", "DSTRING=SIP/400,90,m&") in new stack
    -- Executing [dstring@macro-dial-one:13] Set("SIP/411-000000c8", "ITER=2") in new stack
    -- Executing [dstring@macro-dial-one:14] GotoIf("SIP/411-000000c8", "0?begin") in new stack
    -- Executing [dstring@macro-dial-one:15] Set("SIP/411-000000c8", "DSTRING=SIP/400,90,m") in new stack
    -- Executing [dstring@macro-dial-one:16] Return("SIP/411-000000c8", "") in new stack
    -- Executing [s@macro-dial-one:27] GotoIf("SIP/411-000000c8", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:28] GotoIf("SIP/411-000000c8", "0?skiptrace") in new stack
    -- Executing [s@macro-dial-one:29] GosubIf("SIP/411-000000c8", "1?ctset,1():ctclear,1()") in new stack
    -- Executing [ctset@macro-dial-one:1] Set("SIP/411-000000c8", "DB(CALLTRACE/400)=411") in new stack
    -- Executing [ctset@macro-dial-one:2] Return("SIP/411-000000c8", "") in new stack
    -- Executing [s@macro-dial-one:30] Set("SIP/411-000000c8", "D_OPTIONS=Ttm") in new stack
    -- Executing [s@macro-dial-one:31] ExecIf("SIP/411-000000c8", "0?SIPAddHeader(Alert-Info: )") in new stack
    -- Executing [s@macro-dial-one:32] ExecIf("SIP/411-000000c8", "0?SIPAddHeader()") in new stack
    -- Executing [s@macro-dial-one:33] ExecIf("SIP/411-000000c8", "0?Set(CHANNEL(musicclass)=)") in new stack
    -- Executing [s@macro-dial-one:34] GosubIf("SIP/411-000000c8", "0?qwait,1()") in new stack
    -- Executing [s@macro-dial-one:35] Set("SIP/411-000000c8", "__CWIGNORE=") in new stack
    -- Executing [s@macro-dial-one:36] Set("SIP/411-000000c8", "__KEEPCID=TRUE") in new stack
    -- Executing [s@macro-dial-one:37] GotoIf("SIP/411-000000c8", "0?usegoto,1") in new stack
    -- Executing [s@macro-dial-one:38] GotoIf("SIP/411-000000c8", "0?godial") in new stack
    -- Executing [s@macro-dial-one: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 [s@sub-presencestate-display:1] Goto("SIP/411-000000c8", "state-,1") in new stack
    -- Goto (sub-presencestate-display,state-,1)
    -- Executing [state-@sub-presencestate-display:1] Set("SIP/411-000000c8", "PRESENCESTATE_DISPLAY=") in new stack
    -- Executing [state-@sub-presencestate-display:2] Return("SIP/411-000000c8", "") in new stack
    -- Executing [s@macro-dial-one:40] Set("SIP/411-000000c8", "CONNECTEDLINE(name,i)=Олег А Котляров") in new stack
    -- Executing [s@macro-dial-one:41] Set("SIP/411-000000c8", "CONNECTEDLINE(num)=400") in new stack
    -- Executing [s@macro-dial-one:42] Set("SIP/411-000000c8", "D_OPTIONS=TtmI") in new stack
    -- Executing [s@macro-dial-one:43] Macro("SIP/411-000000c8", "dialout-one-predial-hook,") in new stack
    -- Executing [s@macro-dialout-one-predial-hook:1] MacroExit("SIP/411-000000c8", "") in new stack
    -- Executing [s@macro-dial-one: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 [h@from-internal: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.