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 themasquerade 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
internalprofile. - 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 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
/etc/freeswitch/sip_profiles/internal.xml, make FreeSWITCH keep a separate registration for each contact: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: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.