Skip to main content
In the default mode, passthrough, a sleeping app must wake up every time its registration at the PBX is about to expire. That works well with registrations of an hour. With a PBX that grants only a few minutes, pgw has to wake every phone every few minutes. That drains batteries, and the app stays reachable only while every one of those pushes arrives. In managed mode, pgw registers at the PBX on the user’s behalf and renews as often as the PBX wants. The app registers with pgw alone, on a schedule that pgw sets.

When to use managed mode

Use managed mode when:
  • Your PBX grants short registrations.
  • You want to ring all of a user’s devices from pgw, with one contact at the PBX.
  • Your apps sign in with a token instead of a SIP password.
Stay with passthrough when you don’t want SIP passwords stored anywhere except the PBX. You choose the mode when you create an upstream, and you can’t change it afterward.

How managed mode works

Example Corp moves user 1001 to managed mode. It gives pgw the password for 1001, which pgw stores encrypted. From then on, the app’s registration with pgw and pgw’s registration at the PBX are separate:
  1. The app registers with pgw. pgw sends the digest challenge itself and checks the answer against the stored password. The app uses the same username and password as before.
  2. pgw registers at the PBX. It sends its own REGISTER, with its own address as the contact and the stored password. The PBX never sees the app’s push token.
  3. pgw keeps renewing. It renews before each grant from the PBX expires, however short the grant is. The app isn’t involved.
Calls work as in passthrough mode: the PBX sends the INVITE to pgw, and pgw wakes the app with a call push. pgw still sends each iOS and Android app a refresh push before the app’s own registration with pgw expires, so that pgw knows the device is alive. Against a PBX with short registrations, these pushes are far less frequent than the refresh pushes of passthrough mode. A late one costs no calls, because the registration at the PBX doesn’t depend on it.

One contact for each user, or one for each device

By default, pgw registers one contact at the PBX for each user, however many devices the user has. When a call arrives, pgw rings all of the user’s devices at once, and the first one to answer takes the call. Use per_user unless a feature of your PBX must act on a single device. To change it, see Set up managed mode.

When pgw removes a device

In managed mode, a registration no longer expires on its own, so pgw decides when a device is gone: The user and the stored password stay. A removed device comes back the next time its app registers.

Settings

Next steps

Set up managed mode

Create a managed upstream and add its users.

Sign in with a Bearer token

Let apps register with a token from your sign-in service.

Kamailio user source

Read the users from Kamailio’s database.