The NOTIFY should be sent to the Contact from the SUBSCRIBE, not the
Contact from the 202.The 202 and the NOTIFY come from the same place.
The SUBSCRIBE/NOTIFY message flow looks like this:
---SUBSCRIBE--->
<-----202-------
<----NOTIFY-----
------200------>
What does the Contact in your SUBSCRIBE look like?
/a
Xiexin wrote:
When I received 202 Accepted of a SUBSCRIBE, I want to use
the NOTIFY to presence my status, but why the NOTIFY message
destination is the CONTACT header?
Token state;
state.value() = Data("active");
Pidf *doc = new Pidf(Mime("application", "pidf-xml"));
doc->setEntity(aor.uri());
doc->setSimpleStatus(true, stateText.c_str());
Data id = "02EAEC";
doc->setSimpleId(id);
SharedPtr<SipMessage> notify = h->update(doc);
notify->header(h_SubscriptionState) = state;
notify->header(h_SubscriptionState).param(p_expires) = 3600;
Data n = Data::from(*notify);
h->send(notify);
////////////////////////////////////////////////////////////////////////////////////////////////
SIP/2.0 202 Accepted
Via: SIP/2.0/TLS
192.168.1.102:3987;received=118.250.0.244;branch=z9hG4bK-d8754z-11441e2e0d42b33b-1---d8754z-;rport=51723
Contact: <sip:80000013@xxxxxxxxxxxxx:4959;rinstance=3ffdaa0cce0226ad;transport=TLS>
To: <sip:80000013@xxxxxxxxxxxxx:8022>;tag=1b406c29
From: <sip:80000014@xxxxxxxxxxxxx:8022>;tag=e132890a
Call-ID: NmE3NzI0YmY4ZGY1NTg4ZDkzNWFkYjc4NzkzOTI0YTM.
CSeq: 1 SUBSCRIBE
Expires: 3600
User-Agent: VoIP UA
Content-Length: 0
NOTIFY
sip:80000013@xxxxxxxxxxxxx:4959;transport=TLS SIP/2.0
------------------> this is should be sip:80000013@xxxxxxxxxxxxx:8022,
why ?
Via: SIP/2.0/TLS
192.168.1.102:3987;branch=z9hG4bK-d8754z-ce199953cb2a1269-1---d8754z-;rport
Max-Forwards: 70
Contact:
<sip:80000014@xxxxxxxxxxxxx:51723;rinstance=c0137fb25dcc869f;transport=TLS>
To: <sip:80000013@xxxxxxxxxxxxx:8022>;tag=1452bf5d
From: <sip:80000014@xxxxxxxxxxxxx:8022>;tag=ff3e8d00
Call-ID: NGJlMGQxMjNiYTk5NTExMmFjYjI0NDU1NTI5OWM2YzQ.
CSeq: 2 NOTIFY
Content-Type: application/pidf+xml
User-Agent: VoIP UA
Subscription-State: active;expires=3600
Event: presence
Content-Length: 261
<?xml version="1.0" encoding="UTF-8"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf"
entity="sip:80000014@xxxxxxxxxxxxx:8022">
<tuple id="02EABC" >
<status><basic>open</basic></status>
<note>Available</note>
</tuple>
</presence>
_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/
|