0

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:xliteold@127.0.0.1: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:microsip@127.0.0.1 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:microsip@127.0.0.1>;tag=bdce197285a740809b1a9b2184184e47
To: "microsip" <sip:microsip@127.0.0.1>
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:microsip@127.0.0.1" 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:microsip@127.0.0.1 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:microsip@127.0.0.1>;tag=bdce197285a740809b1a9b2184184e47
To: "microsip" <sip:microsip@127.0.0.1>
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.

user3275095
  • 1,605
  • 4
  • 24
  • 36

2 Answers2

2

Faced same issue, moved ahead by commenting out the call to validator in mobicents PS code, rebuilding and deploying it; otherwise could not move ahead as all clients were sending incorrect publish messages.

1
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>
Rahul Prasad
  • 747
  • 1
  • 9
  • 13
  • Thanks, but how do I change the payload? It's being sent by the User agents I am using. – user3275095 Jul 10 '15 at 16:24
  • What you say is true, its a bug in the respective sip soft-phone you are using. Try and see if you can configure it so that the element does not get added in the sip:publish payload. Otherwise use can use sipp to test this scenarios. It is open source, easy to configure and the message and payloads can be configured to test any scenario you want. – Rahul Prasad Jul 10 '15 at 16:28
  • From XML point of view what you are saying seems logical but see below the request from different UA, which does not send rpid: **EDIT** See the edit in question – user3275095 Jul 10 '15 at 17:41
  • Presence server is behaving as expected, the payload in the 2nd Publish is not correct. It has element after element which is again incorrect as per pidf.xsd(see above). should come after . If you make that change then Presence Server will send 200 OK in response – Rahul Prasad Jul 10 '15 at 18:12
  • Sorry buddy, but all these sip soft-phones you are using are sending Publish requests with payload in incorrect format. On receiving Publish message, PS will always validate its payload; if it is incorrectly formed and does not conform to valid xsds -> PS will continue to send 415 response. – Rahul Prasad Jul 10 '15 at 18:21
  • Since you are reluctant to use SIPp, then I would suggest you using EYEBEAM 1.5 by counterpath(but you will have to pay for it). Trust me, I have worked on both MSPS that you are using and developing PS from scratch using Mobicents sip-servlets, it would be impossible for you to test Presence Server w/o SIPp. No RCS client offers all the functionalities that are supported by MSPS. – Rahul Prasad Jul 10 '15 at 18:30
  • Ok. So can you suggest any softphone which works with Mobicents? – user3275095 Jul 10 '15 at 18:32
  • I do not have any issue using SIPp, its just that I do not know how to use it. But I'll try. – user3275095 Jul 10 '15 at 18:34