Change route depending on the status returned from the AGI

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Change route depending on the status returned from the AGI

Postby hanidhakwani » Sat Jan 07, 2023 2:56 am

Hi,
How to recover the status (AA or NA) of the AGI to be able to switch to another voip provider?

Thanks
VERSION: 2.14-752a
BUILD: 200508-1024
© 2020 ViciDial Group
2(DB / WEb ) + 4 (ASTERISK)

VERSION: 2.14-869a
BUILD: 221021-1038
© 2022 ViciDial Group
1(DB / WEb ) + 3 (ASTERISK)
hanidhakwani
 
Posts: 25
Joined: Tue Nov 12, 2019 4:44 am

Re: Change route depending on the status returned from the A

Postby mflorell » Sat Jan 07, 2023 7:16 am

We have had clients do this by using the "No Agent Call URL" to automatically switch the list_id of leads to another list(using the "agc/dispo_move_list.php" script) where the other list had a different "Dial Prefix Override" set at the list level. It's not the most elegant solution, but it does work.
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Change route depending on the status returned from the A

Postby hanidhakwani » Sat Jan 07, 2023 8:08 am

Thank you for your answer, but where can I find "No-Answer Call URL"?
VERSION: 2.14-752a
BUILD: 200508-1024
© 2020 ViciDial Group
2(DB / WEb ) + 4 (ASTERISK)

VERSION: 2.14-869a
BUILD: 221021-1038
© 2022 ViciDial Group
1(DB / WEb ) + 3 (ASTERISK)
hanidhakwani
 
Posts: 25
Joined: Tue Nov 12, 2019 4:44 am

Re: Change route depending on the status returned from the A

Postby hanidhakwani » Sat Jan 07, 2023 9:08 am

agi-VDAD_ALL_outbound.agi update status to AA /NA / B ?
VERSION: 2.14-752a
BUILD: 200508-1024
© 2020 ViciDial Group
2(DB / WEb ) + 4 (ASTERISK)

VERSION: 2.14-869a
BUILD: 221021-1038
© 2022 ViciDial Group
1(DB / WEb ) + 3 (ASTERISK)
hanidhakwani
 
Posts: 25
Joined: Tue Nov 12, 2019 4:44 am

Re: Change route depending on the status returned from the A

Postby mflorell » Sat Jan 07, 2023 4:58 pm

Sorry, I meant "No Agent Call URL", it's a campaign setting.
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Change route depending on the status returned from the A

Postby hanidhakwani » Mon Jan 09, 2023 4:29 pm

hello, I propose this solution and I would like to have your opinion and correction. I tested today but just when I have AMDSTATUS in MACHINE, my DIALPLAN GO TO HANGUP

