Skip to main content
When you finish this page, FreeSWITCH accepts registrations that arrive through pgw and sends the calls for those devices back to pgw. FreeSWITCH needs no module and no patch.

How FreeSWITCH routes calls to pgw

pgw normally asks a PBX to route calls through it with a Path header. FreeSWITCH ignores Path, so it would send each call straight to the phone, which is asleep. With the masquerade contact strategy, pgw registers its own address as the device’s contact. FreeSWITCH then sends every call for the device to pgw, and pgw knows from the contact which device the call is for.

Before you begin

  • FreeSWITCH with a SIP profile that your users register to. The examples use the internal profile.
  • The addresses that FreeSWITCH sends calls from. See Allow the PBX to send calls to pgw.

Configure the SIP profile

1

Create the upstream with masquerade

You choose the contact strategy when you create the upstream, and you can’t change it later:
If you already created the upstream without masquerade, delete it with pgw upstream delete --id <id> --force and create it again. --force also removes the upstream’s devices from pgw, and they return when their apps next register.
2

Allow several contacts for each user

By default, a new registration for a user replaces the previous one, so a second device would log the first one out. In the profile, such as /etc/freeswitch/sip_profiles/internal.xml, make FreeSWITCH keep a separate registration for each contact:
In managed mode, pgw by default registers one contact for each user and rings the devices itself, so you can skip this step unless the upstream uses per_device.
3

Restart the profile

The restart ends the calls in progress on the profile, so choose a quiet moment.

Check that it works

Register the app through pgw, then list pgw’s bindings:
The list shows a binding for the account. Close the app and call the account from another phone. The app rings.

If it doesn’t work

For other symptoms, see Troubleshooting.

Next steps

Configure apps for pgw

Register your app’s push credentials, so that pgw can wake the app.

Managed mode

Let pgw check passwords and renew each registration at FreeSWITCH.