Page 1 of 1

Diaplan question, Hanging up call and setting specific statu

PostPosted: Sun Mar 02, 2025 5:58 pm
by callix
Mates,

I have a dialplan that runs BLA API, and when thats a FDNC number, it hangs up, if good then it continues with the call. Below dialplan is working great..!!

exten => _9898X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9898X.,n,AGI(agi-set_variables.agi,)
exten => _9898X.,n,Set(APIKEY=bla_apikey)
exten => _9898X.,n,Set(API_RESPONSE=${{SHELL(curl -s https://api.blacklistalliance.net/lookup?key=${{APIKEY}}&resp=json&phone=${{phone_number}})}})
exten => _9898X.,n,Set(BLACKLIST_STATUS=${{SHELL(echo ${{API_RESPONSE}} | jq -r .message)}})
exten => _9898X.,n,GotoIf($[${{BLACKLIST_STATUS}} = Good]?continue_call:blacklisted)
exten => _9898X.,n(blacklisted),Hangup()
exten => _9898X.,n(continue_call),Dial(SIP/${{EXTEN:4}}@carrier,55,o)
exten => _9898X.,n,Hangup()

I want to set it up in such a way that, when it hangsup, it should update the lead with status code "LITIGA", and vicidial_log says the same status code.

There is a dirty method ro a mysql query to update the vicidial_dial_log with some custom text to identify those calls. In my case, thats a mega cluster, so something simple willl be nice..!!

Re: Diaplan question, Hanging up call and setting specific s

PostPosted: Mon Mar 03, 2025 7:56 am
by carpenox
there is a way to set status via an agi - https://dialer.one/index.php/how-to-use-vicidials-agis/

Re: Diaplan question, Hanging up call and setting specific s

PostPosted: Mon Mar 03, 2025 1:38 pm
by williamconley
many agi scripts in /var/lib/asterisk/agi-bin have the ability to alter lead data, to name a few:

* cm_dnc.agi
* cm_dnc_new.agi
* agi-set_variables.agi
* cm_status_dial.agi

Each of these has instructions at the top of the file.