[Freeswitch-svn] [commit] r6037 - in freeswitch/trunk/src: . include

Freeswitch SVN anthm at freeswitch.org
Tue Oct 23 17:32:17 EDT 2007


Author: anthm
Date: Tue Oct 23 17:32:17 2007
New Revision: 6037

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_rtp.c

Log:
fix MODAPP-3

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Tue Oct 23 17:32:17 2007
@@ -632,6 +632,7 @@
 SFF_RAW_RTP    = (1 <<  1) - Frame has raw rtp accessible
 SFF_RTP_HEADER = (1 << 2)  - Get the rtp header from the frame header
 SFF_PLC        = (1 << 3)  - Frame has generated PLC data
+SFF_RFC2833    = (1 << 4)  - Frame has rfc2833 dtmf data
 </pre>
  */
 typedef enum {
@@ -639,7 +640,8 @@
 	SFF_CNG = (1 << 0),
 	SFF_RAW_RTP = (1 << 1),
 	SFF_RTP_HEADER = (1 << 2),
-	SFF_PLC = (1 << 3)
+	SFF_PLC = (1 << 3),
+	SFF_RFC2833 = (1 << 4)
 } switch_frame_flag_t;
 
 

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Tue Oct 23 17:32:17 2007
@@ -1219,6 +1219,9 @@
 	frame->packetlen = bytes;
 	frame->source = __FILE__;
 	frame->flags |= SFF_RAW_RTP;
+	if (frame->payload == rtp_session->te) {
+		frame->flags |= SFF_RFC2833;
+	}
 	frame->timestamp = ntohl(rtp_session->recv_msg.header.ts);
 	frame->seq = (uint16_t)ntohs((u_short)rtp_session->recv_msg.header.seq);
 	frame->ssrc = ntohl(rtp_session->recv_msg.header.ssrc);
@@ -1282,8 +1285,15 @@
 	if (fwd) {
 		bytes = datalen;
 		send_msg = (rtp_msg_t *) data;
+		if (*flags & SFF_RFC2833) {
+			send_msg->header.pt = rtp_session->te;
+		}
 	} else {
 		uint8_t m = 0;
+		
+		if (*flags & SFF_RFC2833) {
+			payload = rtp_session->te;
+		}
 
 		if ((rtp_session->ts > (rtp_session->last_write_ts + (rtp_session->samples_per_interval * 10)))
 			|| rtp_session->ts == rtp_session->samples_per_interval) {



More information about the Freeswitch-svn mailing list