Extension Status on mobile device

Status
Not open for further replies.

Rashid

New Member
Feb 18, 2023
17
0
1
28
Hi, we are working on the mobile app to make calls from FreeSWITCH via sip.js. when the app is open the extension status is registered and we can able to make calls, but when the app is closed the call is not coming.

How to make extensions always available even the app is closed?
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
You will have to architect it as a service, but ultimately something will still have to be listening 24/7. Commonly how SIP phone developers do it is by creating their own service which is hosted on the internet which registers against the PBX, and then when a call is received, it uses the Apple/Google Push Notification services to tell the app to wake up and register to receive a call. This is also the reason why there's no such thing as a free SIP client (that can reliably receive calls anyway).

Acrobits document how their one works here: https://doc.acrobits.net/sipis/overview.html
 

Rashid

New Member
Feb 18, 2023
17
0
1
28
Actually, I have a service in a server that will trigger the push notification if someone makes the call, but here the issue is the one who call the mobile extension received a user unavailable status while calling. how to overcome this
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
You mean when both the service and the client are registered at the same time? In the local extension dialplan rule, ensure that fail_on_single_reject=false

Your intermediary service will proxy the SIP messages to the endpoint if it's not present. If it is present, then the call will be forked to both service and client.
 

Rashid

New Member
Feb 18, 2023
17
0
1
28
Scenario:
1. Agents A and B are registered via mobile, both can get a call if their mobile app is open.
2. If Agent B is closed and kills the app on mobile. in this state, Agent A is trying to call Agent B.
3. Due to Agent B is not registered, Agent A gets an 'extension is currently unavailable' tone.

How to prevent this like how to make mobile extensions always registered and available..?
 

Rashid

New Member
Feb 18, 2023
17
0
1
28
I am not asking on the mobile side, Is there any possibility in freeswitch to make it always registered here

extension.png
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
Registered to what? It's the client that registers to the server. The client sends information about contact port, source address, expiry time, etc.

If no client is registered, where can FreeSWITCH send the SIP INVITE to?
 

Rashid

New Member
Feb 18, 2023
17
0
1
28
The 3CX Management Console may show a mobile app extension as "registered" even if the mobile app is offline because the extension is registered to the 3CX server itself, not directly to the mobile device. When the mobile app connects to the 3CX server, it registers the extension with the server and receives a temporary token that it uses to authenticate with the server for subsequent requests.

Once the extension is registered with the server, the server will continue to show the extension as "registered" until the registration expires or the server receives an explicit unregister message from the mobile app. This means that even if the mobile app is offline, the extension will still appear as registered in the 3CX Management Console until the registration expires.

Can we do like this freeswitch, coz if the mobile is offline the extension directly cut the call by saying the user is unregistered, even before the push notification is received.
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
Yes.... by implementing an always online proxy service that converts SIP messages to Apple/Google push notifications and then proxies SIP messages through to the device. 3CX uses bespoke tunnelling to create a point-to-point VPN between app and server, historically you used to have to import a Google Firebase key to implement Android push notifications.

This is what is necessary for a SIP based application to work on Android, and iOS. Even more so now on iOS with some recent CallKit changes that Apple implemented.

Here's how a few popular apps do it:

Zoiper, Push Proxy: https://www.zoiper.com/en/support/home/article/205/Zoiper_Push_Proxy
Acrobits SIPIS Proxy: https://doc.acrobits.net/sipis/incoming_calls.html
Bria Push Service: https://docs.counterpath.com/docs/AndUG/clients/UserGuides/Mobile/Reference/mobBriaPushService.htm?TocPath=_____15

This is the reason why you will never find a free and/or open source SIP client that reliably receives inbound calls on mobile. Someone needs to host and maintain this proxy in the middle.
 

Rashid

New Member
Feb 18, 2023
17
0
1
28
So, in order to do that, I must have a proxy server that will keep the mobile sip status always registered by sending proxies SIP messages to the server
 

Rashid

New Member
Feb 18, 2023
17
0
1
28
this is for sip clients only right..?? , coz we use sip.js in the mobile app which is webrtc, for that also we need to use like this..??
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
SIP.js, is a SIP client, that triggers a WebRTC session for the media stream and sends the SIP over a websocket instead of a traditional network socket due to browser sandboxing limitations.

It's a similar concept, only you would need to develop a proxy that speaks websocket to the SIP.js client instead, alongside waking the device, etc.
 

Rashid

New Member
Feb 18, 2023
17
0
1
28
Hi, I have installed Flexisip and Kamailio on two different servers, I can able to get connected to both via the Linphone app, but can't able to make it via SIP.js in browsers, can this work with browsers..?
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
Actually, I have a service in a server that will trigger the push notification if someone makes the call, but here the issue is the one who call the mobile extension received a user unavailable status while calling. how to overcome this
It only works with Google Firebase and Apple Push Service out of the box, and neither of those (if I recall) have the ability to wake up a random browser page and bring it to the foreground. You need to hook it into this service that triggers push notifications as you mentioned above.

To clarify, I don't think what you want has been developed yet, FlexiSIP is designed to work with liblinphone, however you are using SIP.js. So you will need to probably extend FlexiSIP to wake arbitrary SIP.js sessions somehow. Probably a question better for a software development forum like StackOverflow.
 
Status
Not open for further replies.