Extensions SIP

1. Introduction

  • Publication et notification d’événements, MWI (SUBSCRIBE, NOTIFY, PUBLISH)
  • Transfert d’appel (REFER)
  • Messagerie Instantannée (MESSAGE)

Le RFC 5359 intitulé “Session Initiation Protocol Service Examples” fournit une suite d’exemples d’applications SIP qui utilisent les méthodes SUBSCRIBE, NOTIFY et REFER.

On trouvera ici une description succincte de ces messages étendus au-delà du RFC 3261 principal.

Enfin, on citera aussi les méthodes MESSAGE, INFO, PRACK et UPDATE.

2. Méthode SUBSCRIBE

RFC 6665 (SIP-Specific Event Notification)

La méthode SUBSCRIBE est utilisée pour créer un abonnement entre une application cliente qui désire obtenir des informations d’un service et le service qui fournit ces informations. Par exemple, un téléphone SIP peut souscrire à un service de messagerie vocale afin d’allumer un MWI (Message Waiting Indicator) en rouge lorsqu’un message est en attente et de l’éteindre quand tous les messages sont lus. Un autre exemple pourrait être un premier intervenant souscrivant à un système d’appel d’urgence pour prendre connaissance de l’appelant de ce service d’urgence. Enfin, une application sur le smartphone d’un médecin peut souscrire à un électrocardiographe pour savoir quand la lecture de l’ECG indique un problème significatif pour le patient.

3. Méthode PUBLISH

RFC 3903 (Session Initiation Protocol (SIP) Extension for Event State Publication)

La méthode PUBLISH est utilisée lorsqu’un service a quelque chose à signaler. Dans notre exemple précédent, un téléphone SIP s’abonne à un service de messagerie vocale. Lorsque ce service de messagerie vocale veut signaler un nouveau message, il envoie un message PUBLISH qui contient des informations sur la messagerie vocale et l’appelant qui l’a quitté. De manière semblable, le service d’urgence enverrait un message PUBLISH lorsque quelqu’un a composé le numéro d’urgence. Ce message de publication contiendrait des informations de base comme le numéro de téléphone de l’appelant, mais il pourrait également contenir ses coordonnées GPS ainsi que l’emplacement d’une caméra vidéo en circuit fermé près de lui. Un message de publication pour l’électrocardiogramme peut contenir le nom du patient, le numéro de sa chambre et la lecture ECG.

4. Méthode NOTIFY

Lorsqu’un utilisateur, un périphérique ou une application s’abonne, il n’envoie pas le message SUBSCRIBE au service auquel il s’inscrit. A la place, il l’envoie à un fournisseur (broker) (par exemple, un Presence Server) qui gère les abonnements de tous les utilisateurs, les périphériques ou les applications peuvent créer pour ce service ou tout autre. Par conséquent, lorsqu’une entité SIP envoie un message PUBLISH, elle n’envoie pas ce message directement à l’abonné. Il parle également au fournisseur d’abonnement. Il incombe au fournisseur d’accepter les messages SUBSCRIBE pour créer des liens entre les abonnés et les services. Lorsque le fournisseur reçoit une publication, il recherche dans sa table de liens pour informer qui s’intéresse aux informations contenues dans le message PUBLISH et envoie les messages NOTIFY aux utilisateurs, aux applications ou aux périphériques. Cela permet à un seul message PUBLISH de générer plusieurs messages de notification lorsque plus d’un abonnement existe pour ce service.

Subscriber          Notifier
       |-----SUBSCRIBE---->|     Request state subscription
       |<-------200--------|     Acknowledge subscription
       |<------NOTIFY----- |     Return current state information
       |--------200------->|
       |<------NOTIFY----- |     Return current state information
       |--------200------->|

5. MWI

Les MWI (Message Waiting Indicator RFC 3842), sont un signal audio ou visuel qui réagit en fonction d’un événement.

Dans cet exemple, téléphone IP d’Alice s’abonne aux messages de statut d’Alice.

