Twilio Video "Media connection failed" in Microsoft Edge - twilio

I have the following code that runs without any issues in Chrome & Firefox, but will not run in Edge.
Error that comes up:
Unable to connect to Room: Media connection failed
Can you please verify and confirm why it isn't working:
let connectOptions = {
name: roomIdentity,
tracks: [localAudioTrack, localVideoTrack]
}
console.log(connectOptions)
//creating stream for agent
if (this.context.agent) {
TwilioVideo.connect(twilioToken, connectOptions)
.then(room => {
//attach error handler to room object
room.on('disconnected', (room, error) => {})
}, error => {
console.error('Unable to connect to Room: ' + error.message)
})
Edit 1:
Fill error output:
code: 53405
description: "Media connection failed"
message: "Media connection failed"
name: "TwilioError"
stack: "TwilioError: Media connection failed at _getOrCreate (http://localhost:64000/static/js/1.chunk.js:322197:11) at Anonymous function (http://localhost:64000/static/js/1.chunk.js:322274:9) at Anonymous function (http://localhost:64000/static/js/1.chunk.js:97029:13) at flush (http://localhost:64000/static/js/1.chunk.js:91027:9)"

Related

Why am I getting ConnectionError (53000) signaling error with Twilio in browser?

I have a simple method for getting a new twilio voice client...
export const createTwilioDevice = (_token) => new Twilio.Device(
_token,
{
logLevel: 0,
answerOnBridge: true,
codecPreferences: ["opus", "pcmu"],
}
);
TwilioDevice.value = createTwilioDevice();
TwilioDevice.value.on("registered", () => {
console.info("Twilio.Device ready to make and receive calls!");
});
TwilioDevice.value.on("incoming", handleIncomingCall);
TwilioDevice.value.on("tokenWillExpire", handleTokenWillExpire);
TwilioDevice.value.on("error", handleCallError);
await TwilioDevice.value.register();
It was working but now I am getting
ConnectionError: ConnectionError (53000): Raised whenever a signaling connection error occurs that is not covered by a more specific error code.
What could have caused this to start happening?
I had the same err, in my case, a client forgot to settle a bill for twillio testing account)

"Manifest signature did not verify successfully"

I've been trying to figure this out for a few days now.
The .pkpass appears to build correctly however, when I drag it into Simulator the following errors are logged in Console
-CMS verification error: -26275
-Signature validation: * FAILED *
-Invalid data error reading pass pass.com.example.pass/XXXXX. Manifest signature did not verify successfully
-Error Domain=PKPassKitErrorDomain Code=1 "The pass cannot be read because it isn’t valid." UserInfo={NSLocalizedDescription=The pass cannot be read because it isn’t valid., NSUnderlyingError=0x60000086e6d0 {Error Domain=PKPassKitErrorDomain Code=1 "Manifest signature did not verify successfully" UserInfo={NSLocalizedDescription=Manifest signature did not verify successfully}}}.
When I unpack the .pkpass, the signature.exe file is there but it is completely empty.
I can see that its loading the signing key file but then it never seems to get validated.
Code is as follows:
formatVersion : 1,
passTypeIdentifier: 'pass.com.example.pass',
teamIdentifier: 'XXXXXXX',
webServiceURL : "https://example.com",
authenticationToken : "1234567",
organizationName: 'Test',
description: 'example pass'
});
template.loadImagesFrom('./images');
template.fields.barcode = {
'format': 'PKBarcodeFormatPDF417',
'message': '123456789',
'messageEncoding':'iso-8859-1'
};
template.fields.serialNumber = 'E5982H-I2';
template.keys('./keys', 'password');
let pass = template.createPass({
primaryFields: [
{
key: "pass",
label: "Project",
value: "please work"
}
]
});
var file = fs.createWriteStream("Callsheet.pkpass");
pass.on("error", function(error) {
console.error(error);
process.exit(1);
})
pass.pipe(file);
app.get("/newpass", function(request, response) {
pass.render(response, function(error) {
if (error)
console.error(error);
});
});
In the keys folder I have AppleWWDRCA.cer, Certificates.p12, com.example.pass.pem and wwdr.pem
I'm not sure if this where I have gone wrong but any help would be much appreciated
Was a bug in the Passbook library. Fixed using the suggestions from https://github.com/assaf/node-passbook/pull/70

How to handle cloudboost errors in Ionic2?

