Search code examples
linphoneuser-presencemobicentsmobicents-sip-servlets

Mobicents Presence Service: Getting 415 unsupported media type while PUBLISH


I have installed Mobicents Presence Service from here on the mobicents-jainslee-2.7.0.FINAL-jboss-5.1.0.GA on windows 8 and ubuntu.

Now when I try to test softphones (using xlite, Microsip, zoiper, linphone) I see 415 Unsupported Media Type error during PUBLISH messages.

I do not understand the source of this errors. Below is the log:

16:00:30,337 INFO  [SipResourceAdaptor] (SipRA-UDPMessageChannelThread-1) 

Received Request:
PUBLISH sip:xliteold@localhost SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:17244;branch=z9hG4bK-d87543-d04b36288c3d050c-1--d87543-;rport=17244;received=127.0.0.1
Max-Forwards: 70
Contact: <sip:[email protected]:17244>
To: "xliteold" <sip:xliteold@localhost>
From: "xliteold" <sip:xliteold@localhost>;tag=3f34fd3e
Call-ID: 752d47571d600a56ZWE3YmI1YTQwYzg3NGQ3ZTJkN2RmNTNlNjU3M2JiNjY.
CSeq: 1 PUBLISH
Expires: 3600
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO
Content-Type: application/pidf+xml
User-Agent: X-Lite release 1002tx stamp 29712
Event: presence
Content-Length: 736

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<pr:presence xmlns:pr="urn:ietf:params:xml:ns:pidf" entity="sip:xliteold@localhost" xmlns:caps="urn:ietf:params:xml:ns:pidf:caps"
 xmlns:cipid="urn:ietf:params:xml:ns:pidf:cipid" xmlns:counterpath="www.counterpath.com/presence/ext" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model"
xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid"> 
<pr:tuple id="s03543357">
<pr:status>
<pr:basic>open</pr:basic>
</pr:status>
<pr:note>Busy</pr:note>
<rpid:user-input last-input="2015-07-09T15:47:23Z">active</rpid:user-input>
<pr:timestamp>2015-07-09T15:47:23Z</pr:timestamp>
</pr:tuple>
<dm:person id="p5447f306">
<rpid:activities>
<rpid:busy/></rpid:activities>
<dm:note>Busy</dm:note>
</dm:person>
</pr:presence>
16:00:30,347 INFO  [PublicationControlSbb] (pool-26-thread-1) publication for resource sip:xliteold@localhost on event package presence has unsupported media type
16:00:30,352 INFO  [ServerTransactionWrapper] (pool-26-thread-1) ServerTransaction[z9hG4bK-d87543-d04b36288c3d050c-1--d87543-] sending response:
SIP/2.0 415 Unsupported media type
CSeq: 1 PUBLISH
Call-ID: 752d47571d600a56ZWE3YmI1YTQwYzg3NGQ3ZTJkN2RmNTNlNjU3M2JiNjY.
From: "xliteold" <sip:xliteold@localhost>;tag=3f34fd3e
To: "xliteold" <sip:xliteold@localhost>
Via: SIP/2.0/UDP 127.0.0.1:17244;branch=z9hG4bK-d87543-d04b36288c3d050c-1--d87543-;rport=17244;received=127.0.0.1
Accept: application/pidf+xml
Content-Length: 0

I found similar question on Mobicents forum on google groups but that has no resolution. Did anybody has encountered similar error. Please help. EDIT

Message from Different UA:
16:00:00,763 INFO  [SipResourceAdaptor] (SipRA-UDPMessageChannelThread-7) Received Request:
PUBLISH sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:54604;rport=54604;branch=z9hG4bKPjeddbddf5ee4445d5b856bbd51810aa47;received=127.0.0.1
Max-Forwards: 70
From: "microsip" <sip:[email protected]>;tag=bdce197285a740809b1a9b2184184e47
To: "microsip" <sip:[email protected]>
Call-ID: e6e7d585ffdb4cd9a70788e79f6a7d92
CSeq: 52515 PUBLISH
Event: presence
User-Agent: MicroSIP/3.10.1
Content-Type: application/pidf+xml
Content-Length: 555

