Flows Dialers v5
VoiceBroadCast
exten=> _X.,1,Set(CHANNEL(Language)=es)
exten=> _X.,2,Answer(5)
exten=> _X.,3,Set(CALLERID(num)=${EXTEN})
exten=> _X.,4,Set(CALLERID(name)=${CDR(campaign)})
exten=> _X.,5,Set(__dialed=${EXTEN})
exten=> _X.,6,Set(__REALDIALED=${EXTEN})
exten=> _X.,7,Playback(${sound},)
exten=> _X.,8,Read(__confirma,IVRDemoDesicion,1,,1,5)
exten=> _X.,9,GotoIf($["${confirma}" = "1"]?12:10)
exten=> _X.,10,GotoIf($["${confirma}" = "2"]?7:11)
exten=> _X.,11,Hangup()
exten=> _X.,12,GUID(__guid)
exten=> _X.,13,Set(CDR(guid)=${guid})
exten=> _X.,14,Set(CDR(campaign)=${CDR(campaign)})
exten=> _X.,15,Set(MONITOR_FILENAME=${guid})
exten=> _X.,16,Set(__Ani=${EXTEN})
exten=> _X.,17,Set(CDR(type)=record)
exten=> _X.,18,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten=> _X.,19,SipAddHeader(CTI: {"Guid": "${guid}" , "Screen": "FALSE" , "Form": "${FORM}" , "Campaign" : "${CDR(campaign)}" , "Callerid" : "${CALLERID(num)}" , "ParAndValues" : "${PARAVAL}" , "Beep" : "TRUE" , "Answer" : "TRUE" , "Dialer" : "${DIALERRECORD}"})
exten=> _X.,20,Queue(${VBQUEUE},TtKk,,,600,,,,,)
exten=> _X.,21,Goto(VoiceBroadCast,${EXTEN},11)
exten=> h,1,Set(HASH(rates)=${ODBC_Data(select rates.gateway\, rates.rate\, rates.cost\, rates.note FROM rates LEFT JOIN provider ON provider.name=rates.gateway WHERE provider.status = 'true' AND substring( '${EXTEN}'\, 1\, length( prefix_regexp ) ) REGEXP prefix_regexp ORDER BY length(prefix_regexp) DESC\,rates.rate ASC)})
exten=> h,2,Set(talkedminutes=${MATH(${CDR(billsec)} / 60,f)})
exten=> h,3,Set(talkedminutes=$[CEIL(${talkedminutes})])
exten=> h,4,Set(chargedbalance=${MATH(${talkedminutes} * ${HASH(rates,rate)},f)})
exten=> h,5,Set(realbalance=${MATH(${talkedminutes} * ${HASH(rates,cost)},f)})
exten=> h,6,Set(CDR(charged_balance)=${chargedbalance})
exten=> h,7,Set(CDR(real_balance)=${realbalance})
exten=> h,8,Set(CDR(note)=${HASH(rates,note)})
exten=> h,9,Set(CDR(carrier)=${HASH(rates,gateway)})
exten=> h,10,Set(CDR(userfield)=${userfield})
exten=> h,11,Set(CDR(direction)=outgoing)
exten=> h,12,Set(CDR(causecode)=${HANGUPCAUSE})
exten=> h,13,Hangup()
Progressive, Preview
exten=> _X.,1,Set(VOLUME(TX)=2)
exten=> _X.,2,Set(VOLUME(RX)=2)
exten=> _X.,3,Set(__OUTQUEUE=${CDR(campaign)})
exten=> _X.,4,Set(__DIALED=${EXTEN})
exten=> _X.,5,Set(__AGENT=${OUTAGENT})
exten=> _X.,6,Set(__guid=${OUTGUID})
exten=> _X.,7,Set(CALLERID(num)=${OUTDID})
exten=> _X.,8,Set(CALLERID(name-pres)=${CALLERPRESS})
exten=> _X.,9,Set(dummy=${ODBC_Data(UPDATE calls_spool set status =0\, retries = retries + 1 WHERE contact = ${CDR(contact)} AND destination = '${EXTEN}')})
exten=> _X.,10,Set(CDR(guid)=${guid})
exten=> _X.,11,Set(CDR(type)=record)
exten=> _X.,12,MixMonitor(${guid}.gsm,b,)
exten=> _X.,13,Set(CDR(accountcode)=${AGENT})
exten=> _X.,14,Set(__idLlamada=${guid})
exten=> _X.,15,Set(__REALDIALED=${EXTEN})
exten=> _X.,16,Dial(${DIALSTRING:0:-1}/${EXTEN},30,TtKkc,)
exten=> _X.,17,Set(CDR(causecode)=${HANGUPCAUSE})
exten=> _X.,18,NoOp(${DIALSTATUS} - ${HASH(SIP_CAUSE,${CDR(dstchannel)})} - ${HANGUPCAUSE})
exten=> _X.,19,Hangup()
exten=> h,1,Set(HASH(rates)=${ODBC_Data(select rates.gateway\, rates.rate\, rates.cost\, rates.note FROM rates LEFT JOIN provider ON provider.name=rates.gateway WHERE provider.status = 'true' AND substring( '${EXTEN}'\, 1\, length( prefix_regexp ) ) REGEXP prefix_regexp ORDER BY length(prefix_regexp) DESC\,rates.rate ASC)})
exten=> h,2,Set(talkedminutes=${MATH(${CDR(billsec)} / 60,f)})
exten=> h,3,Set(talkedminutes=$[CEIL(${talkedminutes})])
exten=> h,4,Set(chargedbalance=${MATH(${talkedminutes} * ${HASH(rates,rate)},f)})
exten=> h,5,Set(realbalance=${MATH(${talkedminutes} * ${HASH(rates,cost)},f)})
exten=> h,6,Set(CDR(charged_balance)=${chargedbalance})
exten=> h,7,Set(CDR(real_balance)=${realbalance})
exten=> h,8,Set(CDR(note)=${HASH(rates,note)})
exten=> h,9,Set(CDR(carrier)=${HASH(rates,gateway)})
exten=> h,10,Set(CDR(userfield)=${userfield})
exten=> h,11,Set(CDR(direction)=outgoing)
exten=> h,12,Set(CDR(causecode)=${HANGUPCAUSE})
exten=> h,13,QueueUpdate(${OUTQUEUE},${UNIQUEID},${AGENT},${DIALSTATUS},${ANSWEREDTIME},${DIALEDTIME}|${DIALED}|${IdLlamada}|)
exten=> h,14,Hangup()
PowerDialer, Predictive
exten=> _X.,1,Set(CHANNEL(Language)=es)
exten=> _X.,2,Answer(0)
exten=> _X.,3,Set(CALLERID(num)=${EXTEN})
exten=> _X.,4,Set(CALLERID(name)=${CDR(campaign)})
exten=> _X.,5,Set(__dialed=${EXTEN})
exten=> _X.,6,Set(__REALDIALED=${EXTEN})
exten=> _X.,7,Set(__Ani=${EXTEN})
exten=> _X.,8,GUID(__guid)
exten=> _X.,9,Set(CDR(guid)=${guid})
exten=> _X.,10,Set(CDR(campaign)=${CDR(campaign)})
exten=> _X.,11,Set(MONITOR_FILENAME=${guid})
exten=> _X.,12,Set(CDR(type)=record)
exten=> _X.,13,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten=> _X.,14,SipAddHeader(CTI: {"Guid": "${guid}" , "Screen": "FALSE" , "Form": "${FORM}" , "Campaign" : "${CDR(campaign)}" , "Callerid" : "${CALLERID(num)}" , "ParAndValues" : "${PARAVAL}" , "Beep" : "TRUE" , "Answer" : "TRUE" , "Dialer" : "${DIALERRECORD}"})
exten=> _X.,15,GotoIf($["${am}" = "1"]?18:16)
exten=> _X.,16,Queue(${CDR(campaign)},TtKk,,,600,,,,,)
exten=> _X.,17,Hangup()
exten=> _X.,18,WaitForSilence(1000,,)
exten=> _X.,19,AMD(6000,1500,800,2500,100,50,3,256)
exten=> _X.,20,GotoIf($["${AMDSTATUS}" = "MACHINE"]?21:16)
exten=> _X.,21,Set(__userfield=${AMDSTATUS} - ${AMDCAUSE})
exten=> _X.,22,GotoIf($["${RESPOOL}" = "true"]?24:23)
exten=> _X.,23,Hangup()
exten=> _X.,24,Set(dummy=${ODBC_Data(INSERT INTO calls_spool VALUES(${DIALERRECORD}))})
exten=> _X.,25,Goto(PowerDialer,${EXTEN},23)
exten=> h,1,Set(HASH(rates)=${ODBC_Data(select rates.gateway\, rates.rate\, rates.cost\, rates.note FROM rates LEFT JOIN provider ON provider.name=rates.gateway WHERE provider.status = 'true' AND substring( '${EXTEN}'\, 1\, length( prefix_regexp ) ) REGEXP prefix_regexp ORDER BY length(prefix_regexp) DESC\,rates.rate ASC)})
exten=> h,2,Set(talkedminutes=${MATH(${CDR(billsec)} / 60,f)})
exten=> h,3,Set(talkedminutes=$[CEIL(${talkedminutes})])
exten=> h,4,Set(chargedbalance=${MATH(${talkedminutes} * ${HASH(rates,rate)},f)})
exten=> h,5,Set(realbalance=${MATH(${talkedminutes} * ${HASH(rates,cost)},f)})
exten=> h,6,Set(CDR(charged_balance)=${chargedbalance})
exten=> h,7,Set(CDR(real_balance)=${realbalance})
exten=> h,8,Set(CDR(note)=${HASH(rates,note)})
exten=> h,9,Set(CDR(carrier)=${HASH(rates,gateway)})
exten=> h,10,Set(CDR(userfield)=${userfield})
exten=> h,11,Set(CDR(direction)=outgoing)
exten=> h,12,Set(CDR(causecode)=${HANGUPCAUSE})
exten=> h,13,Hangup()