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

Yehoshua Gev <yoshigev@gmail.com> Mon, 12 October 2020 14:40 UTC

Return-Path: <yoshigev@gmail.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 DAF9C3A1532 for <sipcore@ietfa.amsl.com>; Mon, 12 Oct 2020 07:40:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 fVqsvAF3Oja9 for <sipcore@ietfa.amsl.com>; Mon, 12 Oct 2020 07:40:40 -0700 (PDT)
Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 46D193A14FE for <sipcore@ietf.org>; Mon, 12 Oct 2020 07:40:40 -0700 (PDT)
Received: by mail-vs1-xe31.google.com with SMTP id r24so9250867vsp.8 for <sipcore@ietf.org>; Mon, 12 Oct 2020 07:40:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qFxCqkmMWmTfmIUN0NLi6WgcZROox3th1vTR4G1ULU4=; b=MXpv0IEfCIkZb71hboZoAZlsPxRc/56XdGsLtpwBsjBURsS0SVxIY/pxHrRCWCLpH1 ROGU1HbMsS9RPzBweDUNORXyfamvXg9cDen0b/UyOE66XShIhlXrRU79mA3kUnXXGbYF eHvEplOOba1ATpjlajAtxbL6ExUdFlJcIAn6TijhHw4sH82+/5QQVBDEp/DpbS9l4Z2f 7BGYLzi4GgyXPY1rRaLIt09HFKQjnl/kvJYOu8lfBpXYuVbeHizzd5pHabJYwQdbElwn T3u6C8jhEl0iswl0skv1p76ycYFmw8L+YuKTcM04+WsQFqXXp3pC/EeW7lWCHG6TSkHG TXMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qFxCqkmMWmTfmIUN0NLi6WgcZROox3th1vTR4G1ULU4=; b=iXjQK2/Y1oxNeQMB36dcKrR8zQK+A+nJJYADy5YOhwcIEg+hCTKCuM1Un71qCng7Ue WMMOpQz25sxI9Sb/nu4VsAQQci515Ab/HBl/o2ucssrfCBlc8JXmYsM7EkA6Z5J5T4a8 n8Gz20XiC81/7wvAZkpX91k/zX6a6F9c4UJ8f0tSL/yly9bHXLvOTNl/E34p5ZDYp3GV PnVvOUOuSOU6V4x+CLQrLxrl5yw6S0KFWqlptEiCZcFrPyH7Y+HOVLiCzmSSI1CERr3v ZZZ2TUFo7TM085Ggjg9ovb94VDptDXAXVswtwtnwtEiiwwAaTOVOUgd97s+Y3MffwzbI SssA==
X-Gm-Message-State: AOAM532NoWcu4gyoNS+du/g1N2LXnTDksG/yn5l0HpNpbg7c6g56GK+F p7FK46ITXTyax+LVggRcssfqXeSjURtDpddgRWU=
X-Google-Smtp-Source: ABdhPJykw52EfwOPryIMKV+pUqFw7whssW1amPYQbtO5tlzJ+pXYsOYzGnwKZ+5L4BJ2U/VR4YVCHxMDs6TZfMY2Oq8=
X-Received: by 2002:a67:ef5d:: with SMTP id k29mr10111094vsr.33.1602513639310; Mon, 12 Oct 2020 07:40:39 -0700 (PDT)
MIME-Version: 1.0
References: <CAF_j7yb_UeGsODVz1tYw021XCf7AxZOySLghcgAxa0sHr-ysbw@mail.gmail.com> <CAH_g9RxcXZV8KjaN6boLckKJywrZx_XCPaqEUdFowtHQn8kvkA@mail.gmail.com>
In-Reply-To: <CAH_g9RxcXZV8KjaN6boLckKJywrZx_XCPaqEUdFowtHQn8kvkA@mail.gmail.com>
From: Yehoshua Gev <yoshigev@gmail.com>
Date: Mon, 12 Oct 2020 17:40:28 +0300
Message-ID: <CAF_j7yYZOnqMp=3mf3bgHOb7pLdqe3-JFXdUJf59SK37u_q8nA@mail.gmail.com>
To: Simon MORLAT <simon.morlat@gmail.com>
Cc: sipcore <sipcore@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000380d6105b17a48db"
Archived-At: <https://mailarchive.ietf.org/arch/msg/sipcore/w_0ebCMl27Te3P-ICi5CDtHTQeQ>
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, 12 Oct 2020 14:40:43 -0000

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>
wrote:

> Hi Yehoshua,
>
> Thank you for starting this discussion.
> My company is developing the Linphone software (https://linphone.org), 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
>
> 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> 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
>>
>> _______________________________________________
>> sipcore mailing list
>> sipcore@ietf.org
>> https://www.ietf.org/mailman/listinfo/sipcore
>>
>