Attempting To Get BLF Working With Linphone

Home » Asterisk Users » Attempting To Get BLF Working With Linphone
Asterisk Users 9 Comments

So I’ve got a bit further with my  project to get BLF working between asterisk and linphone.

Initially asterisk was rejecting linphone’s SUBSCRIBE messages because they didn’t have an Accept: header. I’ve fixed that and now the initial SUBSCRIBE messages work and I see all my online contacts in green.

But after a few minutes linphone attempts to renew the subscriptions and asterisk is not happy at all:

<--- SIP read from UDP:10.27.128.3:5060 --->
SUBSCRIBE sip:jacques@10.27.128.1:5060 SIP/2.0
Via: SIP/2.0/UDP 10.27.128.3:5060;branch=z9hG4bK.NYP-ux0Zx;rport From: ;tag=iGH81k5xf To: ;tag=as3c7de68c CSeq: 22 SUBSCRIBE
Call-ID: SQOclJgm4O
Max-Forwards: 70
Supported: replaces, outbound Event: presence Expires: 600
Accept: application/pidf+xml Contact:
;+sip.instance=”
User-Agent: Linphone/3.12.0 (belle-sip/1.6.3)
Authorization: Digest realm=”asterisk”, nonce=”188b095b”, algorithm=MD5, username=”john”, uri=”sip:jacques@10.27.128.1:5060″, response=”bdbc7cbac4453fd643050bf28996a68e”

<------------->
— (14 headers 0 lines) –

9 thoughts on - Attempting To Get BLF Working With Linphone

  • The sequence number is from the past. The first SUBSCRIBE is sequence number 22 (check the CSeq header). The second is 20. The third is 21. It appears as though this is from the past, so it receives a 500.

    It doesn’t. The message is for something else, it refers to sequence number
    103.

  • Ok, thanks, that’s clear and obvious.  Now I have to go beat up(*) the linphone people.

    ((*) in the nicest possible way of course).

  • Ok, I’ve had some back and forth with the linphone developers and they contend that although the sequence number on the 2nd and 3rd SUBSCRIBE
    messages start a new sequence this is legal as it is a new conversation
    — the “tag=” on the From has changed.

    Are they right?  (Notice that the tag= from asterisk also changes).

    <--- SIP read from UDP:10.27.128.3:5060 <http://10.27.128.3:5060> —>
    SUBSCRIBE sip:jacques@10.27.128.1:5060 SIP/2.0
    Via: SIP/2.0/UDP 10.27.128.3:5060;branch=z9hG4bK.NYP-ux0Zx;rport From: ;*tag=iGH81k5xf*
    To: ;tag=as3c7de68c CSeq: 22 SUBSCRIBE
    Call-ID: SQOclJgm4O
    Max-Forwards: 70
    Supported: replaces, outbound Event: presence Expires: 600
    Accept: application/pidf+xml Contact:
    ;+sip.instance=”
    User-Agent: Linphone/3.12.0 (belle-sip/1.6.3)
    Authorization: Digest realm=”asterisk”, nonce=”188b095b”, algorithm=MD5, username=”john”, uri=”sip:jacques@10.27.128.1:5060″, response=”bdbc7cbac4453fd643050bf28996a68e”

    <------------->
    — (14 headers 0 lines) –

  • It’s possible. If I recall chan_sip is extremely forgiving with matching things, so it may not have taken that into account.

  • Hi John,

    1. Could you get any further, in your quest for working BLF with linphone ?
    2. Have you tried with a different Linphone version (4.12 is pending on Linux, packaged as an AppImage, or 4.11 exists on iOS/Android/Win10) ?

    Best regards

    Le mer. 25 mars 2020 à 15:06, John Hughes a écrit :

  • The patches to get linphone-3.12 BLF working with Asterisk are here:

    http://perso.calvaedi.com/~john/linphone-3/

    They’re pretty damnned trivial:

    1. add the “Accept” header to the SUBSCRIBE message so asterisk doesn’t reject it.

    2. don’t trash the SIP dialog if the SUBSCRIBE refresh is rejected because of a stale nonce.

    3. If asterisk says the user is on the phone set the status to on the phone.

    All except the 3rd one are compatible with linphone-4. Implementing the same feature with linphone-4 is left as an exercise for the reader.

    Version 4 of linphone is, frankly, rubbish.  I have managed to hack it to the point where presence shows green for connected contact and grey for disconnected.  However this requires setting the “send subscribe”
    flag in the linphone contacts db and linphone 4 has no UI for setting this flag, you have to do it using sqlite3 directly (or setting up your contacts in linphone 3).

  • It seems a new Linphone 4.2 is to be published next week !
    Hopefully, …

    Le ven. 5 juin 2020 à 13:34, John Hughes a écrit :

  • 1. its call history is useless to me, it works very poorly with sip proxying (i.e. asterisk), the design is clunky (no simple list of all calls)

    2. it has no simple busy light support, only the complicated presence stuff that asterisk doesn’t really support well and needs manual intervention.

    3. the Qt interface is “prettier” than the old gtk2 interface but way less complete for telephone functions.