# # This script creates a single RTP session. Tranmsits the voice file "rtp_toolbox_pesq.PCM" for 20sec # Records the incoming voice data sent from other PC to "receive.pcm" file. # Make the required changes to the IP address before running the script. # Make sure the voice files used are available in the respective PCs. # load rtpclientifc.dll rtp connect 192.168.10.6 10024 rtp cmd {clear;} puts "\n" rtp cmd {1 create_session 192.168.10.6 6000;} wait 2 rtp reply 1 1 msg -display # TX profile settings # codec= PCM Mu-law, Frame interval= 20mesc, playload type= Mu-law, avttype (RFC2833 pay load)= 101 # rtp cmd {1 set tx_profile PCMU 20msec payloadtype 0 avttype 101;} # RX profile settings (impairments) # Jitter buffer= Static, Jitter buffer length= 100msec, playload type= Mu-law, avttype (RFC2833 pay load)= 101 # Latency= unform distribution with min value= 20 msec and max value= 40 msec # Packet loss= random with 2% loss of packets # packet effect: Out of order chance = 5% and packet offset 8 of 10 # rtp cmd {1 set rx_profile static 100 payloadtype 0 avttype 101;} rtp cmd {1 set latency uniform (20,40);} rtp cmd {1 set packetloss random 2%;} rtp cmd {1 set outoforder (5%,8,10);} puts "session establishing" rtp cmd {1 start_session 192.168.10.7 7000;} wait 2 sec rtp reply 1 1 msg -display # # enable to Play voice to speaker # rtp cmd {1 play speech;} wait 2 puts "\n" # # send the dtmf digit 1 with power -10dbm, on time= 100 msec, off time= 100msec # puts "Sending dtmf digit 1" wait 2 rtp cmd {1 tx dtmfdigits ("1", -10dbm, 100 msec, 100msec);} puts "Sent dtmf digit" wait 1 sec rtp reply 1 10 msg -display # # Start monitoring the dtmf digit 1 # rtp cmd {1 monitor dtmf digits;} wait 1 sec rtp reply 1 11 msg -display puts "Waiting to receive DTMF 1" while { 1 } { if { [eval rtp qfull 1 11 ] } { wait 1 rtp reply 1 11 msg -val if { $msg(val) == 1 } { puts "received dtmf digit $msg(val)" break } } wait 2 sec } rtp cmd {1 stop monitor;} wait 1 sec rtp reply 1 11 msg -display puts "\n" # # start sending the voice file "rtp_toolbox_pesq.PCM" for 20sec # puts "Start sending the file" rtp cmd {1 tx file "rtp_toolbox_pesq.PCM" 20000 msec;} wait 20 sec puts "completed sending voice file" puts "\n" # # start recording the voice file to "receive.PCM" for 20sec # puts "start recording file" rtp cmd {1 rx file "receive.pcm" 20000 msec;} wait 22 sec puts "completed recording file" # # stop play speech, stop the session, clear the database of the server, and disconnect # rtp cmd {1 stop play speech;} rtp cmd {1 stop_session ;} rtp cmd {clear;} rtp disconnect