Question

Suppose, we have a following dialog:

Agent A                  Agent B
  |                        |
  |   F1 REFER             |
  |----------------------->|
  |        F2 202 Accepted |
  |<-----------------------|
  |        F3 NOTIFY       |
  |<-----------------------|
  |  F4 200 OK             |
  |----------------------->|
  |                        |
  |                        |
  |                        |------->
  |                        |  (whatever)
  |                        |<------
  |                        |
  |         F5 NOTIFY      |
  |<-----------------------|
  |   F6 200 OK            |
  |----------------------->|
  |                        |
  |                        |
  |                        |
  |   F7 REFER             |
  |----------------------->|
  |        F8 202 Accepted |
  |<-----------------------|
  |        F9 NOTIFY       |
  |<-----------------------|
  |  F10 200 OK            |
  |----------------------->|
  |                        |------->
  |                        |  (something different)
  |                        |<------
  |                        |
  |         F11 NOTIFY     |
  |<-----------------------|
  |   F12 200 OK           |
  |----------------------->|
  |                        |
  |                        |

with two REFERs (taken from RFC 3515)

I get the NOTIFY request for each REFER, like this:

NOTIFY sip:192.168.1.39:5062;transport=udp SIP/2.0
Via: SIP/2.0/UDP 192.168.1.249;rport=5060;branch=z9hG4bKyZ09F8gtB6rtQ;received=192.168.1.249
Max-Forwards: 70
From: "Extension 1200" <sip:1200@192.168.1.249>;tag=7ytSSBvaBeN5H
To: <sip:1201@192.168.1.39:5062>;tag=25b9a9ba-f249-4e21-a25a-c2ed578c5101
Call-ID: f94d6be3-edfc-122f-ebb0-000c29da7e39
CSeq: 25832274 NOTIFY
Contact: <sip:mod_sofia@192.168.1.249:5060>
User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-5e4a514 2012-03-10 22-56-29 -0500
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,MESSAGE,UPDATE,INFO,REGISTER,REFER,NOTIFY,PUBLISH,SUBSCRIBE
Supported: timer,precondition,path,replaces
Event: refer;id=1
Allow-Events: talk,hold,presence,dialog,line-seize,call-info,sla,include-session-description,presence.winfo,message-summary,refer
Subscription-State: terminated;reason=noresource
Content-Type: message/sipfrag;version=2.0
Content-Length: 16

SIP/2.0 200 OK

which notifies me, that the REFER was successfull.

The question is: in the NOTIFY, how do I know, for which REFER it is?

Was it helpful?

Solution

From the same RFC:

2.4.6 Multiple REFER Requests in a Dialog

A REFER creates an implicit subscription sharing the dialog identifiers in the REFER request. If more than one REFER is issued in the same dialog (a second attempt at transferring a call for example), the dialog identifiers do not provide enough information to associate the resulting NOTIFYs with the proper REFER.

Thus, for the second and subsequent REFER requests a UA receives in a given dialog, it MUST include an id parameter[2] in the Event header field of each NOTIFY containing the sequence number (the number from the CSeq header field value) of the REFER this NOTIFY is associated with. This id parameter MAY be included in NOTIFYs to the first REFER a UA receives in a given dialog. A SUBSCRIBE sent to refresh or terminate this subscription MUST contain this id parameter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top