< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate-users] Multipart mixed message not getting parsed


You should be building each body separately first.  For examples of building an SDP: see resip/stack/test/testSdp.  For the ISUP body it would be something like (completely untested):

Data isupText("1 0 0 0 0 0 2 b 9 3 10 13 78 19 5 0 0 70 8 83 11 19 24 0 0 44 f");
HeaderFieldValue hfv(isupText.data(), (unsigned int)isupText.size());
MimeType mimeType("application", "ISUP");
OctetContents* isupContents = new OctetContents(isupText);
isupContents->param(p_base) = "chn";
.....
isupContents->header(h_ContentDisposition).value() = "signal; handling=optional";

MultipartMixedContents mixed;
mixed.setBoundary("juno-ivr");
mixed.parts().push_back(sdp);
mixed.parts().push_back(isupContents);

// Create the INVITE
invMessage = mDum.makeInviteSession(target, identityProfile, &mixed, DialogUsageManager::None, 0, this);

Note:  You will need to provide extension parameters for the base and version MimeType parameters as these are not standard.  See the following for help on that:  https://www.resiprocate.org/Use_Overview#Extension_parameters

Scott

On Tue, May 5, 2015 at 6:21 AM, Nihar Junotele <nihar@xxxxxxxxxxxx> wrote:
Hi Scott,

I was trying to make an OBD INVITE with multipart mixed SDP

I tried it in following way:
--juno-ivr
sdp = "Content-Type: application/sdp
            v=0
        o=9845000000 369696545 784166 IN IP4 192.168.10.180
         s=asd_SIP
c=IN IP4 192.168.10.180
t=0 0
m=audio 10004 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

--juno-ivr
Content-Type: application/ISUP; base=chn; version=chnContent-Disposition: signal; handling=optional
1 0 0 0 0 0 2 b 9 3 10 13 78 19 5 0 0 70 8 83 11 19 24 0 0 44 f--juno-ivr--"

txt = new Data(sdp);
hfv = new HeaderFieldValue(txt->data(), txt->size());
Mime type("multipart", "mixed");
type.param(p_boundary) = Data("juno-ivr");
mSdp = new SdpContents(*hfv, type);

dumUac->makeInviteSession(to, mSdp, new testAppDialogSet(*dumUac, "UAC(INVITE)"));


Getting Following error from stack:

'resip::ParseException'
  what():  ParseBuffer.cxx:62, Parse failed expected 'v' in context: Contents

--juno-ivr[CRLF]
^[CRLF]
Content-Type: application/sdp
v=0
o=9845000000 369696545 784166 IN IP4 192.168.10.180
s=JUNO_SIP
c=IN IP4 192.168.10.180
t=0 0
m=audio 10004 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

--juno-ivr
Content-Type: application/ISUP; base=chn; version=chnContent-Disposition: signal; handling=optional
1 0 0 0 0 0 2 b 9 3 10 13 78 19 5 0 0 70 8 83 11 19 24 0 0 44 f--juno-ivr--


Can you please suggest how to construct multi part SDP for INVITE? Is there any example available for this?


 Regards,
 Nihar


On Wed, Apr 29, 2015 at 7:16 PM, Scott Godin <sgodin@xxxxxxxxxxxxxxx> wrote:
You need to do your homework.  : )  There are examples of how to use the API's in the resip/stack/test directory.  In your case you would want to look at testMultipartMixedContents.cxx 

There is no built in parser for  application/ISUP bodies - so they will be returned to you as type OctetContents and you will need to parse the body text (the string of numbers) yourself.  The ParseBuffer class is a good tool for parsing.

Scott 

On Wed, Apr 29, 2015 at 9:38 AM, Nihar Junotele <nihar@xxxxxxxxxxxx> wrote:
I am using SIPP for constructing message. Now I am not getting this error after putting correct length.

Can you please help me out how to extract ISUP data from this INVITE?

Content-Type: application/ISUP; base=chn; version=chn
Content-Disposition: signal; handling=optional

01 00 00 00 00 02 0b 09 03 10 13 78 19 05 00 00 70 08 83 11 19 24 00 00 44 0f 00



 Regards,
 Nihar

JunoTele Solutions Private Limited, 
26/3, 38th Cross, 18th Main Road,
Jayanagar 4th 'T' Block,Bangalore - 560041
T/F: +91-78-46-99-88-77,
Email: 
nihar
@junotele.com