The error I get when the user fails to log in is "Error: Request failed with status code 401". This error is logged here:
static login(username : string, password : string){
return new Promise(resolve =>{
let user = new CB.CloudUser();
user.set('username', username);
user.set('password', password);
user.logIn({
success: function(user) {
console.log("user");
resolve();
},
error: function(error) {
console.log(error);
resolve(error);
}
});
});
}
But what I need is the error that actually says what went wrong e.g. "invalid username" or "User is not authenticated".
How do I get these?
Error: Request failed with status code 401
This error generally means that the login request you made to the server was not authenticated/ you were not authorized to make the login request. This can mean that the CB instance is not properly initialized. Please check the appId and the master/client key you are using to initialize the CB instance.

Connection time out using local broker

I've downloaded Mosca (^1.1.2), MQTT (via npm) and Paho. When I create a simple broker as shown here: http://thejackalofjavascript.com/getting-started-mqtt/ (last 3 codes). It works all fine. My problem is when I try to implement client in the browser using Paho. with this code:
// Create a client instance
var client = new Paho.MQTT.Client('127.0.0.1', 4883, "clientId-1");
// set callback handlers
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
var options = {
//connection attempt timeout in seconds
timeout: 3,
//Gets Called if the connection has successfully been established
onSuccess: function () {
console.log("onConnect");
client.subscribe("testtopic/#");
},
//Gets Called if the connection could not be established
onFailure: function (message) {
console.log("Connection failed: " + message.errorMessage);
}
};
// connect the client
client.connect(options);
// called when the client connects
function onConnect() {
console.log("onConnect");
client.subscribe("testtopic/#");
}
// called when the client loses its connection
function onConnectionLost(responseObject) {
if (responseObject.errorCode !== 0) {
console.log("onConnectionLost:"+responseObject.errorMessage);
}
}
// called when a message arrives
function onMessageArrived(message) {
console.log(message.payload);
}
I always get this message: "Connection failed: AMQJSC0001E Connect timed out."
When I change '127.0.0.1' to a online broker, it works. So, I'm guessing my problem is with allowing ports in my broker.
Does anyone know how to solve this problem?

Push notification missing messages

I am following the tutorial from this website:
https://blog.engineyard.com/2013/developing-ios-push-notifications-nodejs
to deliver push Notification in my app.
I have successfully created the certificate and other files so far. In the server side, I couldn't pass through the Making the Connection step.
I can get my device token in console while running the app. In the tutorial it is said that, after making the connection the Terminal console should give a output as "gateway connected".
But I am not getting this message. The worst case is I am not getting any error message either. I wonder what went wrong. Even though I got some errors in making the connection first like insufficient credentials, mac verify error, I solved those. Now am neither getting any error nor the correct message.
I also add my Terminal console here
SIVAs-MacBook-Air:~ AAA$ cd Desktop/
SIVAs-MacBook-Air:Desktop AAA$ cd poservices/
SIVAs-MacBook-Air:poservices AAA$ node agent/_header.js
SIVAs-MacBook-Air:poservices AAA$ node agent/_header.js
SIVAs-MacBook-Air:poservices AAA$`
var join = require('path').join
, pfx = join(__dirname, '../_certs/pfx.p12');
/*!
* Create a new gateway agent
*/
var apnagent = require('apnagent')
, agent = module.exports = new apnagent.Agent();
/*!
* Configure agent
*/
agent
.set('pfx file', pfx)
.enable('sandbox');
/*!
* Error Mitigation
*/
agent.on('message:error', function (err, msg) {
connect.log('error1');
switch (err.name) {
// This error occurs when Apple reports an issue parsing the message.
case 'GatewayNotificationError':
console.log('[message:error] GatewayNotificationError: %s', err.message);
// The err.code is the number that Apple reports.
// Example: 8 means the token supplied is invalid or not subscribed
// to notifications for your application.
if (err.code === 8) {
console.log(' > %s', msg.device().toString());
// In production you should flag this token as invalid and not
// send any futher messages to it until you confirm validity
}
break;
// This happens when apnagent has a problem encoding the message for transfer
case 'SerializationError':
console.log('[message:error] SerializationError: %s', err.message);
break;
// unlikely, but could occur if trying to send over a dead socket
default:
console.log('[message:error] other error: %s', err.message);
break;
}
});
/*!
* Make the connection
*/
agent.connect(function (err) {
// gracefully handle auth problems
if (err && err.name === 'GatewayAuthorizationError') {
console.log('Authentication Error: %s', err.message);
process.exit(1);
}
// handle any other err (not likely)
else if (err) {
console.log('error1');
throw err;
}
// it worked!
var env = agent.enabled('sandbox')
? 'sandbox'
: 'production';
console.log('apnagent [%s] gateway connected', env);
});
You need to add
agent.set('passphrase', '<YOUR_PASSWORD>');
after
agent.set('pfx file', pfx).enable('sandbox');

Resources