Re: [sipcore] Push notifications with iOS 13 (RFC 8599)

Christer Holmberg <christer.holmberg@ericsson.com> Mon, 19 October 2020 14:42 UTC

Return-Path: <christer.holmberg@ericsson.com>
X-Original-To: sipcore@ietfa.amsl.com
Delivered-To: sipcore@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9A8673A0B01 for <sipcore@ietfa.amsl.com>; Mon, 19 Oct 2020 07:42:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.101
X-Spam-Level:
X-Spam-Status: No, score=-0.101 tagged_above=-999 required=5 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kDsFw4FYYxWR for <sipcore@ietfa.amsl.com>; Mon, 19 Oct 2020 07:42:53 -0700 (PDT)
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2075.outbound.protection.outlook.com [40.107.22.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5A89E3A0AFA for <sipcore@ietf.org>; Mon, 19 Oct 2020 07:42:53 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XXpHsEpYiePnhuSWx3T+EnRbUEr1eH7fSWHJ4NRaaX7HfkTZG2LdpJ5rYEM65uTleGQqP5/Uc8HRdO8yGk0lD+DyhtzCH//kdBQ7d7GQG3qIrrhWGV/TKMXXHz3y+EnBbr9QS9E6BNUv5c1DxHegkusCLpj16+CqBmIZredTApG8HjsrHyrC7IPEaYTSV3Ut0BPh0MpKj/TKcA9gm/n4OnHPH/09+XA4W3iXhdUchJClVVCOIGYiRob63lKsUcmsJ8zBJd1wgc/D43VxxLK/dI3AKKCK/wnWo7Yc7hNflfhNWtmlRXQb6vAtcnCd9d67Q4I5+a5Aggqf8ArgE/smyQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WBik3JMx2WtgPWX9+FVSy2pklLSQikiPIGnyTovuw7U=; b=H0lK5O5K2mX0bMeIss1U+iKCgmmjpYONaBlEjX6MgboLK4+NQZSYvQoLFbGC9qJSsYYqsE1QYiGe+Coc58+0viNzbYaQK54N0IVfFA90fxcxjzDRtyk/rNSkMdcl5vXt3jwCKVZ2VDcAN8oERUo25pnSGuRlSjovicQ7T+xo4Gox7fPf8dSlO/uWZIUMX3Qsegz9zjMnJnft4VWUSYZ7pAg0Rwn96g9iMCJ1xzqZ39uDnZcfJ9GgLB7ZSvqs7PHoAR7GajJoyx3U/CDmlGygiT7mn/cNHEayAqUnnmyu6L/gh0lLQddW0aGXs9uKP4U0TX0oL2mcKE7ODBNC8vnjLw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WBik3JMx2WtgPWX9+FVSy2pklLSQikiPIGnyTovuw7U=; b=fFML1jtuNidYp8FyMKWCI+k+cqvyoC5q91GBGAe5Ta+7F4J2H9k1ksITqaoDs/Kxd6POEe/lB2KbRFRasvbXbKbZ35YHYC1qjlEA2Ti13rJzmpWgB2WiD4pbl40rygobXgxUM5WqkIGtAQgeji2TgiezAh+1rMMVAnKQ6CDgGHI=
Received: from AM0PR07MB3860.eurprd07.prod.outlook.com (2603:10a6:208:4c::18) by AM0PR07MB5380.eurprd07.prod.outlook.com (2603:10a6:208:fc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.11; Mon, 19 Oct 2020 14:42:51 +0000
Received: from AM0PR07MB3860.eurprd07.prod.outlook.com ([fe80::6cc3:4783:280b:d741]) by AM0PR07MB3860.eurprd07.prod.outlook.com ([fe80::6cc3:4783:280b:d741%7]) with mapi id 15.20.3499.015; Mon, 19 Oct 2020 14:42:51 +0000
From: Christer Holmberg <christer.holmberg@ericsson.com>
To: Yehoshua Gev <yoshigev@gmail.com>, Simon MORLAT <simon.morlat@gmail.com>
CC: sipcore <sipcore@ietf.org>
Thread-Topic: [sipcore] Push notifications with iOS 13 (RFC 8599)
Thread-Index: AQHWn+BDUTnEZITSgUW2d71fVS8LKKmS3pmAgAEs5wCAB3f4AIABoZeAgAHk6qA=
Date: Mon, 19 Oct 2020 14:42:50 +0000
Message-ID: <AM0PR07MB3860916523BBCB9EB8614AB1931E0@AM0PR07MB3860.eurprd07.prod.outlook.com>
References: <CAF_j7yb_UeGsODVz1tYw021XCf7AxZOySLghcgAxa0sHr-ysbw@mail.gmail.com> <CAH_g9RxcXZV8KjaN6boLckKJywrZx_XCPaqEUdFowtHQn8kvkA@mail.gmail.com> <CAF_j7yYZOnqMp=3mf3bgHOb7pLdqe3-JFXdUJf59SK37u_q8nA@mail.gmail.com> <CAH_g9RzWD7aiR3Su-e05M5JmtFbQAFvS-xx5-1Ed8UqH83ujJg@mail.gmail.com> <CAF_j7yZkHOWPjYTSaYk4LGqCLSUR+ghGm+MutzrJaM5DxRtRLQ@mail.gmail.com>
In-Reply-To: <CAF_j7yZkHOWPjYTSaYk4LGqCLSUR+ghGm+MutzrJaM5DxRtRLQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=ericsson.com;
x-originating-ip: [188.127.223.154]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 444a351b-fe3a-44f7-7d75-08d8743d4152
x-ms-traffictypediagnostic: AM0PR07MB5380:
x-microsoft-antispam-prvs: <AM0PR07MB5380A0780E6CF8C27C922E4C931E0@AM0PR07MB5380.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: +a+knqOudDa6TfCP8uogdIWkAKFJ/QJiX3mVGHM8fM4etbiya8X5jPACVDFmPpvWss/jP46hytl55HgUncIYJT0f8vfget8ts0IVC5eHivdf2VF2WAtY31mDHBJnbEkZKwoCzXCQ+A4u9E+9JiIqPUhji092/q7Ei4KflIZPK1Ok9glqwwAcHXQYBTfmok8Ws3fiNvlLtqy6DyZXoNizwC1Uku349PxOxqdHNMQBzM9cIBVgNGubXRHmXpA96qSrN6PmlbujvKi1TeTt+6FAs+wtlXgtrDhc5vSRAn1+H361CdZBz/x/6d+9QbbNxNtF9UkZ6euaD7CJ8SCpmcbQuz78aUifZnxHbWrgzvqbkiKrUsprr/9q/SNTZ5i9A6XSD4rN2FYkALTUDSIb6gBxSw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR07MB3860.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(396003)(346002)(39860400002)(52536014)(76116006)(5660300002)(66946007)(66446008)(66556008)(7696005)(6506007)(53546011)(55016002)(64756008)(66476007)(26005)(8936002)(186003)(4326008)(966005)(9686003)(478600001)(8676002)(316002)(110136005)(83380400001)(66574015)(86362001)(2906002)(71200400001)(15650500001)(33656002)(166002)(44832011); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata: cUfH4gAFuJvjfaNTKxAApyYobv6Gt42BsktC5C2CXGcpjB+01i4c53Yw+5ZT5gH89Nh72JFwk8BgRmr3IIN+3eV+TGdL9WTueNekoAE/qsSSzUs37Lz1zAljtDHQxDic91ysr01JQRCFEeKfkk0+ifxRitPaAlLBQYBtsV8yLQNl7zf1IGcml8KpYNzzVqw4jno36cvyL+vhTjAuXU8baX6KTgzkR7/mqUGnNzLRQOyquBepTxJEXRBrA9iBASSnRQ5bWVfHM3wPA7uz9zYrKQc+F8AGN1GaVxTHQyWTKUdXkaKGfE46vaNGHKI9ktlDh8vYWrOQYQOhVSblAx7qvGPCU1RRAEKxIiIN+Q1qeq2o2OyxTGC30v1L77k/AW+MRBJO1zlVzcnX1vnqrdgpGm3iWPziWaujAoXdtSNc6fPsrDQH7LRJ1slnrrTR0b4y+TDJYFw9H4Wyk0pzEpoTFS3t9l3poeIGRM1An6j4QdqQykTdsGYPMB1m0NhlDzrZ3bTxBeHEgd0Q/sKEr11Rck5UVkllUNXajBupc60CS6H/3nG4vHEyfYqrHGv0YX6sOjh1mabd2ZD7IHQxcpOojT0J2/SMz77h1QTuv5KwK9/Fvb1qdKdiLltvFkuxRkvchJEDDg+nVxtbBypbziJSvQ==
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_AM0PR07MB3860916523BBCB9EB8614AB1931E0AM0PR07MB3860eurp_"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM0PR07MB3860.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 444a351b-fe3a-44f7-7d75-08d8743d4152
X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2020 14:42:51.0007 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ZYDikprAAWht/HqwJ9Ne4Rg0EFS52PJv/YzgAzznSQpHrtOR87nzeix+ObRTJ5wvdvNTrFGqJyUlWx76e/wAu0eiB7S/GEaOcqTv0M/nTjA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB5380
Archived-At: <https://mailarchive.ietf.org/arch/msg/sipcore/qrCgUEydsb2xMCJ26i9f8cGthrk>
Subject: Re: [sipcore] Push notifications with iOS 13 (RFC 8599)
X-BeenThere: sipcore@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SIP Core Working Group <sipcore.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sipcore>, <mailto:sipcore-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/sipcore/>
List-Post: <mailto:sipcore@ietf.org>
List-Help: <mailto:sipcore-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sipcore>, <mailto:sipcore-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 19 Oct 2020 14:42:58 -0000

Hi,

Whatever the solution is, it has to be backward compatible, in order to minimize the impacts on existing deployments.

Without having thought too much about it, one straight forward solution would be to define new pn- parameters for non-VoIP push notifications. I assume we would need new pn- parameters for pn-param and pn-prid.

Regards,

Christer

From: sipcore <sipcore-bounces@ietf.org> On Behalf Of Yehoshua Gev
Sent: sunnuntai 18. lokakuuta 2020 12.38
To: Simon MORLAT <simon.morlat@gmail.com>
Cc: sipcore <sipcore@ietf.org>
Subject: Re: [sipcore] Push notifications with iOS 13 (RFC 8599)

Thanks.

So what should be the inputs to the logic that decides which push type to use?
Would method + media types (of the SDP m= line) suffice?
Or maybe just pre-defined types (voice, voice+video?, message and register) with pre-defined proxy logic for choosing between them?

Do you think we could come up with a format that will be general and not Apple-specific?
Is there interest in the group for this?

Yehoshua

On Sat, Oct 17, 2020 at 11:44 AM Simon MORLAT <simon.morlat@gmail.com<mailto:simon.morlat@gmail.com>> wrote:
Hi Yehoshua,

Let me answer your questions.

* The pn-param is used by the proxy to know the application ID, which is necessary to know which credentials or TLS client certificate to connect to the Apple push server. The voip&remote advertise that the app understands both voip and remote push notifications, and as such two certificates/credentials should be available to the server for this.

1. Yes. I saw your other suggestion, which is indeed more readable, but breaks compatibility with RFC8599 .

2. The proxy has forcibly some platform specific logic to handle push notifications. It cannot be unaware that for Apple platform, the "voip" type must only be used for calls. Note that it is not a question of SIP method, because SIP INVITE can be used to establish chat sessions with MSRP protocol for example, and in this case a "voip" type notification must not be used.

3. It could indeed, however it discloses information to push notification servers. In linphone, we do not pass it for this reason. Instead, the CallKit view is subsequently updated to display the caller-id once the INVITE has arrived (which usually takes no more than a few seconds).

The background updates push notifications (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app?language=objc) are reliable. They are indeed rate limited (3 per hour) which makes them unsuitable to advertise calls or incoming messages. But in order to trigger a REGISTER request it's good enough, and they do not require to show something to the user: the work silently.
To make the system reliable, I imagine the registrar could send a background push notification at 80 % of expire time, and then once a day during a guard period of XX days in order to give additional chances for apps that temporarily have no longer access to the network to finally refresh their registration.

Best regards,

Simon


Le lun. 12 oct. 2020 à 16:40, Yehoshua Gev <yoshigev@gmail.com<mailto:yoshigev@gmail.com>> a écrit :
Hi Simon,

Thanks for your detailed explanation of the behavior you have implemented.

One Q: How is the "pn-param=DEF123GHIJ.org.linphone.phone.voip&remote" used?
Does the server really make use of the "&remote" suffix or it can be used like "DEF123GHIJ.org.linphone.phone.*" with the "*" being always replaced with the service?

In any case, I'm willing to help with work on a new RFC, but sadly I don't have much time for it.

Regarding the scope of the updated RFC, I think there are several issues that should be addressed:

1. How the UA passes several "pn-*"-sets for a single registration. The solution you've done on Linphone seems like a good approach if backward compatibility with RFC 8599 is required.

2. How would the proxy decide which pn-*-values-set to use for a specific push notification? For example, a naive approach is to pre-define a mapping between "pr-*"-set and SIP methods (i.e., INVITE will use a "voip" params).

3. (maybe unrelated) For good user experience, the caller-id should be passed along with the voip push notification so the UI of incoming calls can display it immediately.

BTW, regarding triggering of registration refreshes, our iOS developers say that in order for a push notification to work reliably (i.e., assured to be processed by the application even if it is terminated), it must have some UI notification. This means that the user will be informed of each registration refresh. If this is true, then the expiry time must be kept very long (weeks/months) in any case. Is this also your understanding?


Yehoshua


On Sun, Oct 11, 2020 at 11:43 PM Simon MORLAT <simon.morlat@gmail.com<mailto:simon.morlat@gmail.com>> wrote:
Hi Yehoshua,

Thank you for starting this discussion.
My company is developing the Linphone software (https://linphone.org<https://protect2.fireeye.com/v1/url?k=7f8ad100-212a1345-7f8a919b-8692dc8284cb-5a8c1a2833f5db51&q=1&e=eea69fa0-bdd8-4e64-be1e-fc992ce3c3b2&u=https%3A%2F%2Flinphone.org%2F>), an cross platform open-source SIP softphone and SDK.
The last version we published was for adding compatibility for iOS 13. I admit it was a nightmare to comply with the new restrictions.
For push notifications, we based our work on RFC 8599 , but indeed we had to somewhat extend the RFC in order to transmit 2 different push notification tokens:
- the one for calls (PushKit kind of notifications)
- the one for IMs (using Remote push notification service).

To answer your question: the "remote push notification" token could apparently also be used for "Background push notifications" (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app?language=objc ), which are the push notifications we need to refresh a REGISTER that is about to expire (or expired). So yes you need two different push services and tokens.

As of today, the Linphone app doesn't use push notifications for triggering REGISTER refreshes: we use a very long expire time (one year) instead. However we would prefer to switch to push-triggered REGISTER refresh as soon as possible.

The syntax extension we made to RFC8599 is described in our wiki:

https://wiki.linphone.org/xwiki/wiki/public/view/Lib/Getting%20started/iOS/#HUpdateContactURIparameters<https://protect2.fireeye.com/v1/url?k=434f8a76-1def4833-434fcaed-8692dc8284cb-995c031be5ab3584&q=1&e=eea69fa0-bdd8-4e64-be1e-fc992ce3c3b2&u=https%3A%2F%2Fwiki.linphone.org%2Fxwiki%2Fwiki%2Fpublic%2Fview%2FLib%2FGetting%2520started%2FiOS%2F%23HUpdateContactURIparameters>

We designed this syntax to be compatible with RFC8599 syntax. To summarize, here is a quick example to understand how we convey push tokens for an app that needs to advertise calls and IMs:

pn-prid=00fc13adff78512:voip&c11292f7b74733d:remote;pn-param=DEF123GHIJ.org.linphone.phone.voip&remote;pn-provider=apns

Notice the ":voip" and ":remote" token suffixes, and the "&".
We decided not to go with a multiple contact headers approach, each contact uri bearing a pn-prid for either voip or remote service: the forking by a proxy that is unaware of push notifications could result in INVITEs to be duplicated.

We had to go fast otherwise our app would stop working, but from the beginning we have in mind that this issue should be raised and hopefully resolved here at IETF, with or without our proposed syntax extension.

Today due to Apple's recent changes, it looks like RFC8599 cannot be used "as is" to make a SIP app for iOS. The risk that Google does the same in near future exists.
Are there people interested here in collaborating to an RFC8599 update to address this iOS platform evolution ? In other words, we need to solve how to convey multiple pn-prid and pn-param for a same user-agent instance.

Best regards,

Simon







Le dim. 11 oct. 2020 à 17:07, Yehoshua Gev <yoshigev@gmail.com<mailto:yoshigev@gmail.com>> a écrit :
Hi All,

I hope it is ok to post this here and not on sip-implementors...

We are trying to implement RFC 8599 for performing push notifications for Apple devices.

Starting with iOS 13, there is a restriction on VoIP pushes [1]: "Apps receiving VoIP push notifications must report the call quickly to CallKit, so it can alert the user to the presence of the incoming call."

According to RFC 8599, pushes are used for (at least) two different goals:
  1) Initiating registration refreshes (section 5.5)
  2) Notifying of incoming calls (section 5.6.2)

Now, for a reasonable user experience, the registration refresh pushes must not trigger the UI of incoming call.
However, when an INVITE is received, the UA must be awoken immediately, which is the purpose of VoIP push.

Does it make sense to make a different push type for registration refresh and for incoming calls?

I'm not sure this is possible with the current RFC (and it is also against the spirit of the RFC), but I can't think of another way around it (besides using regular pushes instead of VoIP pushes, which might introduce delays, or having a registration with infinite expiration that will not require refreshes, which might leave many zomby registrations).

See some discussion here: [2], [3].

Thanks,
Yehoshua

[1] https://developer.apple.com/documentation/pushkit/pkpushtype/1614481-voip
[2] https://developer.apple.com/forums/thread/117939
[3] https://www.linphone.org/news/ios-13-important-changes-voipim-apps<https://protect2.fireeye.com/v1/url?k=c352f674-9df23431-c352b6ef-8692dc8284cb-84d24c839a3287cd&q=1&e=eea69fa0-bdd8-4e64-be1e-fc992ce3c3b2&u=https%3A%2F%2Fwww.linphone.org%2Fnews%2Fios-13-important-changes-voipim-apps>

_______________________________________________
sipcore mailing list
sipcore@ietf.org<mailto:sipcore@ietf.org>
https://www.ietf.org/mailman/listinfo/sipcore