Disclaimer :
The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee(s). If you are not an intended recipient, please delete the message and any attachments and notify the sender immediately. Any use or disclosure of the contents of either is unauthorised and may be unlawful. JunoTele has taken every reasonable precaution to minimize this risk viruses, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment.

On Wed, Apr 29, 2015 at 7:00 PM, Scott Godin <sgodin@xxxxxxxxxxxxxxx> wrote:
It looks to me like the context length is invalid - according to the log statements it is 57 bytes too short and is causing the body to be truncated  (I didn't actually count all the bytes - I'll leave that for you).  

What is the code you are using to construct the message?  The resip stack should be calculating the Content-Length for you if you you are building the message using the typical APIs.

Scott

On Wed, Apr 29, 2015 at 8:58 AM, Nihar Junotele <nihar@xxxxxxxxxxxx> wrote:
Sorry Scott, I am getting following error now

INFO | 20150429-112459.688 |  | RESIP | 1077785408 | SipMessage.cxx:925 | 57 extra bytes after body. Ignoring these bytes.
INFO | 20150429-112459.688 |  | RESIP:DUM | 1077785408 | DialogUsageManager.cxx:1591 | Got: SipReq:  INVITE 31879150000007@192.168.10.180:5060 tid=003c76c552f46557ed7 cseq=6054 INVITE contact=9142000044@192.168.10.180:5065 / 6054 from(wire)
UAS(INVITE): testAppDialogSet: created.
UAS(INVITE): testAppDialogSet: UAS UserProfile requested for msg: SipReq:  INVITE 31879150000007@192.168.10.180:5060 tid=003c76c552f46557ed7 cseq=6054 INVITE contact=9142000044@192.168.10.180:5065 / 6054 from(wire)
UAS(INVITE): testAppDialog: created.
ERR | 20150429-112459.689 |  | RESIP | 1077785408 | Helper.cxx:2146 | ParseException
../../rutil/ParseBuffer.hxx:226, Parse failed unexpected eof in context: Contents

--zx-msce
Content-Type: application/sdp

v=0
o=ZTE-MSCe 14194 14194 IN IP4 192.168.10.180
s=Phone Call via ZTE MSCe
c=IN IP4 ...
t=0 0
m=audio 7882/1 RTP/AVP 96 97 8 12 0 99 100 18 4 98
a=rtpmap:96 EVRC0/8000
a=rtpmap:97 EVRC/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:12 QCELP/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:99 QCELP8K/8000
a=rtpmap:100 IWF/8000
a=rtpmap:18 G729/8000
a=rtpmap:4 G723/8000
a=rtpmap:98 TELEPHONE-EVENT/8000
a=sendrecv

--zx-msce
Content-Type: application/ISUP; base=chn; version=chn
Content-Disposition: signal; handling=optional

01 00 00 00 00 02 0b 09 03 10 13 78 19 0
                                        ^




I am constructing SIP packet as follows for local testing which I actually got from MSC:

<send retrans="500">
<![CDATA[

INVITE sip:31879150000007@192.168.10.180:5060;transport=UDP;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.10.180:5065;branch=z9hG4bK003c76c552f46557ed7
To: <sip:31879150000007@192.168.10.180;user=phone>
From: <sip:9142000044@192.168.10.180;user=phone>;tag=003-57978710321b555210bec-25b57c32
Call-ID: 30384-003010258vx@...
CSeq: 6054 INVITE
Contact: <sip:9142000044@192.168.10.180:5065>
Accept: application/sdp,multipart/mixed,application/dtmf,application/dtmf-relay
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,INFO,REGISTER,PRACK,UPDATE,REFER,NOTIFY
Max-Forwards: 70
MIME-Version: 1.0
Supported: 100rel
User-Agent: ZTE-MSCe
P-Asserted-Identity: <sip:9142000044@..;user=phone>
Content-Type: multipart/mixed;boundary=zx-msce
Content-Length: 619

--zx-msce
Content-Type: application/sdp

v=0
o=ZTE-MSCe 14194 14194 IN IP4 192.168.10.180
s=Phone Call via ZTE MSCe
c=IN IP4 192.168.10.180
t=0 0
m=audio 7882/1 RTP/AVP 96 97 8 12 0 99 100 18 4 98
a=rtpmap:96 EVRC0/8000
a=rtpmap:97 EVRC/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:12 QCELP/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:99 QCELP8K/8000
a=rtpmap:100 IWF/8000
a=rtpmap:18 G729/8000
a=rtpmap:4 G723/8000
a=rtpmap:98 TELEPHONE-EVENT/8000
a=sendrecv

--zx-msce
Content-Type: application/ISUP; base=chn; version=chn
Content-Disposition: signal; handling=optional

01 00 00 00 00 02 0b 09 03 10 13 78 19 05 00 00 70 08 83 11 19 24 00 00 44 0f 00

--zx-msce--

]]>
</send>

