Video call between an intercom device (SIP) and a web client (WebRTC) - webrtc

I have been reading a lot of SIP/WebRTC documentation and it is not clear to me whether a video call between an intercom device (SIP) and a web client (WebRTC) can be established.
I have researched and played with various VoIP server/frameworks like OverSIP, Asterisk, Kamailio, JSSIP, PJSIP, FreeSwitch, dratchio ... and all I have got is to receive the SIP device call in the server.
The basic flow for the PoC would be as follows:
SIP device (video door entry) initiates call to the server
Server receive the call
The client can contest the videocall using a web page.
The complete flow would be as follows (always the same flow):
SIP device (video door entry) initiates call to the server
Server determine the destination client
Server make a temporal webpage to contest the videocall
Server sends the URL using a notification to client's mobile device (or clients mobiles, in plural)
The mobile receive the notification and open the web page showing the video call
The customer can answer the video call from the web
It's possible? Is there an example or tutorial for help?
Thanks!

Related

APNS handle obtained by Expo in React Native is incorrect

EXPO SDK Version: 42.0.01
Developing for: iOS
Our goal: successfully send a test notification from Test Send tool in Azure Notification Hub to a registered physical iPhone which is running a local instance of an EXPO app.
Progress: we're able to successfully register a physical iPhone with Azure Notification Hub without using a 3rd party library. We can see that registration in the Hub.
Issues: when using the Azure's Test Send tool we're getting an error "The Push Notification System handle for the registration is invalid" and the test notification does not get delivered.
Debugging:
we're using EXPO's Notifications.getDevicePushTokenAsync() API to obtain the push token.
Azure support team analysed the logs and concluded that the problem is the PNS handle i.e. Apple's ID of the phone registered for notifications.
the phone's PNS handle remains the same at all times.
by using "expo credentials:manager" I've added a new Push Notification Key using KeyID, TeamID and .p8 certificate - the PNS handle didn't change after doing that and notifications were failing too.
I haven't found any tools to validate the APNS handle. I'm currently awaiting a .p12 certificate from our corporate team to test notifications by using https://pushtry.com/.
How do we validate the APNS handle and if found that it's invalid - how do we cycle it / request another?
The PNS Handle from APNs does not change that often as it is tied to the device and app installation. See this answer for more details Does the APNS device token ever change, once created?

Is Agora.io able to listen in the background?

Assuming I integrate Agora in my website (PC + mobile hybrid app that wraps a mobile-web site).
Will it be able to listen for users joining a channel while the client is not browsing the website?
Meaning, can it work inside a service worker on both PC and mobile?
I need a reliable way to have voice calls between users on my web application even when they are not using the website.
If you create a WebView or just open an iframe of the website then the user's video is turned off when the app is closed even if the microphone permissions are off.
The user is still on call and can track people joining but as soon as you close the browser, your video stream disappears for the other users.
To have background based workflow, I recommend you use the native SDKs for the app as well as desktop applications and implement them with the same App Id to maintain consistency.
An alternative solution is to use the RTM SDK as the RTM SDK allows you to send messages even in the background if the user is logged in and has joined the channel.

Can we mute remote audio at source while using Agora Web SDK API?

I am working on an application where host needs to mute other participants. I have tried using remotestream.muteAudio() api. But this doesn't mute the audio at source. Which means with this API, if host mutes Participant A it is muted only for the host. But participant B can still hear Participant A.
I went through the API documentation and couldn't find the solution.
https://docs.agora.io/en/faq/API%20Reference/web/interfaces/agorartc.stream.html#muteaudio
Can this be achieved by any ways?
Hi there you need to use the Agora RTM SDK to do that.
You can create an RTM channel with the same name as the RTC channel. Alternatively, You can use P2P messaging(Also present in RTM) if that suits your use case better.
Then the host can send a message to the concerned user to mute. On receiving this message, the user can call the muteAudio on their side, thereby muting the audio at source. All of this would be done programmatically.

Azure IOT Central - Cloud to Device messages using MQTT