Subscriber              Notifier
          |                       |
          |  A1: SUBSCRIBE (new)  |
          |---------------------->|
          |  A2: 200 OK           |
          |<----------------------|
          |                       |
          |  A3: NOTIFY (sync)    |
          |<----------------------|
          |  A4: 200 OK           |
          |---------------------->|
          |                       |
          |                       |
          |  A5: NOTIFY (change)  |
          |<----------------------|
          |  A6: 200 OK           |
          |---------------------->|
          |                       |
          |                       |
          |  A7: (re)SUBSCRIBE    |
          |---------------------->|
          |  A8: 200 OK           |
          |<----------------------|
          |                       |
          |  A9: NOTIFY (sync)    |
          |<----------------------|
          |  A10: 200 OK          |
          |---------------------->|
          |                       |
          |                       |
          |  A11: (un)SUBSCRIBE   |
          |---------------------->|
          |  A12: 200 OK          |
          |<----------------------|
          |                       |
          |  A13: NOTIFY (sync)   |
          |<----------------------|
          |  A14: 200 OK          |
          |---------------------->|

5.1. A1 : Subscriber -> Notifier

“Subscriber” (téléphone d’Alice) -> “Notifier” (Passerelle de boite vocale d’Alice)

Abonnement par Alice aux messages de statut d’Alice pendant 1 jour.

SUBSCRIBE sip:alice@vmail.example.com SIP/2.0
To: <sip:alice@example.com>
From: <sip:alice@example.com>;tag=78923
Date: Mon, 10 Jul 2000 03:55:06 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 4 SUBSCRIBE
Contact: <sip:alice@alice-phone.example.com>
Event: message-summary
Expires: 86400
Accept: application/simple-message-summary
Content-Length: 0

5.2. A2 : Notifier -> Subscriber

“Notifier” -> “Subscriber”

SIP/2.0 200 OK
To: <sip:alice@example.com>;tag=4442
From: <sip:alice@example.com>;tag=78923
Date: Mon, 10 Jul 2000 03:55:07 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 4 SUBSCRIBE
Expires: 86400
Content-Length: 0

5.3. A3 Notifier -> Subscriber

“Notifier” -> “Subscriber”

Synchronisation immédiate de l’état courant : 2 nouveau messages et 8 anciens dont 2 urgents.

NOTIFY sip:alice@alice-phone.example.com SIP/2.0
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 03:55:07 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 20 NOTIFY
Contact: <sip:alice@vmail.example.com>
Event: message-summary
Subscription-State: active
Content-Type: application/simple-message-summary
Content-Length: 99

Messages-Waiting: yes
Message-Account: sip:alice@vmail.example.com
Voice-Message: 2/8 (0/2)

5.4. A4: Subscriber -> Notifier

SIP/2.0 200 OK
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 03:55:08 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 20 NOTIFY
Content-Length: 0

5.5. A5: Notifier -> Subscriber

“Notifier” -> “Subscriber”

Voici la notification d’un nouveau message.

Des en-têtes sont adaptés pour chaque nouveau message ajouté.

NOTIFY sip:alice@alice-phone.example.com SIP/2.0
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 04:28:53 GMT
Contact: <sip:alice@vmail.example.com>
Call-ID: 1349882@alice-phone.example.com
CSeq: 31 NOTIFY
Event: message-summary
Subscription-State: active
Content-Type: application/simple-message-summary
Content-Length: 503

Messages-Waiting: yes
Message-Account: sip:alice@vmail.example.com
Voice-Message: 4/8 (1/2)

To: <alice@atlanta.example.com>
From: <bob@biloxi.example.com>
Subject: carpool tomorrow?
Date: Sun, 09 Jul 2000 21:23:01 -0700
Priority: normal
Message-ID: 13784434989@vmail.example.com

To: <alice@example.com>
From: <cathy-the-bob@example.com>
Subject: HELP! at home ill, present for me please
Date: Sun, 09 Jul 2000 21:25:12 -0700
Priority: urgent
Message-ID: 13684434990@vmail.example.com

5.6. A6: Subscriber -> Notifier

“Subscriber” -> “Notifier”

SIP/2.0 200 OK
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 04:28:53 GMT
Call-ID: 1349882@alice-phone.example.com
CSeq: 31 NOTIFY
Content-Length: 0

5.7. A7: Subscriber -> Notifier

“Subscriber” -> “Notifier”

Rafraîchissement de l’abonnement.

