reSIProcate/stack  9694
testSdp.cxx
Go to the documentation of this file.
00001 #include "rutil/Logger.hxx"
00002 #include "rutil/DataStream.hxx"
00003 #include "resip/stack/SdpContents.hxx"
00004 #include "resip/stack/HeaderFieldValue.hxx"
00005 #include "rutil/ParseBuffer.hxx"
00006 
00007 #include <iostream>
00008 #include "TestSupport.hxx"
00009 #include "tassert.h"
00010 
00011 using namespace resip;
00012 using namespace std;
00013 
00014 #define RESIPROCATE_SUBSYSTEM Subsystem::TEST
00015 
00016 int
00017 main(int argc, char* argv[])
00018 {
00019     Log::Level l = Log::Debug;
00020     
00021     if (argc > 1)
00022     {
00023         switch(*argv[1])
00024         {
00025             case 'd': l = Log::Debug;
00026                 break;
00027             case 'i': l = Log::Info;
00028                 break;
00029             case 's': l = Log::Stack;
00030                 break;
00031             case 'c': l = Log::Crit;
00032                 break;
00033         }
00034         
00035     }
00036     
00037     Log::initialize(Log::Cout, l, argv[0]);
00038     CritLog(<<"Test Driver Starting");
00039 
00040     {
00041        Data txt("v=0\r\n"  
00042                 "o=VGW 1251901012 1251901012 IN IP4 10.1.83.143\r\n"
00043                 "s=VGW\r\n"
00044                 "c=IN IP4 10.1.83.143\r\n"
00045                 "t=0 0\r\n"
00046                 "a=sendrecv\r\n"
00047                 "a=x-ActiveSpeaker:on\r\n"
00048                 "m=audio 45894 RTP/AVP 103 \r\n"
00049                 "a=rtpmap:103 ISAC/16000/1\r\n"
00050                 "a=fmtp:103 mode=30, type=fixed, bitrate=32000\r\n"
00051                 "a=silenceSupp:off - - - -\r\n");
00052        HeaderFieldValue hfv(txt.data(), txt.size());
00053        Mime type("application", "sdp");
00054        SdpContents sdp(hfv, type);
00055       
00056        assert(sdp.session().media().size() == 1);
00057            assert(sdp.session().media().front().codecs().size() == 1);
00058        CritLog(<< "space at end of m line test passed");
00059     }
00060 
00061     {
00062        Data txt("v=0\r\n"  
00063                 "o=- 333525334858460 333525334858460 IN IP4 192.168.0.156\r\n"
00064                 "s=test123\r\n"
00065                 "c=IN IP4 192.168.0.156\r\n"
00066                 "t=4058038202 0\r\n"
00067                 "m=audio 41466 RTP/AVP 0 101\r\n"
00068                 "a=ptime:20\r\n"
00069                 "a=rtpmap:0 PCMU/8000\r\n"
00070                 "a=rtpmap:101 telephone-event/8000\r\n"
00071                 "a=fmtp:101 0-11\r\n");
00072 
00073        HeaderFieldValue hfv(txt.data(), txt.size());
00074        Mime type("application", "sdp");
00075        SdpContents sdp(hfv, type);
00076       
00077        assert(sdp.session().media().size() == 1);
00078        resip::SdpContents::Session::Codec testCodec("PCMU", 8000, "", "1");
00079        for (std::list<resip::SdpContents::Session::Medium>::const_iterator i = sdp.session().media().begin(); i != sdp.session().media().end(); i++)
00080        {
00081           const std::list<resip::SdpContents::Session::Codec> &codecs = i->codecs();
00082           assert(testCodec == codecs.front());
00083        }
00084 
00085        //assert(sdp.session.getAttributes().count == 2);
00086        CritLog(<< "ftmp test: " << sdp);
00087     }
00088 
00089     {
00090        Data txt("v=0\r\n"  
00091                 "o=- 333525334858460 333525334858460 IN IP4 192.168.0.156\r\n"
00092                 "s=test123\r\n"
00093                 "e=unknown@invalid.net\r\n"
00094                 "p=+972 683 1000\r\n"
00095                 "t=4058038202 0\r\n"
00096                 "m=audio 41466 RTP/AVP 0 101\r\n"
00097                 "c=IN IP4 192.168.0.156\r\n"
00098                 "a=fmtp:101 0-11\r\n"
00099                 "a=ptime:20\r\n"
00100                 "a=rtpmap:101 telephone-event/8000\r\n");
00101 
00102        HeaderFieldValue hfv(txt.data(), txt.size());
00103        Mime type("application", "sdp");
00104        SdpContents sdp(hfv, type);
00105        assert(sdp.session().getPhones().size() == 1);
00106        assert(sdp.session().getEmails().size() == 1);
00107 
00108        assert(Data::from(sdp) == txt);
00109        
00110        CritLog(<< "Email + Phone Test Ok");
00111     }
00112 
00113     {
00114        Data txt("v=0\r\n"
00115                 "o=ViPr 1 1 IN IP4 72.29.231.47\r\n"
00116                 "s=eyeBeam\r\n"
00117                 "i=\"q2\"<sip:q2@host1.marc.sipit.net>\r\n"
00118                 "e=NoEmail@NoEmail.com\r\n"
00119                 "t=0 0\r\n"
00120                 "a=X-app:ViPr 11 ViPrTerminal\r\n"
00121                 "a=X-GUID:4a8f41cc8a50_72.29.231.47_\r\n"
00122                 "a=X-CollabStatus: CollabState_Idle\r\n"
00123                 "m=audio 50958 RTP/AVP 0\r\n"
00124                 "i=\"q2\"<sip:q2@host1.marc.sipit.net>\r\n"
00125                 "c=IN IP4 72.29.231.47\r\n"
00126                 "a=rtpmap:0 PCMU/8000/1\r\n"
00127                 "a=sendrecv\r\n"
00128                 "a=X-app:ViPr 11 ViPrTerminal\r\n"
00129                 "m=video 0 RTP/AVP 32\r\n"
00130                 "c=IN IP4 72.29.231.47\r\n");
00131        
00132 
00133        HeaderFieldValue hfv(txt.data(), txt.size());
00134        Mime type("application", "sdp");
00135        SdpContents sdp(hfv, type);
00136        CritLog ( << sdp.session().media().size());       
00137        assert(sdp.session().media().size() == 2);
00138        
00139        CritLog(<< "Marconi Test Ok");
00140     }
00141 
00142     {
00143        Data txt("v=0\r\n"
00144                 "o=ff_AT_tye.idv.tw 170748954 170754822 IN IP4 202.5.224.96\r\n"
00145                 "s=X-Lite\r\n"
00146                 "c=IN IP4 202.5.224.96\r\n"
00147                 "t=0 0\r\n"
00148                 "m=audio 12000 RTP/AVP 98 101\r\n"
00149                 "a=fmtp:101 0-15\r\n"
00150                 "a=rtpmap:98 iLBC/8000\r\n"
00151                 "a=rtpmap:101 telephone-event/8000\r\n");
00152 
00153        HeaderFieldValue hfv(txt.data(), txt.size());
00154        Mime type("application", "sdp");
00155        SdpContents sdp(hfv, type);
00156        assert(sdp.session().connection().getAddress() == "202.5.224.96");
00157        assert(sdp.session().media().front().port() == 12000);
00158        assert(sdp.session().media().front().getValues("fmtp").front() == "101 0-15");
00159        assert(sdp.session().media().front().getValues("rtpmap").front() == "98 iLBC/8000");
00160        assert(*++sdp.session().media().front().getValues("rtpmap").begin() == "101 telephone-event/8000");
00161 
00162        assert(sdp.session().media().front().codecs().front().getName() == "iLBC");
00163 
00164        CritLog(<< "Ok");
00165     }
00166 
00167     //exit(0);
00168     
00169     {
00170        Data txt("v=0\r\n"
00171                 "o=CiscoSystemsSIP-GW-UserAgent 2087 3916 IN IP4 64.124.66.33\r\n"
00172                 "s=SIP Call\r\n"
00173                 "c=IN IP4 64.124.66.33\r\n"
00174                 "t=0 0\r\n"
00175                 "m=audio 12004 RTP/AVP 0 19\r\n"
00176                 "c=IN IP4 64.124.66.33\r\n"
00177                 "a=rtpmap:0 PCMU/8000\r\n"
00178                 "a=rtpmap:19 CN/8000\r\n");
00179        
00180        HeaderFieldValue hfv(txt.data(), txt.size());
00181        Mime type("application", "sdp");
00182        SdpContents sdp(hfv, type);
00183        assert(sdp.session().connection().getAddress() == "64.124.66.33");
00184        assert(sdp.session().media().front().port() == 12004);
00185     }
00186     
00187     {
00188        Data txt("v=0\r\n"
00189                 "o=1900 369696545 369696545 IN IP4 192.168.2.15\r\n"
00190                 "s=X-Lite\r\n"
00191                 "c=IN IP4 192.168.2.15\r\n"
00192                 "t=0 0\r\n"
00193                 "m=audio 8000 RTP/AVP 8 3 98 97 101\r\n"
00194                 "a=rtpmap:8 pcma/8000\r\n"
00195                 "a=rtpmap:3 gsm/8000\r\n"
00196                 "a=rtpmap:98 iLBC\r\n"
00197                 "a=rtpmap:97 speex/8000\r\n"
00198                 "a=rtpmap:101 telephone-event/8000\r\n"
00199                 "a=fmtp:101 0-15\r\n");
00200 
00201       HeaderFieldValue hfv(txt.data(), txt.size());
00202       Mime type("application", "sdp");
00203       SdpContents sdp(hfv, type);
00204 
00205       assert(sdp.session().media().front().codecs().size() == 5);
00206     }
00207 
00208     {
00209       Data txt("v=0\r\n"
00210                "o=alice 53655765 2353687637 IN IP4 pc33.atlanta.com\r\n"
00211                "s=-\r\n"
00212                "c=IN IP4 pc33.atlanta.com\r\n"
00213                "t=0 0\r\n"
00214                "m=audio 3456 RTP/AVP 0 1 3 99\r\n"
00215                "a=rtpmap:0 PCMU/8000\r\n");
00216       HeaderFieldValue hfv(txt.data(), txt.size());
00217       Mime type("application", "sdp");
00218       SdpContents sdp(hfv, type);
00219 
00220       HeaderFieldValue hfv2(txt.data(), txt.size());
00221       SdpContents sdp2(hfv2, type);
00222 
00223       sdp.session();
00224       sdp2.session();
00225 
00226       Data sdpO = Data::from(sdp);
00227       sdp = sdp2;
00228       Data sdpO2 = Data::from(sdp);
00229 
00230       cerr << "!! " << sdp << endl;
00231       assert(sdpO == sdpO2);
00232     }
00233     
00234     tassert_init(4);
00235     {
00236       Data txt("v=0\r\n"
00237                "o=alice 53655765 2353687637 IN IP4 pc33.atlanta.com\r\n"
00238                "s=-\r\n"
00239                "c=IN IP4 pc33.atlanta.com\r\n"
00240                "t=0 0\r\n"
00241                "m=audio 3456 RTP/AVP 0 1 3 99\r\n"
00242                "a=rtpmap:0 PCMU/8000\r\n");
00243 
00244       HeaderFieldValue hfv(txt.data(), txt.size());
00245       Mime type("application", "sdp");
00246       SdpContents sdp(hfv, type);
00247 
00248       tassert_reset();
00249       
00250       tassert(sdp.session().version() == 0);
00251       tassert(sdp.session().origin().user() == "alice");
00252       tassert(!sdp.session().media().empty());
00253       
00254       //this fails, but should probably not parse(t before c not in sdp)
00255       tassert(sdp.session().media().front().getValues("rtpmap").front() == "0 PCMU/8000");
00256       tassert_verify(1);
00257       
00258    }
00259 
00260    {
00261       const char* txt = 
00262          ("v=0\r\n"
00263           "o=UserA 2890844526 2890844527 IN IP4 here.com\r\n"
00264           "s=Session SDP\r\n"
00265           "c=IN IP4 pc33.atlanta.com\r\n"
00266           "t=5 17\r\n"
00267           "m=audio 49172 RTP/AVP 0\r\n"
00268           "a=rtpmap:0 PCMU/8000\r\n"
00269           "\r\n");
00270 
00271       HeaderFieldValue hfv(txt, strlen(txt));
00272       Mime type("application", "sdp");
00273       SdpContents sdp(hfv, type);
00274       tassert_reset();
00275       tassert(sdp.session().version() == 0);
00276       tassert(sdp.session().origin().user() == "UserA");
00277       tassert(sdp.session().origin().getSessionId() == 2890844526UL);
00278       tassert(sdp.session().origin().getVersion() == 2890844527UL);
00279       tassert(sdp.session().origin().getAddressType() == SdpContents::IP4);
00280       tassert(sdp.session().origin().getAddress() == "here.com");
00281 
00282       tassert(sdp.session().name() == "Session SDP");
00283 
00284       tassert(sdp.session().connection().getAddressType() == SdpContents::IP4);
00285       tassert(sdp.session().connection().getAddress() == "pc33.atlanta.com");
00286       tassert(sdp.session().connection().ttl() == 0);
00287 
00288       tassert(sdp.session().getTimes().front().getStart() == 5);
00289       tassert(sdp.session().getTimes().front().getStop() == 17);
00290       tassert(sdp.session().getTimes().front().getRepeats().empty());
00291       tassert(sdp.session().getTimezones().getAdjustments().empty());
00292 
00293       tassert(sdp.session().media().front().name() == "audio");
00294       tassert(sdp.session().media().front().port() == 49172);
00295       tassert(sdp.session().media().front().multicast() == 1);
00296       tassert(sdp.session().media().front().protocol() == "RTP/AVP");
00297       tassert(sdp.session().media().front().getFormats().front() == "0");
00298 
00299       tassert(sdp.session().media().front().getValues("rtpmap").front() == "0 PCMU/8000");
00300       tassert(sdp.session().media().front().exists("fuzzy") == false);
00301       tassert_verify(2);
00302       
00303    }
00304 
00305    {
00306       const char* txt = ("v=0\r\n"
00307                          "o=CiscoSystemsSIP-GW-UserAgent 3559 3228 IN IP4 192.168.2.122\r\n"
00308                          "s=SIP Call\r\n"
00309                          "c=IN IP4 192.168.2.122\r\n"
00310                          "t=0 0\r\n"
00311                          "m=audio 17124 RTP/AVP 18\r\n"
00312                          "a=rtpmap:18 G729/8000\r\n");
00313 
00314       HeaderFieldValue hfv(txt, strlen(txt));
00315       Mime type("application", "sdp");
00316       SdpContents sdp(hfv, type);
00317       tassert_reset();
00318       tassert(sdp.session().version() == 0);
00319       tassert(sdp.session().origin().user() == "CiscoSystemsSIP-GW-UserAgent");
00320       tassert(sdp.session().origin().getSessionId() == 3559);
00321       tassert(sdp.session().origin().getVersion() == 3228);
00322       tassert(sdp.session().origin().getAddressType() == SdpContents::IP4);
00323       tassert(sdp.session().origin().getAddress() == "192.168.2.122");
00324 
00325       tassert(sdp.session().name() == "SIP Call");
00326 
00327       tassert(sdp.session().connection().getAddressType() == SdpContents::IP4);
00328       tassert(sdp.session().connection().getAddress() == "192.168.2.122");
00329       tassert(sdp.session().connection().ttl() == 0);
00330 
00331       tassert(sdp.session().getTimes().front().getStart() == 0);
00332       tassert(sdp.session().getTimes().front().getStop() == 0);
00333       tassert(sdp.session().getTimes().front().getRepeats().empty());
00334       tassert(sdp.session().getTimezones().getAdjustments().empty());
00335 
00336       tassert(sdp.session().media().front().name() == "audio");
00337       tassert(sdp.session().media().front().port() == 17124);
00338       tassert(sdp.session().media().front().multicast() == 1);
00339       tassert(sdp.session().media().front().protocol() == "RTP/AVP");
00340       tassert(sdp.session().media().front().getFormats().front() == "18");
00341 
00342       tassert(sdp.session().media().front().getValues("rtpmap").front() == "18 G729/8000");
00343       tassert(sdp.session().media().front().exists("fuzzy") == false);
00344       tassert_verify(3);
00345    }
00346    
00347 #if 0 // .slg. removing this test case - attribute order is currently not guaranteed to be mainted
00348    {
00349       tassert_reset();
00350       SdpContents sdp;
00351       unsigned long tm = 4058038202u;
00352       Data address("192.168.2.220");
00353       int port = 5061;
00354    
00355       unsigned long sessionId((unsigned long) tm);
00356    
00357       SdpContents::Session::Origin origin("-", sessionId, sessionId, SdpContents::IP4, address);
00358    
00359       SdpContents::Session session(0, origin, "VOVIDA Session");
00360       
00361       session.connection() = SdpContents::Session::Connection(SdpContents::IP4, address);
00362       session.addTime(SdpContents::Session::Time(tm, 0));
00363       
00364       SdpContents::Session::Medium medium("audio", port, 0, "RTP/AVP");
00365       medium.addFormat("0");
00366       medium.addFormat("101");
00367       
00368       medium.addAttribute("rtpmap", "0 PCMU/8000");
00369       medium.addAttribute("rtpmap", "101 telephone-event/8000");
00370       medium.addAttribute("ptime", "160");
00371       medium.addAttribute("fmtp", "101 0-11");
00372       
00373       session.addMedium(medium);
00374       
00375       sdp.session() = session;
00376 
00377       Data shouldBeLike("v=0\r\n"
00378                         "o=- 4058038202 4058038202 IN IP4 192.168.2.220\r\n"
00379                         "s=VOVIDA Session\r\n"
00380                         "c=IN IP4 192.168.2.220\r\n"
00381                         "t=4058038202 0\r\n"
00382                         "m=audio 5061 RTP/AVP 0 101\r\n"
00383                         "a=fmtp:101 0-11\r\n"
00384                         "a=ptime:160\r\n"
00385                         "a=rtpmap:0 PCMU/8000\r\n"
00386                         "a=rtpmap:101 telephone-event/8000\r\n");
00387 
00388       Data encoded(Data::from(sdp));
00389 
00390       //cout << encoded;
00391       //cout << shouldBeLike;
00392       assert(encoded == shouldBeLike);
00393       tassert_verify(4);
00394    }
00395    tassert_report();
00396 #endif
00397 
00398    {
00399       Data txt("v=0\r\n"
00400                "o=ray.zibman 846934093 1 IN IP4 66.152.249.120\r\n"
00401                "s=phone-call\r\n"
00402                "c=IN IP4 66.152.249.120\r\n"
00403                "b=CT 1000\r\n" // should be CT:1000
00404                "t=0 0\r\n"
00405                "m=audio 12002 RTP/AVP 0 101\r\n"
00406                "a=rtpmap:0 PCMU/8000\r\n"
00407                "a=rtpmap:101 telephone-event/8000\r\n"
00408                "a=fmtp:101 0-16\r\n");
00409 
00410       HeaderFieldValue hfv(txt.data(), txt.size());
00411       Mime type("application", "sdp");
00412       SdpContents sdp(hfv, type);
00413 
00414       try
00415       {
00416          assert(sdp.session().media().front().codecs().size() == 2);
00417          assert(false);
00418       }
00419       catch (ParseException& e)
00420       {
00421          // bad bandwidth
00422       }
00423    }
00424 
00425    {
00426       Data txt("v=0\r\n"
00427                "o=anonymous 1076575175 1076575175 IN IP4 192.168.1.100\r\n"
00428                "s=eConf 4.0\r\n"
00429                "i=eConf 4.0\r\n"
00430                "b=AS:256\r\n"
00431                "t=0 0\r\n"
00432                "m=audio 6000 RTP/AVP 102 104 9 4 0 8 98\r\n"
00433                "a=fmtp:98 0-15\r\n"
00434                "a=rtpmap:102 X-G72x1/16000\r\n"
00435                "a=rtpmap:104 X-G72x24/16000\r\n"
00436                "a=rtpmap:9 G722/8000\r\n"
00437                "a=rtpmap:4 G723/8000\r\n"
00438                "a=rtpmap:0 PCMU/8000\r\n"
00439                "a=rtpmap:8 PCMA/8000\r\n"
00440                "a=rtpmap:98 telephone-event/8000\r\n"
00441                "a=sendrecv\r\n"
00442                "m=video 6002 RTP/AVP 97 98 34 31\r\n"
00443                "b=AS:192\r\n"
00444                "a=fmtp:97 QCIF=1/MaxBR=1920/\r\n"
00445                "a=framerate:25.0\r\n"
00446                "a=fmtp:34 QCIF=1/MaxBR=1920\r\n"
00447                "a=fmtp:31 QCIF=1/MaxBR=1920\r\n"
00448                "a=rtpmap:97 H263-1998/90000\r\n"
00449                "a=rtpmap:98 MP4V-ES/90000\r\n"
00450                "a=rtpmap:34 H263/90000\r\n"
00451                "a=rtpmap:31 H261/90000\r\n"
00452                "a=sendrecv\r\n");
00453 
00454       HeaderFieldValue hfv(txt.data(), txt.size());
00455       Mime type("application", "sdp");
00456       SdpContents sdp(hfv, type);
00457 
00458       assert(sdp.session().information() == "eConf 4.0");
00459       assert(sdp.session().media().size() == 2);
00460    }
00461 
00462 #if 0   //.dcm. -- we don't validate, so this failure isn't something we are
00463         //planning to fix afaik
00464    {
00465       Data txt("v=0\r\n"
00466                "o=alice 53655765 2353687637 IN IP4 pc33.atlanta.com\r\n"
00467                "s=-\r\n"
00468                "t=0 0\r\n"
00469                "c=IN IP4 pc33.atlanta.com\r\n"
00470                "m=audio 3456 RTP/AVP 0 1 3 99\r\n"
00471                "a=rtpmap:0 PCMU/8000\r\n");
00472 
00473       HeaderFieldValue hfv(txt.data(), txt.size());
00474       Mime type("application", "sdp");
00475       SdpContents sdp(hfv, type);
00476 
00477       tassert(sdp.session().version() == 0);
00478       tassert(sdp.session().origin().user() == "alice");
00479       tassert(!sdp.session().media().empty());
00480       //this fails, but should probably not parse(t before c not in sdp)
00481       tassert(sdp.session().media().front().getValues("rtpmap").front() == "0 PCMU/8000");
00482       tassert_verify(5);
00483    }
00484 #endif
00485 
00486 
00487    {
00488       Data txt("v=0\r\n"
00489                "o=CiscoSystemsSIP-GW-UserAgent 4316 2064 IN IP4 65.39.205.114\r\n"
00490                "s=SIP Call\r\n"
00491                "c=IN IP4 65.39.205.114\r\n"
00492                "t=0 0\r\n"
00493                "m=audio 36928 RTP/AVP 0\r\n"
00494                "c=IN IP4 65.39.205.114\r\n"
00495                "a=rtpmap:0 PCMU/8000\r\n"
00496                "m=video 36924 RTP/AVP\r\n"
00497                "c=IN IP4 65.39.205.114\r\n");
00498       
00499       HeaderFieldValue hfv(txt.data(), txt.size());
00500       Mime type("application", "sdp");
00501       SdpContents sdp(hfv, type);
00502 
00503       assert(sdp.session().media().size() == 2);
00504    }
00505 
00506    {
00507       Data txt("v=0\r\n"
00508                "o=test 846934093 1 IN IP4 10.10.10.10\r\n"
00509                "s=SIP Call\r\n"
00510                "c=IN IP4 10.10.10.10\r\n"
00511                "t=0 0\r\n"
00512                "m=audio 12002 RTP/AVP 9 101\r\n"
00513                "a=rtpmap:101 telephone-event/8000\r\n"
00514                "a=fmtp:9 annexb=no\r\n"
00515                "a=fmtp:101 0-16\r\n");
00516 
00517       HeaderFieldValue hfv(txt.data(), txt.size());
00518       Mime type("application", "sdp");
00519       SdpContents sdp(hfv, type);
00520 
00521       assert(sdp.session().media().front().codecs().size() == 2);
00522       assert(sdp.session().media().front().codecs().front().payloadType() == 9);
00523       assert(sdp.session().media().front().codecs().front().parameters() == "annexb=no");
00524       assert(sdp.session().media().front().codecs().back().payloadType() == 101);
00525       assert(sdp.session().media().front().codecs().back().parameters() == "0-16");
00526    }
00527 
00528    {
00529        Data txt("v=0\r\n"
00530                 "o=Dialogic_IPCCLib 147345984 147345984 IN IP4 58.185.204.251\r\n"
00531                 "s=Dialogic_SIP_CCLIB\r\n"
00532                 "i=session information\r\n"
00533                 "c=IN IP4 58.185.204.251\r\n"
00534                 "t=0 0\r\n"
00535                 "m=audio 49172 RTP/AVP 0 101\r\n"
00536                 "a=rtpmap:0 PCMU/8000\r\n"
00537                 "a=fmtp\r\n"
00538                 "a=rtpmap:101 telephone-event/8000\r\n"
00539                 "m=video 57364 RTP/AVP 34\r\n"
00540                 "b=AS:42\r\n"
00541                 "a=rtpmap:34 H263/90\r\n");
00542        
00543 
00544        HeaderFieldValue hfv(txt.data(), txt.size());
00545        Mime type("application", "sdp");
00546        SdpContents sdp(hfv, type);
00547 
00548        assert(sdp.session().media().size() == 2);
00549        assert(sdp.session().media().front().getValues("fmtp").front() == "");
00550        assert(sdp.session().media().front().codecs().size() == 2); // 0 and 101
00551        assert(sdp.session().media().front().codecs().front().parameters().size() == 0);
00552        assert(sdp.session().media().front().codecs().back().parameters().size() == 0);       
00553        
00554        CritLog(<< "Received bad Dialogic fmtp line Ok");
00555     }
00556 
00557    return 0;   
00558 }
00559 
00560 /* ====================================================================
00561  * The Vovida Software License, Version 1.0 
00562  * 
00563  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00564  * 
00565  * Redistribution and use in source and binary forms, with or without
00566  * modification, are permitted provided that the following conditions
00567  * are met:
00568  * 
00569  * 1. Redistributions of source code must retain the above copyright
00570  *    notice, this list of conditions and the following disclaimer.
00571  * 
00572  * 2. Redistributions in binary form must reproduce the above copyright
00573  *    notice, this list of conditions and the following disclaimer in
00574  *    the documentation and/or other materials provided with the
00575  *    distribution.
00576  * 
00577  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00578  *    and "Vovida Open Communication Application Library (VOCAL)" must
00579  *    not be used to endorse or promote products derived from this
00580  *    software without prior written permission. For written
00581  *    permission, please contact vocal@vovida.org.
00582  *
00583  * 4. Products derived from this software may not be called "VOCAL", nor
00584  *    may "VOCAL" appear in their name, without prior written
00585  *    permission of Vovida Networks, Inc.
00586  * 
00587  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00588  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00589  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00590  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00591  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00592  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00593  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00594  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00595  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00596  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00597  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00598  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00599  * DAMAGE.
00600  * 
00601  * ====================================================================
00602  * 
00603  * This software consists of voluntary contributions made by Vovida
00604  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00605  * Inc.  For more information on Vovida Networks, Inc., please see
00606  * <http://www.vovida.org/>.
00607  *
00608  */