to virus_net
Вот мой диалплан, да использую переменную TRANSFER_CONTEXT и ловлю именно в from-phones
Код: Выделить всё
[office]
exten => _10XX,1,NoOp(call from ${CALLERID(all)} to ${EXTEN})
same => n,Set(__TRANSFER_CONTEXT=from-phones)
same => n,Dial(SIP/${EXTEN},60,Tt)
same => n,ExecIf($[${LEN(${BLINDTRANSFER})}>0]?Dial(${BLINDTRANSFER:0:$[${LEN(${BLINDTRANSFER})}-9]}))
same => n,Hangup
[from-phones]
include => office
include => gorod
[gorod]
exten => _8XXXXXXXXXX,1,NoOp
same => n,Set(MONITOR_FILENAME=${STRFTIME(${EPOCH},,%Y%m%d_%H%M%S)}_${CALLERID(num)}_out_${EXTEN})
same => n,MixMonitor(${CALLRECDIR}/${STRFTIME(${EPOCH},,%Y%m%d)}/${MONITOR_FILENAME}.wav,b)
same => n,Set(CDR(userfield)=out)
same => n,Ringing
same => n,Dial(SIP/prov/${EXTEN})
same => n,Hangup
exten => h,1,Set(mytransf2=${TRANSFERERNAME})
exten => h,n,DumpChan()
exten => h,n,Set(mytransf=${BLINDTRANSFER})
exten => h,n,GotoIf($[${LEN(${mytransf})} >= 1]?norec)
exten => h,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?answer)
exten => h,n,Set(var=${CDR(src)})
exten => h,n,Hangup
exten => h,n(answer),StopMixMonitor
exten => h,n,System(php /bin/rec.php ${MONITOR_FILENAME} ${var})
exten => h,n(norec),NoOp(===No Stop Rec===)