SUBSCRIBE sip:alice@vmail.example.com SIP/2.0
To: <sip:alice@example.com>;tag=4442
From: <sip:alice@example.com>;tag=78923
Date: Mon, 10 Jul 2000 15:55:06 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 8 SUBSCRIBE
Contact: <sip:alice@alice-phone.example.com>
Event: message-summary
Expires: 86400
Accept: application/simple-message-summary
Content-Length: 0

5.8. A8: Notifier -> Subscriber

“Notifier” -> “Subscriber”

SIP/2.0 200 OK
To: <sip:alice@example.com>;tag=4442
From: <sip:alice@example.com>;tag=78923
Date: Mon, 10 Jul 2000 15:55:07 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 8 SUBSCRIBE
Contact: <sip:alice@alice-phone.example.com>
Expires: 86400
Content-Length: 0

5.9. A9: Notifier -> Subscriber

Notifier -> Subscriber

Synchronisation immédiate de l’état courant.

NOTIFY sip:alice@alice-phone.example.com SIP/2.0
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 15:55:07 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 47 NOTIFY
Contact: <sip:alice@vmail.example.com>
Event: message-summary
Subscription-State: active
Content-Type: application/simple-message-summary
Content-Length: 99

Messages-Waiting: yes
Message-Account: sip:alice@vmail.example.com
Voice-Message: 4/8 (1/2)

5.10. A10: Subscriber -> Notifier

SIP/2.0 200 OK
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 15:55:08 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 47 NOTIFY
Contact: <sip:alice@vmail.example.com>

5.11. A11: Subscriber -> Notifier

“Subscriber” -> “Notifier”

Alice retire son abonnement après sa déconnexion.

SUBSCRIBE sip:alice@vmail.example.com SIP/2.0
To: <sip:alice@example.com>;tag=4442
From: <sip:alice@example.com>;tag=78923
Date: Mon, 10 Jul 2000 19:35:06 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 17 SUBSCRIBE
Contact: <sip:alice@alice-phone.example.com>
Event: message-summary
Expires: 0
Accept: application/simple-message-summary
Content-Length: 0

5.12. A12: Notifier -> Subscriber

“Notifier” -> “Subscriber”

SIP/2.0 200 OK
To: <sip:alice@example.com>;tag=4442
From: <sip:alice@example.com>;tag=78923
Date: Mon, 10 Jul 2000 19:35:07 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 17 SUBSCRIBE
Contact: <sip:alice@alice-phone.example.com>
Expires: 0
Content-Length: 0

5.13. A13: Notifier -> Subscriber

Notifier -> Subscriber

Synchronisation immédiate de l’état courant que le “Subscriber” pourrait désormais ignorer.

NOTIFY sip:alice@alice-phone.example.com SIP/2.0
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 19:35:07 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 56 NOTIFY
Contact: <sip:alice@vmail.example.com>
Event: message-summary
Subscription-State: terminated;reason=timeout
Content-Type: application/simple-message-summary
Content-Length: 99
Messages-Waiting: yes
Message-Account: sip:alice@vmail.example.com
Voice-Message: 4/8 (1/2)

5.14. A14: Subscriber -> Notifier

“Subscriber” -> “Notifier”

SIP/2.0 200 OK
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 19:35:08 GMT
Call-Id: 1349882@alice-phone.example.com
CSeq: 56 NOTIFY
Event: message-summary
Content-Length: 0

6. Méthode REFER

La méthode REFER (RFC 3515) peut être utilisée dans un grand nombre d’applications, notamment le transfert d’appel.

Par exemple si Alice est en conversation avec Bob, elle peut donner instruction à son UA d’envoyer une demande SIP REFER au UA de Bob en lui fournissant les information de “Contact” de Carol. En considérant que Bob donne sa permission, le UA de Bob tentera d’appeler Carol en utilisant le “Contact” transmis. Ensuite, l’UA de Bob informera l’UA d’Alice du succès de la tentative.

La méthode REFER indique au récepteur identifié par un “Request-URI” de contacter une ressource tierce en utilisant les informations de “Contact” dans la requête.

Un message NOTIFY donne l’état de la tentative.


Agent A                  Agent B
    |                        |
    |   F1 REFER             |
    |----------------------->|
    |        F2 202 Accepted |
    |<-----------------------|
    |        F3 NOTIFY       |
    |<-----------------------|
    |  F4 200 OK             |
    |----------------------->|
    |                        |
    |                        |
    |                        |------->
    |                        |  (whatever)
    |                        |<------
    |                        |
    |         F5 NOTIFY      |
    |<-----------------------|
    |   F6 200 OK            |
    |----------------------->|
    |                        |
    |                        |

