Need Auto Dialer / CFD help

Discussion in 'Call Flow Designer' started by empire4, Sep 15, 2017.

Thread Status:
Not open for further replies.
  1. empire4

    Joined:
    Nov 22, 2016
    Messages:
    14
    Likes Received:
    0
    I am new to 3CX and CFD, Will it be possible to build a voice app using 3CX CFD that will auto dial a customer number picked from a database table, and once the call is answered, play out a voice greeting along with a customer specific message read out from the table as TTS, and then collect customer response, basically 1 for confirmation, 2 for re-schedule, and post this response parameter back to table. Note that there is no agent interaction required.

    I would like to know, if such an app can be built with 3CX CFD, and if so, is there any professional service available that I can subscribe to get some assistance on this?
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,067
    Likes Received:
    75
    Hello @empire4,

    Please take a look at the following article on how to create a dialer with the CFD:
    https://www.3cx.com/docs/cfd-creating-outbound-dialer/

    You need to edit it to read the information from a database, but the structure is prettu much the same.

    Then you need to make the calls between the external number (from) and your CFD app extension (to). This way you receive in your CFD callflow an inbound call, and you can play wav files to it, and finally save the user response in a database.

    Regarding TTS, it's not currently supported, so you need to create the wav file from the text using some external tool... in the future we'll be adding TTS, but currently it's not available.

    Kind regards.
    Ernesto.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. empire4

    Joined:
    Nov 22, 2016
    Messages:
    14
    Likes Received:
    0
    Thank you so much. I will be developing it and will keep updating.
     
  4. empire4

    Joined:
    Nov 22, 2016
    Messages:
    14
    Likes Received:
    0
    I have made some progress. Currently having this problem. I am successfully querying a database from the with a where condition matching the session.dnis. I want to use the query result to be written on a text file. Some how the value getting written is this "System.Collections.Generic.List`1[System.Object[]]"

    however, On the queue log, I can see the database component is returning the correct value:
    --
    17/09/29 16:55:58.131|100049| Trc|75|0023|: PlugIn[_805test - Callflow - MainFlow - CallID VCIPCMUTHGJQ] Trace: Start executing component 'DatabaseAccess1'
    17/09/29 16:55:58.131|100049| Trc|75|0023|: PlugIn[_805test - DatabaseAccessComponent - CallID VCIPCMUTHGJQ] Trace: Start executing component with server='localhost\SQLEXPRESS' - port='1433' - database='testCRM' - userName='testUser1' - password='testUser1' - statementType='Query'
    17/09/29 16:55:58.131|100049| Trc|75|0023|: PlugIn[_805test - DatabaseAccessComponent - CallID VCIPCMUTHGJQ] Trace: Command to execute: select datename(month, tblCustomer1.ScheduleDate) from tblCustomer1 where purchaseOrder=805
    17/09/29 16:55:58.137|100049| Trc|75|0023|: PlugIn[_805test - DatabaseAccessComponent - CallID VCIPCMUTHGJQ] Trace: End executing component with queryResult: [January]

    17/09/29 16:55:58.137|100049| Trc|75|0023|: PlugIn[_805test - Callflow - MainFlow - CallID VCIPCMUTHGJQ] Trace: Start executing component 'ReadWriteFile1'
    ---

    Am I doing it wrong? Any help will be appreciated.
     
  5. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,067
    Likes Received:
    75
    Hi @empire4,

    When the Database Access component is configured with StatementType = Query, it returns a table, with N rows (each row is a record returned from the database), and M columns (each column is a field returned by the query).

    If your query returns a single value, like in your case "January", it's easier to use the StatementType = Scalar. This statement type is the same than query, but instead of returning a table, it will return a single value, the one located in the first row and the first column.

    If you need to return the table, then you need to get the value for each cell of the table using the CFD function "GET_TABLE_CELL_VALUE". Also, you have the CFD function "GET_TABLE_ROW_COUNT" which will tell you how many records you have.

    The CFD function GET_TABLE_ROW_COUNT receives the variable containing the table, so for example if your Database Access component name is "databaseAccess1", then your expression should be:
    GET_TABLE_ROW_COUNT(databaseAccess1.QueryResult)

    And similarly, the CFD function GET_TABLE_CELL_VALUE receives the table, and also the row and column zero-based index. So for example:
    GET_TABLE_CELL_VALUE(databaseAccess1.QueryResult, 0, 0) >> will return the value of the first row and first column
    GET_TABLE_CELL_VALUE(databaseAccess1.QueryResult, 0, 1) >> will return the value of the first row and second column
    GET_TABLE_CELL_VALUE(databaseAccess1.QueryResult, 1, 0) >> will return the value of the second row and first column
    GET_TABLE_CELL_VALUE(databaseAccess1.QueryResult, 1, 1) >> will return the value of the second row and second column

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. empire4

    Joined:
    Nov 22, 2016
    Messages:
    14
    Likes Received:
    0
    This very helpful. Thank you so much.
     
  7. empire4

    Joined:
    Nov 22, 2016
    Messages:
    14
    Likes Received:
    0
    Here is what I am trying to achieve. Take the QueryResult (date) and read out to customer in day, month, and Year. So 1/1/2017 will be read our 1st January 2017. Since there is no TTS support, I am taking a different approach. I have individual audio files for 1-31, Jan - Dec and 2017. My plan is to use dynamic audio prompt feature to take the QueryResult, convert it into day name, and then concatenate it with .wav, so that the output will look like monday.wav and can now play the pre-recorded wav file from the audio directory. Similarly, add another dynamic audio prompt for January, and so on.. I tested this with DateTime.Now.Tostring("mmmm") in the expression and with concatenate with .wav, I was able to play. But, obviously I need something similar to convert the date coming from the database.

    So, looking for an expression that can be used in the dynamic audio prompt audio file expression to convert the QueryResult date into month name, day name and year..
     
  8. empire4

    Joined:
    Nov 22, 2016
    Messages:
    14
    Likes Received:
    0
    I got it solved with the query
    "select datename(dw, tblCustomer1.ScheduleDate) as WeekDay,datename(day, tblCustomer1.ScheduleDate) as TranDay ,datename(month, tblCustomer1.ScheduleDate) as TranMonth,datename(year, tblCustomer1.ScheduleDate) as TranYear from tblCustomer1 where teleMobile={0}

    Now I get the query result as:
    Sunday 1 January 2017

    And simply change cell reference to call the correct pormpt file.
     
Thread Status:
Not open for further replies.