93 lines
2.7 KiB
C
93 lines
2.7 KiB
C
/*
|
|
* Copyright (C) 2009 Mamadou Diop.
|
|
*
|
|
* Contact: Mamadou Diop <diopmamadou(at)yahoo.fr>
|
|
*
|
|
* This file is part of Open Source Doubango Framework.
|
|
*
|
|
* DOUBANGO is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* DOUBANGO is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with DOUBANGO.
|
|
*
|
|
*/
|
|
#ifndef _TEST_SESSIONS_H_
|
|
#define _TEST_SESSIONS_H_
|
|
|
|
#define SDP_RO \
|
|
"v=0\r\n" \
|
|
"o=alice 2890844526 2890844526 IN IP4 host.atlanta.example.com\r\n" \
|
|
"s=\r\n" \
|
|
"i=A Seminar on the session description protocol\r\n" \
|
|
"u=http://www.example.com/seminars/sdp.pdf\r\n" \
|
|
"e=j.doe@example.com (Jane Doe)\r\n" \
|
|
"p=+1 617 555-6011\r\n" \
|
|
"c=IN IP4 host.atlanta.example.com\r\n" \
|
|
"b=X-YZ:128\r\n" \
|
|
"z=2882844526 -1h 2898848070 0\r\n" \
|
|
"k=base64:ZWFzdXJlLg==\r\n" \
|
|
"t=3034423619 3042462419\r\n" \
|
|
"r=7d 1h 0 25h\r\n" \
|
|
"r=604800 3600 0 90000\r\n" \
|
|
"w=my dummy header\r\n" \
|
|
"m=audio 49170 RTP/AVP 0 8 97 98\r\n" \
|
|
"i=Audio line\r\n" \
|
|
"c=IN IP4 otherhost.biloxi.example.com\r\n" \
|
|
"k=base64:ZWFzdXJlLgdddddddddddddddddddddd==\r\n" \
|
|
"a=rtpmap:0 PCMU/8000\r\n" \
|
|
"a=rtpmap:8 PCMA/8000\r\n" \
|
|
"a=rtpmap:97 iLBC/8000\r\n" \
|
|
"a=rtpmap:98 AMR-WB/16000\r\n" \
|
|
"a=fmtp:98 octet-align=1\r\n" \
|
|
"m=video 51372 RTP/AVP 31 32\r\n" \
|
|
"i=Video line\r\n" \
|
|
"b=A-YZ:92\r\n" \
|
|
"b=B-YZ:256\r\n" \
|
|
"a=rtpmap:31 H261/90000\r\n" \
|
|
"a=rtpmap:32 MPV/90000\r\n" \
|
|
"a=recvonly\r\n" \
|
|
"m=toto 51372 RTP/AVP 31 32\r\n" \
|
|
"i=Video line\r\n" \
|
|
"b=A-YZ:92\r\n" \
|
|
"b=B-YZ:256\r\n" \
|
|
"a=rtpmap:31 H261/90000\r\n" \
|
|
"a=rtpmap:32 MPV/90000\r\n" \
|
|
"a=recvonly\r\n"
|
|
|
|
void test_sessions()
|
|
{
|
|
tmedia_session_mgr_t* mgr;
|
|
const tsdp_message_t* sdp_lo;
|
|
tsdp_message_t* sdp_ro;
|
|
char* temp;
|
|
|
|
/* create manager */
|
|
mgr = tmedia_session_mgr_create((tmedia_audio | tmedia_video | tmedia_msrp | tmedia_t38),
|
|
"192.168.16.82", tsk_false);
|
|
|
|
/* get lo */
|
|
sdp_lo = tmedia_session_mgr_get_lo(mgr);
|
|
if((temp = tsdp_message_tostring(sdp_lo))){
|
|
TSK_DEBUG_INFO("sdp_lo=%s", temp);
|
|
TSK_FREE(temp);
|
|
}
|
|
|
|
/* set ro */
|
|
if((sdp_ro = tsdp_message_parse(SDP_RO, tsk_strlen(SDP_RO)))){
|
|
tmedia_session_mgr_set_ro(mgr, sdp_ro);
|
|
TSK_OBJECT_SAFE_FREE(sdp_ro);
|
|
}
|
|
|
|
TSK_OBJECT_SAFE_FREE(mgr);
|
|
}
|
|
|
|
#endif /* _TEST_SESSIONS_H_ */
|