• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Assistance with Authentication

Status
Not open for further replies.

leonp

Free User
Joined
Jan 21, 2018
Messages
47
Reaction score
4
Hi,

I am currently evaluating 3CX and trying to build an authentication piece to prove that 3CX can provide the functionality that we need.

I'm having trouble with the validation part currently. (I'm pretty much using this -> https://www.3cx.com/docs/cfd-validate-customers/)

I managed to grab this part of a log file, where I can see that my "responseContent" appears to equal 1


18/01/21 22:58:01.079|100049| Trc|75|0017|: PlugIn[SDP_Queue - WebInteractionComponent - CallID AFMDARSEUPEB] Trace: Start executing component with uri='http://test.domain.com/validate' - httpMethod='POST' - contentType='application/json' - content'{"id":"5852","pin":""}'
18/01/21 22:58:01.105|100049| Trc|75|0019|: PlugIn[SDP_Queue - WebInteractionComponent - CallID AFMDARSEUPEB] Trace: End executing component with responseStatusCode='200' - responseContent: 1

18/01/21 22:58:01.105|100049| Trc|75|0017|: PlugIn[SDP_Queue - SequenceContainer 'authenticateCallerRequestId_Conditional_ValidInput' - CallID AFMDARSEUPEB] Trace: Start executing component 'checkValidationResult'
18/01/21 22:58:01.105|100049| Trc|75|0017|: PlugIn[SDP_Queue - SequenceContainer 'checkValidationResult_1' - CallID AFMDARSEUPEB] Trace: Start executing component 'PromptPlayback2'
18/01/21 22:58:01.105|100049| Trc|75|0017|: PlugIn[SDP_Queue - TextToSpeechAudioPrompt - CallID AFMDARSEUPEB] Trace: Generating text to speech to fileName='/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/../../Voiceapps/SDP_Queue/Audio/Temp_11.wav' for text='pin number could not be validated'​

The condition for successful validation is -> EQUAL(validateCustomer.ResponseContent,"1")

However, the user is not being validated, instead falling into the non validated branch.

Am I possibly missing something obvious?

Thanks,

Leon
 
Hello Leon,

It seems that the value returned by the web service has a trailing new line character. Try using the TRIM function to remove any leading or trailing non visible character before comparing it.

Kind regards.
Ernesto.
 
Hello Leon,

It seems that the value returned by the web service has a trailing new line character. Try using the TRIM function to remove any leading or trailing non visible character before comparing it.

Kind regards.
Ernesto.

Thanks for the suggestion - I tried the following to no avail...

EQUAL(TRIM(validateCustomer.ResponseContent),"1")

Anything else I could look at?
 
Hello @leonp,

Weird, can you use a Logger component to log the following expression?
CONCATENATE("Response is '",TRIM(validateCustomer.ResponseContent),"'")

Then check what you have in the log. This way you log the result between quotes, and you see exactly what you have there.
 
Ok - that helped me get to the bottom of the problem. In the end, I think it was the TRIM function which fixed it, but I had made a couple of other changes which I needed to reverse.

Is it possible to return JSON and have each returned variable available for use? (For example - REST API returns a customer name, which could be set as the FROM name in the SIP header, to be carried through as the caller ID?)
 
Glad to know that the issue has been solved.

You can use JSON, XML, or whatever format you need. If you use JSON, you can use the Newtonsoft.Json.dll, which is already part of the 3CX installation, to parse the JSON and split it as you need.

Regarding changing the display name, currently it's not possible, but we will be adding that feature in the near future.

Kind regards.
 
Thanks for the help.

Changing incoming caller ID would be very helpful.

We also provide different levels of out of hours service, so the level of service returned via the API would be appropriate for time controls.

Regards,

Leon
 
You can use that level of service returned by the API without any problem...
 
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.