3CX Call Flow Designer - DTMF query PIN is canceled after first digit

Status
Not open for further replies.

fabs

Customer
Joined
Aug 18, 2021
Messages
53
Reaction score
10
Hello all,

I have a few problems with my call flow:
I want the customer to enter a 6 digit PIN and then be handled accordingly. If the verification via the https POST request is correct, he should be forwarded to a call group and if the entry is incorrect, he should get 2 more chances until he hangs up.
The login first gets the PIN via the external datasource as POST and checks it for 6 digits, if correct, it should be validated and the result, true or false, is stored in a variable, which is compared with isSuccess or error. Then it is looped or forwarded.
My problem is that as soon as the first digit is entered, the query is executed directly and this is obviously wrong. Only the direct input is checked, why?
My https request goes to my RestAPI and is compared internally so that a simoples true or false is given as a boolean response.
V20 Update2

log file:

Code:
2024/07/23 11:08:59.088|0005|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-Stop current prompt playback
2024/07/23 11:08:59.088|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - Callflow - OnPromptPlayed for component 'mainMenu'
2024/07/23 11:08:59.088|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - CallFlow.CFD.MenuComponent 'mainMenu' - No more files to play, setting up timer to wait for DTMF input during 60000ms...
2024/07/23 11:08:59.090|0005|Info| ScriptRunner.ScriptRunner-CallStorageSize=1(1)
2024/07/23 11:08:59.090|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - Callflow - OnDTMFReceived for component 'mainMenu' - Digit: '9'
2024/07/23 11:08:59.090|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - CallFlow.CFD.MenuComponent 'mainMenu' - Digit detected: '9' - canceling timer
2024/07/23 11:08:59.090|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - CallFlow.CFD.MenuComponent 'mainMenu' - Digit '9' is invalid, repeating menu...
2024/07/23 11:08:59.090|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - PromptQueue - Start playing file: /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_wrong_input.wav
2024/07/23 11:08:59.090|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - PromptQueue - Start playing file: /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_enter_pin.wav
2024/07/23 11:08:59.090|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_wrong_input.wav
/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_enter_pin.wav
2024/07/23 11:09:02.930|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - Callflow - OnPromptPlayed for component 'mainMenu'
2024/07/23 11:09:02.930|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - CallFlow.CFD.MenuComponent 'mainMenu' - No more files to play, setting up timer to wait for DTMF input during 60000ms...
2024/07/23 11:09:02.930|0005|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-Stop current prompt playback
2024/07/23 11:09:02.931|0005|Info| ScriptRunner.ScriptRunner-CallStorageSize=1(1)
2024/07/23 11:09:02.931|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - Callflow - OnDTMFReceived for component 'mainMenu' - Digit: '9'
2024/07/23 11:09:02.931|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - CallFlow.CFD.MenuComponent 'mainMenu' - Digit detected: '9' - canceling timer
2024/07/23 11:09:02.931|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - CallFlow.CFD.MenuComponent 'mainMenu' - Digit '9' is invalid, repeating menu...
2024/07/23 11:09:02.931|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - PromptQueue - Start playing file: /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_wrong_input.wav
2024/07/23 11:09:02.931|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-From script: support_callflow - CallID f48dd9de90010000_2 - PromptQueue - Start playing file: /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_enter_pin.wav
2024/07/23 11:09:02.931|0009|Trac| CallPair._support_callflow_1.Main.5.[C:2.3]-/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_wrong_input.wav
/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/support_callflow/converted_enter_pin.wav
2024/07/23 11:09:42.771|0005|Info| ScriptRunner.ScriptRunner-removeConnection on handled DN (L4C1BaWCGXTz3yDtKJq_-g..077b37c15 on 5(C:2.3)
2024/07/23 11:09:42.771|0005|Info| ScriptRunner.ScriptRunner-Removed CallID mapping on terminated connection for SIP dialog L4C1BaWCGXTz3yDtKJq_-g..077b37c15
2024/07/23 11:09:42.771|0005|Info| ScriptRunner.ScriptRunner-Call 2 has been removed

Do you have any suggestions as to what could be wrong here?
Thank you very much
 

Attachments

  • issuccess.png
    issuccess.png
    32.3 KB · Views: 8
  • login.png
    login.png
    139.7 KB · Views: 7
  • loop.png
    loop.png
    41.8 KB · Views: 6
  • main.png
    main.png
    87.2 KB · Views: 6
  • mainprop.png
    mainprop.png
    18.7 KB · Views: 6
  • result of validate.png
    result of validate.png
    35.4 KB · Views: 7
  • validatehttpprop.png
    validatehttpprop.png
    42.4 KB · Views: 6
  • validate.png
    validate.png
    139.7 KB · Views: 6
  • user input prop.png
    user input prop.png
    115 KB · Views: 6
  • iserror.png
    iserror.png
    39 KB · Views: 8
Last edited:
Hello again,

here the api response
 

Attachments

  • api.png
    api.png
    9.3 KB · Views: 7
Hello,



I have just noticed that there is an error in the call flow, I had added “Menu” as the first query with the only valid option 0.
The query now works.
 
From the log, it seems you're pressing 9 in the main menu, and only option 0 is valid. That's why you're not moving on beyond that point.
 
Hi edossantos_sipcaller,

the call flow is working now, we had included menu and this was wrong.
Now we have some issues to trigger the external data source.
We are trying to make a HTTP post request, here we are talking about content, my question is, is this content sent as a JSON body or as a URL query?
With the current approach, the API expects a query value, the request itself is made, but the query does not contain a value.


Code:
2024/07/23 16:39:07.304|0018|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.WebInteractionComponent 'HttpRequest1' - Start executing component with uri='https://xxxxxxxxxx.com/api/support' - httpMethod='POST' - contentType='text/plain' - content='projectNumber=callflow$.projectNumber'
2024/07/23 16:39:07.304|0018|Info| [System.Net.Http.HttpClient.Default.LogicalHandler] Start processing HTTP request POST https://xxxxxxxxxxxx.com/api/support
2024/07/23 16:39:07.832|0017|Info| [System.Net.Http.HttpClient.Default.LogicalHandler] End processing HTTP request after 527.8014ms - 200
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.WebInteractionComponent 'HttpRequest1' - End executing component with ResponseStatusCode='200' - ResponseContent: false
2024/07/23 16:39:07.304|0018|Info| [System.Net.Http.HttpClient.Default.LogicalHandler] Start processing HTTP request POST https://xxxxxxxxxxxxxxxxxx.com/api/support
2024/07/23 16:39:07.832|0017|Info| [System.Net.Http.HttpClient.Default.LogicalHandler] End processing HTTP request after 527.8014ms - 200
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.WebInteractionComponent 'HttpRequest1' - End executing component with ResponseStatusCode='200' - ResponseContent: false
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - _support_callflow_26.Main+ValidateData 'ValidateData' - Start executing component 'setResult'
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.VariableAssignmentComponent 'setResult' - Start executing component with variableName='callflow$.ValidationResult' - variableValue='False'
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.SequenceContainerComponent 'loginLoop_Container' - Start executing component 'checkValidationResult'
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.ConditionalComponent 'checkValidationResult' - Evaluating condition for branch 'isSuccess'
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.ConditionalComponent 'checkValidationResult' - Condition evaluated to false for branch 'isSuccess', skipping branch
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.ConditionalComponent 'checkValidationResult' - Evaluating condition for branch 'isError'
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.ConditionalComponent 'checkValidationResult' - Condition evaluated to true for branch 'isError', executing inner components
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.ConditionalComponent 'checkValidationResult' - Start executing branch 'isError'
2024/07/23 16:39:07.832|0017|Trac| CallPair._support_callflow_26.Main.267.[C:63.3]-From script: support_callflow - CallID 650608e090010000_63 - CallFlow.CFD.SequenceContainerComponent 'isError' - Start executing component 'InvalidResult'
 

Attachments

  • httprequest 1.png
    httprequest 1.png
    71.1 KB · Views: 3
Last edited:
This is up to you. If you want to include query string parameters, then include them in the URL. You will need to use the CONCATENATE function so you can concatenate static text with variables. Use the Expression Editor to build your expression.
 
Hello @edossantos_sipcaller,

In the expression editor to include CONCATENATE was not working we had to modify the string in the code manually after uploading.

setResult.VariableValueHandler = () => { return CFDFunctions.EQUAL(HttpRequest1.ResponseStatusCode,200); };

means it works only when we get back 200 for true or 404 for false
 
Last edited:
In the expression editor to include CONCATENATE was not working we had to modify the string in the code manually after uploading.
OK, this is up to you. If you need to use variable parts in the URL, then you will need to use the CONCATENATE function.

setResult.VariableValueHandler = () => { return CFDFunctions.EQUAL(HttpRequest1.ResponseStatusCode,200); };

means it works only when we get back 200 for true or 404 for false
That expression will assign the boolean true to that variable when the response is 200 OK, otherwise false.
 
Thanks it works now.
but I still have a few questions:

1. the name of the DID rule is set analogous to the name of the script. Renaming the DID does not work, it automatically sets the name of the DID as name of the script.
Now I forward the call within the script to an extension (call group). When answering the call, of course, it now says
“Sender number -> Name DID -> Name call group.
Is there still a way to change the name of the DID? Or to remove it, or can you hide the name of the DID when forwarding to the call group? Or hide the name of the call group?

2. Can I set that when the call is forwarded to the extension (call group), it rings at the extensions, regardless of whether they are awake? There is a VIP function, but this is activated based on the recognized phone numbers.
 
Last edited:
Status
Not open for further replies.

Forum statistics

Threads
111,952
Messages
589,896
Members
164,845
Latest member
tdzski5