summaryrefslogtreecommitdiff
path: root/main/rtp.c
AgeCommit message (Collapse)Author
2007-12-07Merged revisions 91637 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r91637 | tilghman | 2007-12-06 18:52:17 -0600 (Thu, 06 Dec 2007) | 5 lines At the end of a call, when we're reporting, RTCP may already be partially torn down, so check for NULL dereference Reported by: blitzrage Patch by: tilghman (Closes issue #11450) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03Merged revisions 90588 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90588 | file | 2007-12-03 16:05:42 -0400 (Mon, 03 Dec 2007) | 2 lines Do not create a smoother for G723.1 frames, they need to be left alone to their native 20/24 byte size. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27The following patch with updates for trunk. Works much better in trunk.Olle Johansson
Also by accident fixed a bad typo by a previous committer, which actually made video calls not work fully... Merged revisions 89630 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89630 | oej | 2007-11-27 16:23:17 +0100 (Tis, 27 Nov 2007) | 12 lines If we get a codec offer using a well-known payload type, but using it for another codec that we don't know, Asterisk did not remove that codec from the list. With this patch, we remove the codec from audio and video rtp objects and deny it ever existed. Thanks to lasse for testing. (closes issue #11376) Reported by: lasse Patches: bug11376.txt uploaded by oej (license 306) Tested by: lasse ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove a bunch of useless #include "options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17fix breakage induced by previous mistakeLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16remove a bunch of duplicate includesLuigi Rizzo
Reproduce with grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Commit some cleanups to the format type code.Tilghman Lesher
- Remove the AST_FORMAT_MAX_* types, as these are consuming 3 out of our available 32 bits. - Add a native slin16 type, so that 16kHz codecs can translate without losing resolution. (This doesn't affect anything immediately, until another codec has wb support.) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29Drop the RTCP Read too short message to debug. There are some phones out ↵Joshua Colp
there that send a sort of keep alive packet in the RTCP that trigger this every 5 seconds. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵Jason Parker
didn't make much sense git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19Convert NEW_CLI to AST_CLI.Jason Parker
Closes issue #11039, as suggested by seanbright. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19More changes to NEW_CLI.Jason Parker
Also fixes a few cli messages and some minor formatting. (closes issue #11001) Reported by: seanbright Patches: newcli.1.patch uploaded by seanbright (license 71) newcli.2.patch uploaded by seanbright (license 71) newcli.4.patch uploaded by seanbright (license 71) newcli.5.patch uploaded by seanbright (license 71) newcli.6.patch uploaded by seanbright (license 71) newcli.7.patch uploaded by seanbright (license 71) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15Merged revisions 85559 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85559 | file | 2007-10-15 13:22:02 -0300 (Mon, 15 Oct 2007) | 4 lines Bring both DTMF begin and end frames up through to the core for DTMF feature handling. (closes issue #10826) Reported by: dimas ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15Merged revisions 85552 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85552 | file | 2007-10-15 11:55:04 -0300 (Mon, 15 Oct 2007) | 4 lines If Monitor or a spy was added to a P2P or native bridged channel bring the channel back to the generic bridging core so the monitor or spy operations work. (closes issue #10943) Reported by: julianjm ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-08Merged revisions 85057 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85057 | file | 2007-10-08 17:06:33 -0300 (Mon, 08 Oct 2007) | 4 lines Only update codec information if the channel has a technology private structure. (issue #10915) Reported by: ramonpeek ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-08Merged revisions 85023 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85023 | file | 2007-10-08 12:37:46 -0300 (Mon, 08 Oct 2007) | 4 lines Update codec information as well as address when doing hold reinvites. (issue #10868) Reported by: mavince ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-05Merged revisions 84818 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84818 | file | 2007-10-05 15:55:36 -0300 (Fri, 05 Oct 2007) | 4 lines Update the remembered RTP peer information when putting an endpoint on hold or taking it off hold so that the RTP stack does not initiate a needless reinvite. (closes issue #10868) Reported by: mavince ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03Merged revisions 84581 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84581 | tilghman | 2007-10-03 17:59:17 -0500 (Wed, 03 Oct 2007) | 2 lines When an RFC 2833 event is sent that we don't recognize, ignore it, don't queue a NULL digit (closes issue #10877) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-02Don't swap channel priority if using epoll as polling should/will only ↵Joshua Colp
happen off the first channel. (closes issue #10867) Reported by: phsultan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01Corydon posted this janitor project to the bug tracker and mvanbaak providedRussell Bryant
a patch for it. It replaces a bunch of simple calls to snprintf with ast_copy_string (closes issue #10843) Reported by: Corydon76 Patches: 2007092900_10843.diff uploaded by mvanbaak (license 7) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21Merged revisions 83432 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83432 | russell | 2007-09-21 09:37:20 -0500 (Fri, 21 Sep 2007) | 4 lines gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set of changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2. (closes issue #10774, patch from qwell) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27Merged revisions 80974 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80974 | file | 2007-08-27 10:20:31 -0300 (Mon, 27 Aug 2007) | 4 lines (closes issue #10562) Reported by: idkpmiller Correct jitter value output in the CLI to be as expected. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22Merged revisions 80255 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80255 | file | 2007-08-22 13:14:38 -0300 (Wed, 22 Aug 2007) | 4 lines (closes issue #10526) Reported by: sinistermidget Revert commit from issue #10355 and return timestamp skew to 640. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16Don't reload a configuration file if nothing has changed.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-15Merged revisions 79553 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r79553 | file | 2007-08-15 11:40:23 -0300 (Wed, 15 Aug 2007) | 6 lines (closes issue #10440) Reported by: irroot (closes issue #10454) Reported by: flo_turc Increase maximum timestamp skew to 120. 20 was apparently far too low. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08Add support for using epoll instead of poll. This should increase ↵Joshua Colp
scalability and is done in such a way that we should be able to add support for other poll() replacements. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06Merged revisions 78172 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78172 | file | 2007-08-06 12:27:24 -0300 (Mon, 06 Aug 2007) | 4 lines (closes issue #10355) Reported by: wdecarne Now that we pass through RTP timestamp information we need to make the allowed timestamp skew considerably less. There are situations where a source may change and due to the timestamp difference the receiver will experience an audio gap since we did not indicate by setting the marker bit that the source changed. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Do a massive conversion for using the ast_verb() macroRussell Bryant
(closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Add a link to the list of assigned RTP payload types for convenience.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26document how the RTP marker bit is passed for video frames,Luigi Rizzo
and why this does not overwrite useful information. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26add an entry for h263plus in an empty slot of the rtp types.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25Merged revisions 77022 via svnmerge from Luigi Rizzo
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r77022 | rizzo | 2007-07-25 11:34:01 +0200 (Wed, 25 Jul 2007) | 3 lines set the sequence number in a frame for all frame types ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19After some study, thought, comparing, etc. I've backed out the previous ↵Steve Murphy
universal mod to make ast_flags a 64 bit thing. Instead, I added a 64-bit version of ast_flags (ast_flags64), and 64-bit versions of the test-flag, set-flag, etc. macros, and an app_parse_options64 routine, and I use these in app_dial alone, to eliminate the 30-option limit it had grown to meet. There is room now for 32 more options and flags. I was heavily tempted to implement some of the other ideas that were presented, but this solution does not intro any new versions of dial, doesn't have a different API, has a minimal/zero impact on code outside of dial, and doesn't seriously (I hope) affect the code structure of dial. It's the best I can think of right now. My goal was NOT to rewrite dial. I leave that to a future, coordinated effort. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18This corrects the problem with flags and %lld formats on 64-bit machines, ↵Steve Murphy
where uint64_t is NOT acceptable for %lld, and also works on 32-bit machines. At least, with gcc. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17via 10206, I have added an option (e) to Dial to allow the h exten to get ↵Steve Murphy
run on peer. Had to upgrade ast_flag stuff to 64 bits to do this. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13resolve a compiler warningRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13Small improvement to the STUN support so it can be used byLuigi Rizzo
sockets other than RTP ones. The main change is a new API function in main/rtp.c (see there for a description) int ast_stun_request(int s, struct sockaddr_in *dst, const char *username, struct sockaddr_in *answer) which can be used to send an STUN request on a socket, and optionally wait for a reply and store the STUN_MAPPED_ADDRESS into the 'answer' argument (obviously, the version that waits for a reply is blocking, but this is no different from DNS resolutions). Internally there are minor modifications to let stun_handle_packet() be somewhat configurable on how to parse the body of responses. At the moment i am not committing any change to the clients, but adding STUN client support is extremely simple, e.g. chan_sip.c could do something like this: + add a variable to store the stun server address; static struct sockaddr_in stunaddr = { 0, }; /*!< stun server address */ + add code to parse a config file of the form "stunaddr=my.stun.server.org:3478" (not shown for brevity); + right after binding the main sip socket, talk to the stun server to determine the externally visible address if (stunaddr.sin_addr.s_addr != 0) ast_stun_request(sipsock, &stunaddr, NULL, &externip); so now 'externip' is set with the externally visible address. so it is really trivial. Similarly ast_stun_request could be called when creating the RTP socket (possibly adding a struct sockaddr_in field in the struct ast_rtp to store the externalip). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12more cleanup, this time to stun_handle_packet(). Among other things:Luigi Rizzo
+ mark a potentially dangerous write-past-end-of-buffer + localize some variables in the block generating stun replies. As before, not ready yet for a merge to 1.4 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12a little bit of code cleanup to rtp.c, mostly to function Luigi Rizzo
ast_rtp_new_with_bindaddr(): 1. add comments to the logic of the main loop; 2. use a common exit point on failure so the cleanup is done only in one place; 3. handle failures in rtp_socket() in the main loop of the function; No functional changes except for #3 above, so it is not yet worthwhile merging this and other changes to 1.4 Once the cleanup work on this file will be complete (which among other things should include some extensions to the stun support) it might be a good thing to push all the changes to 1.4 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11add a bit of documentation on what the stun code in rtp.c doesLuigi Rizzo
(which is very little, at the moment). Eventually, when the functionality is extended, the changes can be merged back to 1.4. At the moment this is pointless. Note, this change is whitespace only. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27Merged revisions 72112 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r72112 | russell | 2007-06-27 11:34:24 -0500 (Wed, 27 Jun 2007) | 3 lines Only output debug information related to RTCP timestamps when RTCP debug is turned on (issue #10066, patch by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-26Merged revisions 71915 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r71915 | qwell | 2007-06-26 15:36:09 -0500 (Tue, 26 Jun 2007) | 4 lines Don't dereference a pointer that may be NULL here. Issue 10017. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25Convert so more logging to ast_debug (issue #10045, dimas)Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24Conversions to ast_debug()Russell Bryant
(issue #9984, patches from eliel and dimas) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22Behold the magic of casting!Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22Merged revisions 71063 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r71063 | murf | 2007-06-22 08:10:24 -0600 (Fri, 22 Jun 2007) | 1 line My conditions for merging amaflags info was naive; DOCUMENTATION is the default, although null is possible; theft of user-settable fields is not good. Just copy them, leave them alone. This is for bug 10016. (plus a small fix to rtp, to elim a compiler warning (dev mode)) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21Add manager events for RTCP statistics.Jason Parker
Also adds a new "reporting" permission for manager, since it can be incredibly spammy. This permission was discussed on the -dev mailing list some months back. Issue 8613, patch by johann8384, with some minor changes by me. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21Merged revisions 70727 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r70727 | file | 2007-06-21 11:22:39 -0400 (Thu, 21 Jun 2007) | 2 lines Do not Packet2Packet bridge if packetization settings do not allow it. (issue #9117 reported by phsultan) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20Merged revisions 70360 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r70360 | file | 2007-06-20 13:52:57 -0400 (Wed, 20 Jun 2007) | 2 lines Put the speex packetization values back in but disable it when setting up the smoother. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70361 65c4cc65-6c06-0410-ace0-fbb531ad65f3