My IOT Device is connected to IOT central and am able to receive data through export option.
Now i want to send some command to My device,
For example,
Below json data it is expecting to send heartbeat of device on subscribed URL'devices/....ba50621/messages/devicebound/#'
{ "action": "heartBeat",
"requestId": "b2c3d4e5-3424-4dca-32dc-12b73290cfed"
}
i created service application by refering below links to send Cloud to device message,
Stackoverlow ans and
Sample app
used connection string as,
"HostName=asdasdas.azure-devices.net;DeviceId=asdasdasda50621;SharedAccessKey=nXmyveEPrV....pmo9jULvDtik="
This connection string was received when device got register though dps. i used this on service application to connect. i dont know whether this correct.
When application tried to send message, i got unauthorized error.
In the documentation of above link says to get connection string from shared access policy of IOT hub. but i am using iot central and used above connection string.
Kindl help me fix it.
Cloud to device messaging works a bit different in IoT Central than a plain IoT Hub. Instead of connecting the service client to your IoT Hub, you have to use the IoT Central REST API.
You can either send commands to your device or update a property. The complete documentation including samples are here. You can find the documentation to send commands to your devices here.
In the case when your IoTC App is NOT a legacy application, you can use a preview IoTC App (which is a CapabilityModel driven model type) with the REST APIs support for calling your device. Currently preview version doesn't have a feature what you are trying achieved, such as sending a C2D message to the device.
The IoTC preview supports only calling the device method - Execute Command.
The following screen snippets demonstrated this feature. For this example, I am using my Azure IoT Hub Tester, where the virtual devices are using the MQTT protocol directly to the underlying IoT Hub of the IoT Central App.
I have created a free IoT Central App with the AzureKit ESP32 template, registered and provisioned for device1 and connected from the Azure IoT Hub Tester:
Showing a command echo PnP model:
Invoking a command echo by REST POST call. Note, that the Authorization sastoken must be created in the Administration/API tokens page.
The device1 received the direct call and than published its response (note, that this screen was not snipped for its short response time limit). The following screen snippet shows a complete sync REST call with the device1. Note, that this preview version didn't handle the response payload based on the mentioned document and PnP model.
Finally, this screen snippet shows the history of this command action via the REST:
Note, that there is also missing the response object from the device like is described in the CapabilityModel schema.
UPDATE
I have added the missing screen snippet on the device side when the method echo has been invoked:
As you can see the above picture, the device received the REST POST payload and its published response back to the invoker based on the PnP model schema.
UPDATE 2
The following screen snippets demonstrated invoking a command upgrade for device4. Note, that the device4 is a PnP device created from the template SmartConnect FM-201 IoT Gateway.
The device4 received a message on the direct method upgrade:
The device4 sent the response back to the invoker and IoTC app. The following picture shows its history:
Notice again, there is missing a response object in the REST response and also in the IoTC App. I hope, this is a bug in this preview version and it will fix it soon to follow up the CapabilityModel schema.

Can't receive toast notification in windows phone 8

I'm having problems receiving toast notifications for a Windows Phone 8 application. I did all the steps required:
For the client side, I did this:
Get the channelUri from MPNS
Open the channel
Bind to toast notifications
For the server side, I did this:
Server is written in PHP using this code
Hard-coded the Channel Uri I got in the client app into the PHP code (for testing purposes)
However, when I send the notification from the server, the phone doesn't seem to receive it. Everything runs correctly on the server side and the curl library loads without problems.
I got this!
The problem was in my constructor of the channel. I was doing this to create a new channel:
httpChannel = new HttpNotificationChannel("MyChannel","www.foobar.com");
This constructor should only be called in case of "Authenticated Mode" of push notifications, which requires registering your website and having a certificate.
Obviously, this wasn't my case as I was just testing the push system.
The solution was to create the channel using this:
httpChannel = new HttpNotificationChannel("MyChannel");
It's so misleading as the the official documentation of Windows Phone didn't mention this.