DIALPLAN :
exten => _523.,1,AGI(agi://127.0.0.1:4577/call_log)
ecten => _523.,n,Set(GLOBAL(TRNBR)=0)
exten => _523.,n,Set(GLOBAL(TRNBR)=${RAND(1,2)})
exten => _523.,n,Set(GLOBAL(APPELNBR)=1)
exten => _523.,n,Set(GLOBAL(CLIENT)=${EXTEN:3})
exten => _523.,n,NoOp(FOURNISSEUR ${TRNBR} - APPEL N ${APPELNBR})
exten => _523.,n,Gosub(FOUR_${TRNBR},s,1(${EXTEN:3}))



[FOUR_1]
exten => s,1,NoOp(--- APPEL N ${APPELNBR} Pour ${ARG1} ---)
exten => s,2,Dial(${FOURLBT1}/1023005${ARG1},,tTo)
exten => s,3,GotoIf($["${APPELNBR}"="1"]?FOUR_1,s,5)
exten => s,4,GotoIf($["${APPELNBR}"="2"]?FOUR_1,s,7)
exten => s,5,Set(GLOBAL(APPELNBR)=${IF($[ ${APPELNBR} = 1]?2:1)})
exten => s,6,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"] | $["${DIALSTATUS}" = "CONGESTION"] | $["${DIALSTATUS}" = "NOANSWER"] | $["${DIALSTATUS}" = "BUSY"] | $["${DIALSTATUS}" = "CANCEL"] | $["${AMDSTATUS}" = "MACHINE"] | $["${AMDSTATUS}" = "HANGUP"]?FOUR_2,s,1(${CLIENT}))
exten => s,7,Hangup()

[FOUR_2]
exten => s,1,NoOp(--- APPEL N ${APPELNBR} Pour ${ARG1} ---)
exten => s,2,Set(CODEREGION=${ARG1:2:1})
exten => s,3,NoOp(--- ------ CODEREGION : ${CODEREGION} ------ ---)
exten => s,4,GosubIf($[${CODEREGION} = 1]?FCFrance01,cell${RAND(1,2)},1)
exten => s,5,GosubIf($[${CODEREGION} = 2]?FCFrance02,cell${RAND(1,2)},1)
exten => s,6,GosubIf($[${CODEREGION} = 3]?FCFrance03,cell${RAND(1,2)},1)
exten => s,7,GosubIf($[${CODEREGION} = 4]?FCFrance04,cell${RAND(1,2)},1)
exten => s,8,GosubIf($[${CODEREGION} = 5]?FCFrance05,cell${RAND(1,2)},1)
exten => s,9,GosubIf($[${CODEREGION} = 6]?FCFranceMOB,cell${RAND(1,3)},1)
exten => s,10,GosubIf($[${CODEREGION} = 7]?FCFranceMOB,cell${RAND(1,3)},1)
exten => s,11,GosubIf($[${CODEREGION} = 9]?FCFranceMOB,cell${RAND(1,3)},1)
exten => s,12,NoOp(Affichage : ${CALLERID(num)})
exten => s,13,Dial(${FC2003}/${ARG1},,tTo)
exten => s,14,GotoIf($["${APPELNBR}"="1"]?FOUR_2,s,16)
exten => s,15,GotoIf($["${APPELNBR}"="2"]?FOUR_2,s,18)
exten => s,16,Set(GLOBAL(APPELNBR)=${IF($[ ${APPELNBR} = 1]?2:1)})
exten => s,17,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"] | $["${DIALSTATUS}" = "CONGESTION"] | $["${DIALSTATUS}" = "NOANSWER"] | $["${DIALSTATUS}" = "BUSY"] | $["${DIALSTATUS}" = "CANCEL"] | $["${AMDSTATUS}" = "MACHINE"] | $["${AMDSTATUS}" = "HANGUP"]?FOUR_1,s,1(${CLIENT}))
exten => s,18,Hangup()

[FCFrance01]
exten => cell1,1,Set(CALLERID(num)=331XXXXXXXX)
same => n,Return
exten => cell2,1,Set(CALLERID(num)=331XXXXXXXX)
same => n,Return

[FCFrance02]
exten => cell1,1,Set(CALLERID(num)=332XXXXXXXX)
same => n,Return
exten => cell2,1,Set(CALLERID(num)=332XXXXXXXX)
same => n,Return

[FCFrance03]
exten => cell1,1,Set(CALLERID(num)=333XXXXXXXX)
same => n,Return
exten => cell2,1,Set(CALLERID(num)=333XXXXXXXX)
same => n,Return

[FCFrance04]
exten => cell1,1,Set(CALLERID(num)=334XXXXXXXX)
same => n,Return
exten => cell2,1,Set(CALLERID(num)=334XXXXXXXX)
same => n,Return

[FCFrance05]
exten => cell1,1,Set(CALLERID(num)=335XXXXXXXX)
same => n,Return
exten => cell2,1,Set(CALLERID(num)=335XXXXXXX)
same => n,Return

[FCFranceMOB]
exten => cell1,1,Set(CALLERID(num)=339XXXXXX)
same => n,Return
exten => cell2,1,Set(CALLERID(num)=339XXXXXX)
same => n,Return
exten => cell3,1,Set(CALLERID(num)=339XXXXXX)
same => n,Return


IN extensions.conf :
; VICIDIAL_auto_dialer transfer script AMD with Load Balanced:
exten => 8369,1,AGI(agi://127.0.0.1:4577/call_log)
exten => 8369,n,Playback(sip-silence)
exten => 8369,n,AMD(2000,2000,1000,5000,120,50,4,256)
;HENIexten => 8369,n,AMD(2500,1500,800,5000,100,50,3,256)
exten => 8369,n,GotoIf($["${AMDSTATUS}" = "MACHINE"] | $["${AMDSTATUS}" = "HANGUP"]?default,8369,5)
exten => 8369,n,GotoIf($["${APPELNBR}"="1"]?default,8369,7)
exten => 8369,n,GotoIf($["${APPELNBR}"="2"]?default,8369,9)
exten => 8369,n,GotoIf($["${TRNBR}"="1"]?FOUR_1,s,3(${CLIENT}))
exten => 8369,n,GotoIf($["${TRNBR}"="2"]?FOUR_2,s,2(${CLIENT}))
exten => 8369,n,AGI(VD_amd.agi,${EXTEN})
exten => 8369,n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----LB-----${CONNECTEDLINE(name)})
exten => 8369,n,Hangup()
VERSION: 2.14-752a
BUILD: 200508-1024
© 2020 ViciDial Group
2(DB / WEb ) + 4 (ASTERISK)

VERSION: 2.14-869a
BUILD: 221021-1038
© 2022 ViciDial Group
1(DB / WEb ) + 3 (ASTERISK)
hanidhakwani
 
Posts: 25
Joined: Tue Nov 12, 2019 4:44 am

Re: Change route depending on the status returned from the A

Postby hanidhakwani » Mon Jan 09, 2023 6:56 pm

I changed DIALSTATUS by HANGUPCAUSE, I think it works, tomorrow I test in production
VERSION: 2.14-752a
BUILD: 200508-1024
© 2020 ViciDial Group
2(DB / WEb ) + 4 (ASTERISK)

VERSION: 2.14-869a
BUILD: 221021-1038
© 2022 ViciDial Group
1(DB / WEb ) + 3 (ASTERISK)
hanidhakwani
 
Posts: 25
Joined: Tue Nov 12, 2019 4:44 am


Return to Support

Who is online

Users browsing this forum: No registered users and 103 guests