/[resiprocate]/main/resip/stack/test/testRlmi.cxx
ViewVC logotype

Contents of /main/resip/stack/test/testRlmi.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5948 - (show annotations) (download)
Fri Feb 17 15:30:16 2006 UTC (13 years, 8 months ago) by dworley
File MIME type: text/plain
File size: 4884 byte(s)
Setting more svn: properties, and adding EOLs to the ends of files
that need it.

1 #include <iostream>
2 #include <memory>
3
4 #include "resip/stack/MultipartMixedContents.hxx"
5 #include "resip/stack/Rlmi.hxx"
6 #include "resip/stack/SipMessage.hxx"
7 #include "resip/stack/test/TestSupport.hxx"
8 #include "rutil/ParseBuffer.hxx"
9
10 using namespace resip;
11 using namespace std;
12
13 int
14 main()
15 {
16 {
17 const Data txt("NOTIFY sip:terminal.example.com SIP/2.0\r\n"
18 "Via: SIP/2.0/TCP pres.example.com;branch=z9hG4bKMgRenTETmm\r\n"
19 "Max-Forwards: 70\r\n"
20 "From: <sip:adam-buddies@pres.example.com>;tag=zpNctbZq\r\n"
21 "To: <sip:adam@example.com>;tag=ie4hbb8t\r\n"
22 "Call-ID: cdB34qLToC@terminal.example.com\r\n"
23 "CSeq: 997935768 NOTIFY\r\n"
24 "Contact: <sip:pres.example.com>\r\n"
25 "Event: presence\r\n"
26 "Subscription-State: active;expires=7200\r\n"
27 "Require: eventlist\r\n"
28 "Content-Type: application/rlmi+xml;charset=\"UTF-8\"\r\n"
29 "Content-Length: 681\r\n"
30 "\r\n"
31 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
32 "<list xmlns=\"urn:ietf:params:xml:ns:rmli\"\r\n"
33 " uri=\"sip:adam-friends@pres.example.com\" version=\"1\"\r\n"
34 " name=\"Buddy List at COM\" fullState=\"true\">\r\n"
35 " <resource uri=\"sip:bob@example.com\" name=\"Bob Smith\">\r\n"
36 " <instance id=\"juwigmtboe\" state=\"active\"\r\n"
37 " cid=\"bUZBsM@pres.example.com\"/>\r\n"
38 " </resource>\r\n"
39 " <resource uri=\"sip:dave@example.com\" name=\"Dave Jones\">\r\n"
40 " <instance id=\"hqzsuxtfyq\" state=\"active\"\r\n"
41 " cid=\"ZvSvkz@pres.example.com\"/>\r\n"
42 " </resource>\r\n"
43 " <resource uri=\"sip:ed@example.net\" name=\"Ed at NET\" />\r\n"
44 " <resource uri=\"sip:adam-friends@example.org\"\r\n"
45 " name=\"My Friends at ORG\" />\r\n"
46 "</list>\r\n"
47 "\r\n");
48
49 auto_ptr<SipMessage> msg(TestSupport::makeMessage(txt.c_str()));
50
51 Rlmi* rlmi = dynamic_cast<Rlmi*>(msg->getContents());
52
53 assert(rlmi);
54
55 cerr << rlmi->get() << endl;
56 }
57 }
58
59 /* ====================================================================
60 * The Vovida Software License, Version 1.0
61 *
62 * Copyright (c) 2000-2005 Vovida Networks, Inc. All rights reserved.
63 *
64 * Redistribution and use in source and binary forms, with or without
65 * modification, are permitted provided that the following conditions
66 * are met:
67 *
68 * 1. Redistributions of source code must retain the above copyright
69 * notice, this list of conditions and the following disclaimer.
70 *
71 * 2. Redistributions in binary form must reproduce the above copyright
72 * notice, this list of conditions and the following disclaimer in
73 * the documentation and/or other materials provided with the
74 * distribution.
75 *
76 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
77 * and "Vovida Open Communication Application Library (VOCAL)" must
78 * not be used to endorse or promote products derived from this
79 * software without prior written permission. For written
80 * permission, please contact vocal@vovida.org.
81 *
82 * 4. Products derived from this software may not be called "VOCAL", nor
83 * may "VOCAL" appear in their name, without prior written
84 * permission of Vovida Networks, Inc.
85 *
86 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
87 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
88 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
89 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
90 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
91 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
92 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
93 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
94 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
95 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
96 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
97 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
98 * DAMAGE.
99 *
100 * ====================================================================
101 *
102 * This software consists of voluntary contributions made by Vovida
103 * Networks, Inc. and many individuals on behalf of Vovida Networks,
104 * Inc. For more information on Vovida Networks, Inc., please see
105 * <http://www.vovida.org/>.
106 *
107 */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27