Read file and play prompt

Discussion in 'Call Flow Designer' started by Rob24h, Jan 7, 2018.

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

    Joined:
    Mar 20, 2017
    Messages:
    64
    Likes Received:
    5
    Hi,

    I just started with the CFD and I like it!
    I already made a project to write a value to a file on the server and this works fine. The problem I'm facing now is with the project to read the file contents and play an audiofile.

    This is my project:
    [​IMG]

    Reading the file goes fine. When I check the queuelog I can see it returns the correct value (the value can only be: 1, 2 or 3).
    Now what I want is an audio file to be played belonging to the returned value. So if readMyfile returns 1 I want to play PromptPlayback1 etc. This does not seem to work.

    For conditionalComponentBranch1 I have the condition: EQUAL(readMyFile.Result,"1") and so on for conditionalComponentBranch2 and conditionalComponentBranch3.

    The queuelog is not showing any errors:
    18/01/07 19:15:52.844|100049| Trc|75|0015|: PlugIn[uitlezenbestand - FileManagementComponent - CallID TXHRLFRKBZQO] Trace: End executing component - eofReached='True' - result: 2
    18/01/07 19:15:52.846|100049| Trc|75|0015|: PlugIn[uitlezenbestand - Callflow - MainFlow - CallID TXHRLFRKBZQO] Trace: Start executing component 'Logger1'
    18/01/07 19:15:52.848|100049| Trc|75|0015|: PlugIn[uitlezenbestand - LoggerComponent - CallID TXHRLFRKBZQO] Trace: 2
    18/01/07 19:15:52.850|100049| Trc|75|0015|: PlugIn[uitlezenbestand - Callflow - MainFlow - CallID TXHRLFRKBZQO] Trace: Start executing component 'Condition1'
    18/01/07 19:15:52.853|100049| Trc|75|0015|: PlugIn[uitlezenbestand - Callflow - MainFlow - CallID TXHRLFRKBZQO] Trace: Start executing component 'DisconnectCall1'

    What am I doing wrong?
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,054
    Likes Received:
    75
    Hi @Rob24h,

    I think that the problem could be that the readMyFile component is reading some not visible character, like a space, a new line character, etc. I would try trimming the returned value, using the following expression:
    EQUAL(TRIM(readMyFile.Result),"1")

    Please give it a try.

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Rob24h

    Joined:
    Mar 20, 2017
    Messages:
    64
    Likes Received:
    5
    Even though there were no spaces in the txt file your solutions works perfect :)
    Thank you!
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,054
    Likes Received:
    75
    Hi @Rob24h,

    Maybe there were no spaces, but the component might read a final new line character, at the end of the line, and that made the difference.

    Kind regards.
    Ernesto.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.