Voici les exemples des messages entre l’ Agent A et l’ Agent B, faisant référence à quelque chose (whatever) que l’ Agent B a réussi. Les détails de cet échange indiquent qu’un REFER particulier intervient en dehors de la session (il n’y pas d’étiquette “Tag” dans le champ “To” de la demande REFER). Si le message REFER intervenait dans la session le “To” serait accompagné d’un “Tag”.

6.1. Premier message (F1)

REFER sip:b@atlanta.example.com SIP/2.0
Via: SIP/2.0/UDP agenta.atlanta.example.com;branch=z9hG4bK2293940223
To: <sip:b@atlanta.example.com>
From: <sip:a@atlanta.example.com>;tag=193402342
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 93809823 REFER
Max-Forwards: 70
Refer-To: (whatever URI)
Contact: sip:a@atlanta.example.com
Content-Length: 0

6.2. Second message (F2)

SIP/2.0 202 Accepted
Via: SIP/2.0/UDP agenta.atlanta.example.com;branch=z9hG4bK2293940223
To: <sip:b@atlanta.example.com>;tag=4992881234
From: <sip:a@atlanta.example.com>;tag=193402342
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 93809823 REFER
Contact: sip:b@atlanta.example.com
Content-Length: 0

6.3. Troisième message (F3)

NOTIFY sip:a@atlanta.example.com SIP/2.0
Via: SIP/2.0/UDP agentb.atlanta.example.com;branch=z9hG4bK9922ef992-25
To: <sip:a@atlanta.example.com>;tag=193402342
From: <sip:b@atlanta.example.com>;tag=4992881234
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 1993402 NOTIFY
Max-Forwards: 70
Event: refer
Subscription-State: active;expires=(depends on Refer-To URI)
Contact: sip:b@atlanta.example.com
Content-Type: message/sipfrag;version=2.0
Content-Length: 20

SIP/2.0 100 Trying

6.4. Quatrième message (F4)

SIP/2.0 200 OK
Via: SIP/2.0/UDP agentb.atlanta.example.com;branch=z9hG4bK9922ef992-25
To: <sip:a@atlanta.example.com>;tag=193402342
From: <sip:b@atlanta.example.com>;tag=4992881234
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 1993402 NOTIFY
Contact: sip:a@atlanta.example.com
Content-Length: 0

6.5. Cinquième message (F5)

NOTIFY sip:a@atlanta.example.com SIP/2.0
Via: SIP/2.0/UDP agentb.atlanta.example.com;branch=z9hG4bK9323394234
To: <sip:a@atlanta.example.com>;tag=193402342
From: <sip:b@atlanta.example.com>;tag=4992881234
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 1993403 NOTIFY
Max-Forwards: 70
Event: refer
Subscription-State: terminated;reason=noresource
Contact: sip:b@atlanta.example.com
Content-Type: message/sipfrag;version=2.0
Content-Length: 16

SIP/2.0 200 OK

6.6. Sixième message (F6)

SIP/2.0 200 OK
Via: SIP/2.0/UDP agentb.atlanta.example.com;branch=z9hG4bK9323394234
To: <sip:a@atlanta.example.com>;tag=193402342
From: <sip:b@atlanta.example.com>;tag=4992881234
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 1993403 NOTIFY
Contact: sip:a@atlanta.example.com
Content-Length: 0

7. Méthode MESSAGE

La méthode MESSAGE (RFC 3428) propose des fonctionnalités de messagerie instantanée (IM). Cette méthode transporte des contenus en format MIME.

8. Méthode INFO

La méthode INFO (RFC 2976) permet d’embarquer des informations de signalisation DTMF, de taxation, signalisation ISDN, etc.

9. Méthode PRACK

Alors qu’un message ACK fait suite à tous les codes de réponses sauf 1XX (codes provisionnels), PRACK (RFC 3262) assure des accusées de réception pour des réponse 180 notamment qui peuvent être critiques.

10. Méthode UPDATE

https://tools.ietf.org/html/rfc3311

Permet de mettre à jour des paramètres de session (codecs) avant qu’elle ne débute.