? Doxyfile ? asterisk.kdevelop ? asterisk.kdevelop.filelist ? asterisk.kdevelop.pcs ? asterisk.kdevses ? meetme_volume_rev1.diff ? rtp-indentation.patch ? doc/api Index: rtp.c =================================================================== RCS file: /usr/cvsroot/asterisk/rtp.c,v retrieving revision 1.146 diff -u -r1.146 rtp.c --- rtp.c 14 Sep 2005 20:46:49 -0000 1.146 +++ rtp.c 6 Oct 2005 20:41:23 -0000 @@ -16,12 +16,12 @@ * at the top of the source tree. */ -/* - * +/** * Real-time Protocol Support - * Supports RTP and RTCP with Symmetric RTP support for NAT - * traversal - * + * + * @file rtp.c + * @brief Supports RTP and RTCP with Symmetric RTP support for NAT traversal. + * RTP is deffined on RFC 3550. */ #include @@ -115,7 +115,7 @@ void *data; ast_rtp_callback callback; struct rtpPayloadType current_RTP_PT[MAX_RTP_PT]; - int rtp_lookup_code_cache_isAstFormat; /* a cache for the result of rtp_lookup_code(): */ + int rtp_lookup_code_cache_isAstFormat; /**< a cache for the result of rtp_lookup_code(): */ int rtp_lookup_code_cache_code; int rtp_lookup_code_cache_result; int rtp_offered_from_local; @@ -123,9 +123,9 @@ }; struct ast_rtcp { - int s; /* Socket */ - struct sockaddr_in us; - struct sockaddr_in them; + int s; /**< Socket */ + struct sockaddr_in us; + struct sockaddr_in them; }; static struct ast_rtp_protocol *protos = NULL; @@ -230,9 +230,13 @@ return f; } -/* process_rfc2833: Process RTP DTMF and events according to RFC 2833: - "RTP Payload for DTMF Digits, Telephony Tones and Telephony Signals" -*/ +/** Process RTP DTMF and events according to RFC 2833: "RTP Payload for DTMF Digits, Telephony Tones and Telephony Signals" + * @param rtp + * @param data + * @param len + * @param seqno + * @returns + */ static struct ast_frame *process_rfc2833(struct ast_rtp *rtp, unsigned char *data, int len, unsigned int seqno) { unsigned int event; @@ -483,7 +487,7 @@ ast_verbose("Got RTP packet from %s:%d (type %d, seq %d, ts %d, len %d)\n" , ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port), payloadtype, seqno, timestamp,res - hdrlen); - rtpPT = ast_rtp_lookup_pt(rtp, payloadtype); + rtpPT = ast_rtp_lookup_pt(rtp, payloadtype); if (!rtpPT.isAstFormat) { /* This is special in-band data that's not one of our codecs */ if (rtpPT.code == AST_RTP_DTMF) { @@ -503,37 +507,37 @@ duration &= 0xFFFF; ast_verbose("Got rfc2833 RTP packet from %s:%d (type %d, seq %d, ts %d, len %d, mark %d, event %08x, end %d, duration %d) \n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port), payloadtype, seqno, timestamp, res - hdrlen, (mark?1:0), event, ((event_end & 0x80)?1:0), duration); } - if (rtp->lasteventseqn <= seqno || rtp->resp == 0 || (rtp->lasteventseqn >= 65530 && seqno <= 6)) { - f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen, seqno); - rtp->lasteventseqn = seqno; - } else + if (rtp->lasteventseqn <= seqno || rtp->resp == 0 || (rtp->lasteventseqn >= 65530 && seqno <= 6)) { + f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen, seqno); + rtp->lasteventseqn = seqno; + } else f = NULL; - if (f) - return f; - else + if (f) + return f; + else return &null_frame; - } else if (rtpPT.code == AST_RTP_CISCO_DTMF) { - /* It's really special -- process it the Cisco way */ - if (rtp->lasteventseqn <= seqno || rtp->resp == 0 || (rtp->lasteventseqn >= 65530 && seqno <= 6)) { - f = process_cisco_dtmf(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen); - rtp->lasteventseqn = seqno; - } else + } else if (rtpPT.code == AST_RTP_CISCO_DTMF) { + /* It's really special -- process it the Cisco way */ + if (rtp->lasteventseqn <= seqno || rtp->resp == 0 || (rtp->lasteventseqn >= 65530 && seqno <= 6)) { + f = process_cisco_dtmf(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen); + rtp->lasteventseqn = seqno; + } else f = NULL; - if (f) + if (f) return f; else return &null_frame; - } else if (rtpPT.code == AST_RTP_CN) { - /* Comfort Noise */ - f = process_rfc3389(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen); - if (f) + } else if (rtpPT.code == AST_RTP_CN) { + /* Comfort Noise */ + f = process_rfc3389(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen); + if (f) return f; else return &null_frame; - } else { - ast_log(LOG_NOTICE, "Unknown RTP codec %d received\n", payloadtype); - return &null_frame; - } + } else { + ast_log(LOG_NOTICE, "Unknown RTP codec %d received\n", payloadtype); + return &null_frame; + } } rtp->f.subclass = rtpPT.code; if (rtp->f.subclass < AST_FORMAT_MAX_AUDIO)