Survey

Status
Not open for further replies.

Osney Santos

Gold Partner
Joined
Feb 19, 2019
Messages
75
Reaction score
21
In the debian environment using the component survey is it possible to direct the csv file to a directory outside of debian? How do you advise to do this?

Also in the same solution if you are not directed to a folder outside of debian which would be the simplest way for a user to get this file.

It is possible to save this csv file with date ex. survey%MM%DD%YYYY.csv.
 
Just send the file by email?
 
I understand but without e-mail how do I do this? What is the best alternative?

In the case of sending by e-mail I intend that this file accumulates all the answers and is sent only at the end of the day to be processed by PowerBI.
 
I understand but without e-mail how do I do this? What is the best alternative?

In the case of sending by e-mail I intend that this file accumulates all the answers and is sent only at the end of the day to be processed by PowerBI.
There's a few way to send a file outside the server, but none that are super easy beside email.

You can use the Web Service to send the file via HTTP POST request.

You can use the Database and save results there instead of a CSV.

You can send it by email.

Those are your option at the moment.
 
In the email, can I control how often the file will be sent or at each call he will send the file?
 
In the email, can I control how often the file will be sent or at each call he will send the file?
It's C#. You can do a lot. Just try it.
 
When I try to send the file by email, I get the following error.

2021/03/04 12:02:13.777|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - CallFlow.CFD.SurveyComponent 'Agente' - No more questions, playing goodbye prompts and generating results
2021/03/04 12:02:13.777|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - CallFlow.CFD.SurveyComponent 'Agente' - Start writing survey results to file '/tmp/pesquisa.csv':
Headers: Data,Agente,Numero Chamador,Nota,Duvida,Solicitacao
Values: 04/03/2021 12:01:54,,116,5,2,1
2021/03/04 12:02:13.777|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - CallFlow.CFD.SurveyComponent 'Agente' - End writing survey results to file '/tmp/pesquisa.csv'
2021/03/04 12:02:13.777|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - Start executing component 'EmailSender1'
2021/03/04 12:02:13.779|24350|0013|Err|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - Error executing last component: System.IO.DirectoryNotFoundException: Could not find a part of the path '/var/lib/3cxpbx/04/03/2021 12:01:54,,116,5,2,1'.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at CallFlow.CFD.EMailSenderHelper.SendMail(LogFormatter logFormatter, String server, Int32 port, Boolean enableSSL, String userName, String password, String from, String to, String cc, String bcc, String subject, String body, Boolean isBodyHtml, MessagePriority priority, Boolean ignoreMissingAttachments, List`1 attachments)
at CallFlow.CFD.EMailSenderComponent.ExecuteStart()
at CallFlow.CFD.EMailSenderComponent.Start(TimerManager timerManager, Dictionary`2 variableMap, TempWavFileManager tempWavFileManager, PromptQueue promptQueue)
at _250_13.Main.ProcessStart()
2021/03/04 12:02:13.779|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - Start executing error handler flow...
2021/03/04 12:02:13.779|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - Start executing component 'errorHandlerAutoAddedFinalDisconnectCall'
2021/03/04 12:02:13.779|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - PromptQueue - Start playing file: /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/surveykenerson/agradecimento.wav
2021/03/04 12:02:13.779|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/surveykenerson/agradecimento.wav
2021/03/04 12:02:18.828|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - OnPromptPlayed for component 'errorHandlerAutoAddedFinalDisconnectCall'
2021/03/04 12:02:18.828|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - CallFlow.CFD.DisconnectCallComponent 'errorHandlerAutoAddedFinalDisconnectCall' - No more files to play, disconnecting call...
2021/03/04 12:02:18.829|24350|0006|Inf|ScriptRunner.ScriptRunner-CallStorageSize=1(1)
2021/03/04 12:02:18.838|24350|0006|Inf|ScriptRunner.ScriptRunner-Removed CallID mapping on terminated connection for SIP dialog WP7t9bNoWejJSmTcezBdvQ..07deb5127
2021/03/04 12:02:18.838|24350|0006|Inf|ScriptRunner.ScriptRunner-CallStorageSize=1(0)
2021/03/04 12:02:18.958|24350|0006|Inf|ScriptRunner.ScriptRunner-FireTerminate and remove mapping for existing SIP dialogue WP7t9bNoWejJSmTcezBdvQ..07deb5127
2021/03/04 12:02:18.958|24350|0006|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: Main - Switching executing mode from Active to Wrapup
2021/03/04 12:02:18.958|24350|0006|Inf|ScriptRunner.ScriptRunner-CallStorageSize=0(0)
2021/03/04 12:02:18.959|24350|0011|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - OnCallTerminated for component 'errorHandlerAutoAddedFinalDisconnectCall'
2021/03/04 12:02:18.959|24350|0011|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - CallFlow.CFD.DisconnectCallComponent 'errorHandlerAutoAddedFinalDisconnectCall' - Processing OnCallTerminated
2021/03/04 12:02:18.959|24350|0011|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - Callflow finished, disconnecting call...
2021/03/04 12:02:18.959|24350|0011|?6?|CallPair._250_13.Main.6362.[C:2273.2]-Failed to process ICall.Terminate - connection does not exist
 
If you send the email from the CFD app, you will do it at the end of the call. If you want to send this once at the end of the day, you will need to create a program or script to do this outside of the CFD app.

Regarding the log, you're selecting the wrong attachment:
2021/03/04 12:02:13.777|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - CallFlow.CFD.SurveyComponent 'Agente' - End writing survey results to file '/tmp/pesquisa.csv'
2021/03/04 12:02:13.777|24350|0013|Trc|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - Start executing component 'EmailSender1'
2021/03/04 12:02:13.779|24350|0013|Err|CallPair._250_13.Main.6362.[C:2273.2]-From script: SurveyKenerson - CallID 00000177FDC26DFC_2273 - Callflow - Error executing last component: System.IO.DirectoryNotFoundException: Could not find a part of the path '/var/lib/3cxpbx/04/03/2021 12:01:54,,116,5,2,1'.

The file is "/tmp/pesquisa.csv", but you're trying to attach "/var/lib/3cxpbx/04/03/2021 12:01:54,,116,5,2,1".

Maybe another option is that you store the CSV files in the 3CX server, in a shared FTP folder, so you can get those files through FTP. You can create a script to copy those files somewhere else at the end of the day. This is not something that you will do with the CFD, you will create an external script or program to do this.

If you want that the CSV file name contains the current date, you can use an expression for that. For example, use a C# script to get the current date:
1614871016162.png

And then use that as part of the CSV file name:
1614871055034.png
 
Edossantos,

Why he is trying to get the file from elsewhere, the survey component is configured to save the file in /tmp/pesquisa.csv.

In the component to send email do I need to tell you where the file is?
 
Funciona agora.

Obrigado.
 
  • Like
Reactions: edossantos
Edossantos,

Why he is trying to get the file from elsewhere, the survey component is configured to save the file in /tmp/pesquisa.csv.

In the component to send email do I need to tell you where the file is?
It looks like you're trying to attache the file name taken from the Result property, and you should use the same file name that you configured in the Survey component.
 
  • Like
Reactions: Osney Santos
Status
Not open for further replies.