How to set Vicidial Lead fields as Variable in asterisk dialplan

Vicidial Lead fields as variable in Asterisk Dialplan or AGI

Topic: How to set Vicidial Lead fields as Variable in asterisk dialplan

vicidal lead data in asterisk dialplan


  Overview: Vicidial lead data as Asterisk variable


    In this article ,i am going to show you how to set the vicidial lead data's as a variable in asterisk dialplan ,which will used for other purposes like DB check, sending SMS etc.
    Vicidial is the most popular Open-Source Contact Center Solution in the world, that incorporates a predictive dialer to enable the blended handling of inbound / outbound calls alongside inbound emails and customer website chat.

  Popose of Setting Lead data as variable

    In vicidial you might require the lead fields in asterisk dialplan for the stuffs like checking the database with customer phone number before dial, or run an api within dialplan, sending sms - etc,

 By default you will get the callee (${EXTEN)}) or caller number(${CALLERID(num)}) as variable in dialplan, but in this article you will learn how to set lead datas like name, address ,country, dob, comments, owner, postal code etc in asterisk dialplan as a variable ie:${first_name}.

Variables:

    A variable is a placeholder for an actual value. Exactly what that value is depends on the kind of variable. In Asterisk, variables can contain numbers, letters and strings. Variables are useful because they let us create rules for call flow that apply in changing circumstances and make it easier to accommodate future changes in the telephone application or system

The value of a variable can be obtained using the syntax ${VARIABLENAME}. There are variables that are automatically set by Asterisk. For example, the called number is always stored in the Asterisk system variable ${EXTEN}, calling party caller-id ${CALLERID(num)} etc.

  Workaround:

    In Vicidial ,The Lead data's in asterisk dialplan variable is set by using th agi script called agi-set_variables.agi

Vicidial Latest svn version by default comes with agi script agi-set_variables.agi

For downloading the latest version of Vicidial,use the svn checkout link

svn checkout svn://svn.eflo.net/agc_2-X/trunk


You need to use agi-set_variables.agi in your dialplan as shown below while dialing out

Dialplan 

exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,n,AGI(agi-set_variables.agi)
exten => _91NXXNXXXXXX,n,Dial(${TESTSIPTRUNK}/${EXTEN:2},,tTor)
exten => _91NXXNXXXXXX,n,Hangup

The vicidial Lead Field values are set as variable as shown below

${lead_id}
${first_name}
${phone_number}
${address1}

To debug or see the values in the asterisk CLI you can use the asterisk dialplan function Noop as show below

exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,n,AGI(agi-set_variables.agi)
exten => _91NXXNXXXXXX,n,NoOp(Customer Name is ${first_name})
exten => _91NXXNXXXXXX,n,NoOp(Lead id is ${lead_id})
exten => _91NXXNXXXXXX,n,NoOp(Customer phone number ${phone_number}
exten => _91NXXNXXXXXX,n,Dial(${TESTSIPTRUNK}/${EXTEN:2},,tTor)
exten => _91NXXNXXXXXX,n,Hangup

  Vicidial Lead fields Variable name

       Below are the list of vicidial lead fields name ,which are assigned in asterisk dialplan ,which will be retrieved with variable format that is ${variable_name}

lead_id
entry_date
modify_date
status
user
vendor_lead_code
source_id
list_id
phone_number
title
first_name
middle_initial
last_name
address1
address2
address3
city
state
province
postal_code
country_code
gender
date_of_birth
alt_phone
email
security_phrase
comments
called_count
last_local_call_time
rank
owner
campaign_id
dialed_number

  Conclusion:

    Hope this article is helpful ,if you like this article share and like, for any professional support reach me at skype:striker24x7 

3 Comments
  • Ajit Kumar
    Ajit Kumar April 4, 2022 at 9:29 AM

    vicidial how to add vicidial leads fields in dialplan as variable.
    vicidial insert leads data in asterisk dialplan as variable.

  • Govind Bairwa
    Govind Bairwa June 29, 2022 at 12:41 PM

    Amazing .. You saved my day,
    Thanks

  • Anonymous
    Anonymous December 8, 2023 at 5:38 PM

    Please Make a blog on web form of vicidial.. &Thank you so much for taught me vicidial from basic now i am handling a call center of 150 seats once again thanks sir.

Add Comment
comment url