<?xml version="1.0" encoding="UTF-8"?>
<presence entity="sip:[email protected]" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:
rpid">
 <tuple id="pjd3fc3ef4084b47e294d822dae166ced9">
  <status>
   <basic>open</basic>
  </status>
  <timestamp>2015-07-09T16:00:00.762Z</timestamp>
  <note>Idle</note>
 </tuple>
 <dm:person id="pj079a796fbff64ffb9561d5529d2b0f2d">
  <rpid:activities>
   <rpid:unknown />
  </rpid:activities>
  <dm:note>Idle</dm:note>
 </dm:person>
</presence>

16:00:00,784 INFO  [PublicationControlSbb] (pool-21-thread-1) publication for resource sip:[email protected] on event package presence has unsupported media type
16:00:00,785 INFO  [ServerTransactionWrapper] (pool-21-thread-1) ServerTransaction[z9hG4bKPjeddbddf5ee4445d5b856bbd51810aa47] sending response:
SIP/2.0 415 Unsupported media type
CSeq: 52515 PUBLISH
Call-ID: e6e7d585ffdb4cd9a70788e79f6a7d92
From: "microsip" <sip:[email protected]>;tag=bdce197285a740809b1a9b2184184e47
To: "microsip" <sip:[email protected]>
Via: SIP/2.0/UDP 127.0.0.1:54604;rport=54604;branch=z9hG4bKPjeddbddf5ee4445d5b856bbd51810aa47;received=127.0.0.1
Accept: application/pidf+xml
Content-Length: 0

Thanks.


Solution

  • It is not working since the payload you are sending is not conforming to the xsd of pidf document.(Read answer till the end for explanation)
    
    Try this as the payload, it should work then.... I have verified on mobicents sip-servlets environment(tested it using sipp as the client):
    
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <pr:presence xmlns:pr="urn:ietf:params:xml:ns:pidf" entity="sip:xliteold@localhost" xmlns:caps="urn:ietf:params:xml:ns:pidf:caps"
     xmlns:cipid="urn:ietf:params:xml:ns:pidf:cipid" xmlns:counterpath="www.counterpath.com/presence/ext" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model"
    xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid"> 
        <pr:tuple id="s03543357">
            <pr:status>
                <pr:basic>open</pr:basic>
            </pr:status>
            <rpid:user-input last-input="2015-07-09T15:47:23Z">active</rpid:user-input>
            <pr:note>Busy</pr:note>
            <pr:timestamp>2015-07-09T15:47:23Z</pr:timestamp>
        </pr:tuple>
        <dm:person id="p5447f306">
            <rpid:activities>
                <rpid:busy/>
            </rpid:activities>
            <dm:note>Busy</dm:note>
        </dm:person>
    </pr:presence>
    
    
    I have made one change :
    In <tuple> element I have swapped the positions of:                                                      
    <rpid:user-input last-input="2015-07-09T15:47:23Z">active</rpid:user-input>
    <pr:note>Busy</pr:note>
    
    Moved <note> below user input because...
    If you see definition of <tuple> in pidf.xsd, the contact,note and timestamp elements come in that order and it cant be changed.
    Other elements like <rpid:user-input> in this case need to come after status element and before contact element as can be seen below.  
    
        <xs:complexType name="tuple">
            <xs:sequence>
                <xs:element name="status" type="tns:status" />
                <xs:any namespace="##other" processContents="lax" minOccurs="0"
                    maxOccurs="unbounded" />
                <xs:element name="contact" type="tns:contact" minOccurs="0" />
                <xs:element name="note" type="tns:note" minOccurs="0"
                    maxOccurs="unbounded" />
                <xs:element name="timestamp" type="xs:dateTime" minOccurs="0" />
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required" />
        </xs:complexType>