[fax-out]
exten => _0X.,1,NoOp(Placing Fax call for user: ${CALLERID(num)} ${OUTGOINGFAXNUMBER} to exten: ${EXTEN})
exten => _0X.,n,Set(_CALLER=${CALLERID(num)})
exten => _0X.,n,Macro(executeagi,clip.agi?type=external)
exten => _0X.,n,Set(CALLERID(num)=${CLIPNUMBER})
exten => _0X.,n,SipAddHeader(P-Asserted-Identity: <sip:+${USER_E164}@10.106.18.5:5060>)
exten => _0X./_496616000.,n,Macro(dial-out-gatewaygroup,${EXTEN},1,${TOCUT},,${TOPREDIAL})
exten => _0X./_496616000.,n,GotoIf($["${DIALOUT_GATEWAYS_STATUS}" = "OK"]?enddial)
exten => _0X./_496616000.,n(enddial),NoOp(Call ended with status ${DIALOUT_GATEWAYS_STATUS})

[fax_send]
exten => faxout,1,NoOp(**** SENDING FAX ****)
exten => faxout,n,Wait(6)
exten => faxout,n,Set(FAXFILE=${TIFF_2_SEND})
exten => faxout,n,NoOp(**** SETTING FAXOPT ****)
exten => faxout,n,Set(FAXOPT(headerinfo)=${TAGLINE} ${TAGNUMBER})
exten => faxout,n,SET(FAXOPT(localstationid)=${TAGNUMBER})
exten => faxout,n,NoOp(**** SENDING FAX : ${FAXFILE} ****)
exten => faxout,n,SendFAX(/tmp/${FAXFILE},dfzs)
exten => h,1,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})
exten => h,n,NoOp(FAXOPT(filename) : ${FAXOPT(filename)})
exten => h,n,NoOp(FAXOPT(headerinfo) : ${FAXOPT(headerinfo)})
exten => h,n,NoOp(FAXOPT(localstationid) : ${FAXOPT(localstationid)})
exten => h,n,NoOp(FAXOPT(maxrate) : ${FAXOPT(maxrate)})
exten => h,n,NoOp(FAXOPT(minrate) : ${FAXOPT(minrate)})
exten => h,n,NoOp(FAXOPT(pages) : ${FAXOPT(pages)})
exten => h,n,NoOp(FAXOPT(rate) : ${FAXOPT(rate)})
exten => h,n,NoOp(FAXOPT(remotestationid) : ${FAXOPT(remotestationid)})
exten => h,n,NoOp(FAXOPT(resolution) : ${FAXOPT(resolution)})
exten => h,n,NoOp(FAXOPT(status) : ${FAXOPT(status)})
exten => h,n,NoOp(FAXOPT(statusstr) : ${FAXOPT(statusstr)})
exten => h,n,NoOp(FAXOPT(error) : ${FAXOPT(error)})
exten => h,n,NoOp(DNIS: ${RECEIVER})
exten => h,n,Macro(executedeadagi,faxsend-status.agi?filename=${FAXOPT(filename)}&status=${FAXOPT(status)}&statusstr=${FAXOPT(statusstr)}&error=${FAXOPT(error)})

