phonemin ios crashes

mbedial

Member
We are testing the "PhoneMin" example in the iOS SDK 2.4.2
Although the original example is in objective-c we are converting it to swift (we need it to include it in our apps)

The connection is the same in both (the example and the real project), excepting for the diferent params for the connection.

But we are facing a problem when we initiate a call. In the example we have this code:

- (FPWCSApi2Call *)call {

FPWCSApi2Session *session = [FPWCSApi2getSessions][0];

FPWCSApi2CallOptions *options = [[FPWCSApi2CallOptionsalloc] init];

options.callee = _callee.input.text;

//used for only recv audio



.....

And in the real project in swift we are using this:
funccall() -> FPWCSApi2Call?{



let session:FPWCSApi2Session = FPWCSApi2.getSessions()![0] as! FPWCSApi2Session

let options:FPWCSApi2CallOptions = FPWCSApi2CallOptions()



options.callee = self.input.text

.....

This code works perfectly when we are using XCode in a development environment, building the app directly to an iPhone, but when the app is uploaded to iTunesConnect and we try it with TestFlight the application always crashes when is going to make the call. After investigating the cause we realized that the break is always in this line:

let session:FPWCSApi2Session = FPWCSApi2.getSessions()![0] as! FPWCSApi2Session


As we said this only happens when the app is uploaded to a production environment.
Any suggestion to fix it?

BR
Mario
 

Max

Administrator
Staff member
Hello
Did you connect to wss:// with valid SSL certificate installed on WCS server?
Could you try to connect to our demo server wss://wcs5-eu.flashphoner.com:443 from your app?
We had similar reports with ws:// not secure connection from release (non-debug) app.
 

mbedial

Member
Thanks for your answer.
Actually I'm afraid that we haven't configured it although with android it was working.
Another question, can we use a self signed SSL certificate?
 

Max

Administrator
Staff member
iOS requires normal CA signed SSL certificate.

You can use letsencrypt certificates for example.
The certificate can be imported via Dashboard http://host:9091 Security - Certificates. You have to upload two files: fullchain.pem and privkey.pem received from letsencrypt.
See our demo dashboard as it looks like https://wcs5-eu.flashphoner.com
 

mbedial

Member
Hi again,
we have followed the proccess, first to get the letsencrypt files and after to upload the files to flashphoner, but we get this error message from the WCS server:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri Dec 22 09:14:55 CET 2017
There was an unexpected error (type=Internal Server Error, status=500).
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement

We upload the fullchain.pem and privkey.pem

Thanks a lot for your help.
Mario
 

Max

Administrator
Staff member
It should work if you cleanup internal database:
Code:
service webcallserver stop
rm WCS_HOME/database/*
service webcallserver start
 
Top