Can you please help out what's wrong with the packet I am sending?


 Regards,
 Nihar



On Fri, Apr 24, 2015 at 7:12 PM, Scott Godin <sgodin@xxxxxxxxxxxxxxx> wrote:
You need to tell dum that you will be supporting this body type via the MasterProfile with something like:
m_MasterProfile->addSupportedMimeType(INVITE, Mime("multipart", "mixed")); 

Scott

On Fri, Apr 24, 2015 at 8:52 AM, Nihar Junotele <nihar@xxxxxxxxxxxx> wrote:
Hi,

I am using resiprocate 1.6.

I got an INVITE with following SDP:

Content-Type: multipart/mixed;boundary=zx-msce
Content-Length: 619

--zx-msce
Content-Type: application/sdp
v=0
..........................
--zx-msce
Content-Type: application/ISUP; base=chn; version=chn
Content-Disposition: signal; handling=optional
01 00 00 00
00 02 0b 09 03 10 13 78 19 05 00 00 70
08 83 11 19 24 00 00 44 0f 00
--zx-msce--


Resiprocate cannot parse this SDP. I am getting following error

INFO | 20150424-092303.447 |  | RESIP | 1077785408 | SipMessage.cxx:925 | 53 extra bytes after body. Ignoring these bytes.
INFO | 20150424-092303.447 |  | RESIP:DUM | 1077785408 | DialogUsageManager.cxx:1591 | Got: SipReq:  INVITE 31879150000007@192.168.10.180:5060 tid=003c76c552f46557ed7 cseq=6054 INVITE contact=9142000044@192.168.10.180:5065 / 6054 from(wire)
INFO | 20150424-092303.447 |  | RESIP:DUM | 1077785408 | DialogUsageManager.cxx:1831 | Received an unsupported mime type: multipart/mixed;boundary=zx-msce for SipReq:  INVITE 31879150000007@192.168.10.180:5060 tid=003c76c552f46557ed7 cseq=6054 INVITE contact=9142000044@192.168.10.180:5065 / 6054 from(wire)
INFO | 20150424-092303.940 |  | RESIP | 1077785408 | SipMessage.cxx:925 | 53 extra bytes after body. Ignoring these bytes.
will try to reconnect with hostmgr!!!
INFO | 20150424-092304.946 |  | RESIP | 1077785408 | SipMessage.cxx:925 | 53 extra bytes after body. Ignoring these bytes.
will try to reconnect with hostmgr!!!
register_HostMgr from reconnect attempt!!!
JT_libcomm::register_HostMgr sent PING message to Host Manager
INFO | 20150424-092306.956 |  | RESIP | 1077785408 | SipMessage.cxx:925 | 53 extra bytes after body. Ignoring these bytes.
will try to reconnect with hostmgr!!!
will try to reconnect with hostmgr!!!
INFO | 20150424-092310.977 |  | RESIP | 1077785408 | SipMessage.cxx:925 | 53 extra bytes after body. Ignoring these bytes.



Can anyone please help me. Does resiprocate support Content-Type: multipart/mixed;boundary=zx-msce.?

If yes, please let me know how to add support for multipart.

 Regards,
 Nihar

JunoTele Solutions Private Limited, 
26/3, 38th Cross, 18th Main Road,
Jayanagar 4th 'T' Block,Bangalore - 560041
T/F: +91-78-46-99-88-77,
Email: 
nihar
@junotele.com


Disclaimer :
The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee(s). If you are not an intended recipient, please delete the message and any attachments and notify the sender immediately. Any use or disclosure of the contents of either is unauthorised and may be unlawful. JunoTele has taken every reasonable precaution to minimize this risk viruses, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment.

_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/





_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/