2
The oRTP LinPhone RTP library intends to provide basics for a RTP stack.
3
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#include <ortp/ortp.h>
21
#include <ortp/telephonyevents.h>
24
#include <sys/types.h>
34
void stophandler(int signum)
39
static char *help="usage: test_tevsend filename dest_ip4addr dest_port\n";
41
int main(int argc, char *argv[])
44
unsigned char buffer[160];
57
ortp_scheduler_init();
59
/* set the telephony event payload type to 96 in the av profile.*/
60
rtp_profile_set_payload(&av_profile,96,&payload_type_telephone_event);
62
session=rtp_session_new(RTP_SESSION_SENDONLY);
64
rtp_session_set_scheduling_mode(session,1);
65
rtp_session_set_blocking_mode(session,1);
66
rtp_session_set_remote_addr(session,argv[2],atoi(argv[3]));
67
rtp_session_set_send_payload_type(session,0);
71
printf("using SSRC=%i.\n",atoi(ssrc));
72
rtp_session_set_ssrc(session,atoi(ssrc));
75
infile=fopen(argv[1],"rb");
77
perror("Cannot open file");
80
signal(SIGINT,stophandler);
81
while( ((i=fread(buffer,1,160,infile))>0) && (runcond) )
83
//ortp_message("Sending packet.");
84
rtp_session_send_with_ts(session,buffer,i,user_ts);
89
ortp_message("Sending telephony event packet.");
90
rtp_session_send_dtmf(session,'*',user_ts);
91
user_ts+=160+160+160; /* the duration of the dtmf */
95
rtp_session_destroy(session);
97
ortp_global_stats_display();