Re: [reSIProcate] UA replied Bad evet 400 for NOTIFY
Thank Adam, I have found the problem, it's my mistake, I called the h->rejectUpdated(); with onUpdateActive();
Thank you very much.
2008/3/28, Adam Roach <adam@xxxxxxxxxxx>:
What do the resip logs say? Turn them up to DEBUG, and they usually do a
pretty good job of indicating why they're rejecting a message.
That said, there are only a handful of places DUM can return a 400, and
the vast majority of them have custom reason phrases (e.g., "Invalid
auth header" instead of "Bad Request"). The select few that I can find
that use the default phrase (ignoring ones that can't happen to a
NOTIFY) are:
1. Missing Event header field (not the case here)
2. Exception thrown during creation of a dialog (can't happen here,
since the 200 response to the SUBSCRIBE created the dialog)
3. The code you have written called "rejectUpdate()" on the
ClientSubscription without providing a reason phrase.
I don't see any way the code can get to #1 or #2 under the circumstances
you describe -- so I've either missed a case, or it's #3. Please make
sure that your code isn't explicitly triggering the 400 by calling
"rejectUpdate()".
[Related note to others: we should fix #1 and #2 so that they have
explicit reason phrases indicating the error, instead of the default
phrase -- "400" is a pretty frustrating error to troubleshoot; we need
all the help we can get]
/a
Karlsson wrote:
> Hi all, I'm implemented the MWI for my UA:
>
> mMasterProfile->addSupportedMethod(NOTIFY);
> mMasterProfile->addSupportedMethod(SUBSCRIBE);
> mMasterProfile->addSupportedMimeType(NOTIFY,Mime("message", "sipfrag"));
> mMasterProfile->addSupportedMimeType(NOTIFY, Mime("application",
> "simple-message-summary"));
>
> static const Data messageSummaryEvent("message-summary");
> mDum.addClientSubscriptionHandler(messageSummaryEvent, this);
>
> mDum.addOutOfDialogHandler(OPTIONS, this);
> mDum.addOutOfDialogHandler(NOTIFY, this);
>
>
>
> but now, when the server send NOTIFY for MWI to UA, the UA replied 400
> Bad event to server, why ?
>
>
>
> SUBSCRIBE sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx> SIP/2.0
> Via: SIP/2.0/UDP 192.168.1.100:9799
> <http://192.168.1.100:9799>;branch=z9hG4bK-d8754z-9b44050d353a0550-1---d8754z-;rport
> Max-Forwards: 70
> Contact: <sip:testuser1@xxxxxxxxxxxxx:9799>
> To: <sip:testuser1@xxxxxxxxxxxxxx <mailto:sip:testuser1@xxxxxxxxxxxxxx>>
> From: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=3106f05e
> Call-ID: ZGFhYTllMWI2MjViN2ZkODMzODk3OGE1NGU3OWRiYjc.
> CSeq: 1 SUBSCRIBE
> Expires: 3600
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, NOTIFY, REFER,
> REGISTER, SUBSCRIBE, MESSAGE, INFO
> User-Agent: test UA
> Event: message-summary
> Content-Length: 0
>
>
> SIP/2.0 401 Authentication required
> Via: SIP/2.0/UDP 192.168.1.100:9799
> <http://192.168.1.100:9799>;branch=z9hG4bK-d8754z-9b44050d353a0550-1---d8754z-;rport=9799;received=89.3.190.117
> <http://89.3.190.117>
> From: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=3106f05e
> To: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=BC2DF012
> Call-ID: ZGFhYTllMWI2MjViN2ZkODMzODk3OGE1NGU3OWRiYjc.
> CSeq: 1 SUBSCRIBE
> WWW-Authenticate: Digest realm="agora-ip.net
> <http://agora-ip.net>",nonce="B5A48DB7027983857939",opaque="opaqueData",qop="auth",algorithm=MD5
> Server: CommuniGatePro/5.1.16
> Content-Length: 0
>
>
>
> SUBSCRIBE sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx> SIP/2.0
> Via: SIP/2.0/UDP 192.168.1.100:9799
> <http://192.168.1.100:9799>;branch=z9hG4bK-d8754z-2c78902d7418013b-1---d8754z-;rport
> Max-Forwards: 70
> Contact: <sip:testuser1@xxxxxxxxxxxxx:9799>
> To: <sip:testuser1@xxxxxxxxxxxxxx <mailto:sip:testuser1@xxxxxxxxxxxxxx>>
> From: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=3106f05e
> Call-ID: ZGFhYTllMWI2MjViN2ZkODMzODk3OGE1NGU3OWRiYjc.
> CSeq: 2 SUBSCRIBE
> Expires: 3600
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, NOTIFY, REFER,
> REGISTER, SUBSCRIBE, MESSAGE, INFO
> User-Agent: test UA
> Authorization: Digest username="testuser1",realm="agora-
>
> ip.net
> <http://ip.net>",nonce="B5A48DB7027983857939",uri="sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>",response="f99bdaf2e43f15f9f46b494747aec437",cnonce="b3107b241511d162",nc=00000001,qop=auth,algorithm
>
> =MD5,opaque="opaqueData"
> Event: message-summary
> Content-Length: 0
>
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP 192.168.1.100:9799
> <http://192.168.1.100:9799>;branch=z9hG4bK-d8754z-2c78902d7418013b-1---d8754z-;rport=9799;received=89.3.190.117
> <http://89.3.190.117>
> Record-Route: <sip:91.121.112.138:5060 <http://91.121.112.138:5060>;lr>
> From: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=3106f05e
> To: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=6797E07B9B135826
> Call-ID: ZGFhYTllMWI2MjViN2ZkODMzODk3OGE1NGU3OWRiYjc.
> CSeq: 2 SUBSCRIBE
> Expires: 3600
> Contact: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>
> Server: CommuniGatePro/5.1.16
> Content-Length: 0
>
>
>
> NOTIFY sip:testuser1@xxxxxxxxxxxxx:9799 SIP/2.0
> Via: SIP/2.0/UDP 91.121.112.138:5060
> <http://91.121.112.138:5060>;branch=z9hG4bK33456;rport
> Max-Forwards: 69
> From: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=6797E07B9B135826
> To: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=3106f05e
> Call-ID: ZGFhYTllMWI2MjViN2ZkODMzODk3OGE1NGU3OWRiYjc.
> CSeq: 1 NOTIFY
> Subscription-State: active;expires=3600
> Event: message-summary
> Contact: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>
> User-Agent: CommuniGatePro-notify/5.1.16
> Content-Type: application/simple-message-summary
> Content-Length: 95
>
> Messages-Waiting: yes
> Message-Account: sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>
> Voice-Message: 1/1
>
>
> SIP/2.0 400 Bad Request
> Via: SIP/2.0/UDP 91.121.112.138:5060
> <http://91.121.112.138:5060>;branch=z9hG4bK33456;rport=5060
> To: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=3106f05e
> From: <sip:testuser1@xxxxxxxxxxxxxx
> <mailto:sip:testuser1@xxxxxxxxxxxxxx>>;tag=6797E07B9B135826
> Call-ID: ZGFhYTllMWI2MjViN2ZkODMzODk3OGE1NGU3OWRiYjc.
> CSeq: 1 NOTIFY
> User-Agent: test UA
> Content-Length: 0
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxx
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel