> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pgw.sipmicro.services/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Linphone with pgw

> Build the open-source Linphone app with your own push credentials, and set up its SIP account to register through pgw.

Linphone sends RFC 8599 push parameters and registers again when a push wakes it, so it works with pgw without code changes.

## Why the store app doesn't work

Linphone from the App Store or Google Play doesn't work with pgw, because pushes to that app need Belledonne Communications' push credentials. Build the open-source app with your own bundle ID or package name and your own credentials instead.

## Build Linphone with your credentials

> [tab] iOS
>
> 1. In `linphone.xcodeproj`, set your team and a bundle ID under your prefix for the app target and each extension target.
> 2. Change the app group IDs to your own.
> 3. Turn on the **Push Notifications** capability, and the **Voice over IP** and **Remote notifications** background modes.

> [tab] Android
>
> 1. Set your package name in `app/build.gradle.kts`, and copy your `google-services.json` to `app/`.
> 2. In `app/src/main/assets/linphonerc_default`, add your SIP domain to `push_notification_domains` in the `[net]` section.

Register the build in pgw as in [Configure apps for pgw](https://docs.pgw.sipmicro.services/apps/overview.md#register-the-app-in-pgw). For Android, include the project number, as the next section shows.

## Set the Firebase project number

Linphone for Android sends the Firebase project number in `pn-param`, not the project ID. Create its app record with `--fcm-project-number`. Without it, Linphone's REGISTERs get `555 Push Notification Service Not Supported`.

```bash theme={null}
pgw app create --platform android --bundle-id com.example.phone --fcm-project-id example-phone --fcm-project-number 123456789012 --fcm-service-account-file service-account.json
```

## Provision the SIP account

Add the account with the settings in the step "Add the SIP account in the app" of [Configure apps for pgw](https://docs.pgw.sipmicro.services/apps/overview.md#register-the-app-in-pgw). To provision it in a Linphone configuration file instead, use these keys. Key names can change between Linphone releases.

```ini theme={null}
[proxy_0]
reg_identity="Alice" <sip:alice@pbx.example.com>
reg_proxy=<sip:pbx.example.com>
reg_route=<sip:pgw.example.com:5061;transport=tls;lr>
reg_expires=3600
reg_sendregister=1
push_notification_allowed=1
remote_push_notification_allowed=1

[auth_info_0]
username=alice
passwd=<password>
domain=pbx.example.com
```

`push_notification_allowed` turns on VoIP pushes for calls. `remote_push_notification_allowed` turns on the remote pushes that pgw uses for missed calls and registration refreshes.

In managed mode, pgw sends two digest challenges, SHA-256 and MD5. Linphone answers both, and pgw checks the SHA-256 answer.

## Test with a self-signed certificate

When pgw serves a self-signed certificate, as in the [quickstart](https://docs.pgw.sipmicro.services/quickstart.md), Linphone connects only if you build it to skip certificate checks. Before you build Linphone, add these settings to its default settings file, `linphonerc_default` on Android. Replace `pbx.example.com` with the SIP domain that the app registers to.

```ini theme={null}
[sip]
verify_server_certs=0
verify_server_cn=0

[net]
push_notification_domains=pbx.example.com
```

Don't ship a build with these settings. Install a [TLS certificate](https://docs.pgw.sipmicro.services/deploy/tls.md) that apps accept instead.

## Next steps

> [card] [Try it on the Android emulator](https://docs.pgw.sipmicro.services/tutorial-android-emulator.md)
>
> Build Linphone, run pgw on your computer, and receive a call through a real FCM push.

> [card] [Configure an Android app](https://docs.pgw.sipmicro.services/apps/android.md)
>
> Create the Firebase service account and project number that the build needs.

> [card] [Configure an iOS app](https://docs.pgw.sipmicro.services/apps/ios.md)
>
> Create the APNs key that the build needs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.