summaryrefslogtreecommitdiff
path: root/channels/sip/include/sip_utils.h
AgeCommit message (Collapse)Author
2012-02-09Add auto_force_rport and auto_comedia NAT optionsTerry Wilson
This patch adds the auto_force_rport and auto_comedia NAT options. It also converts the nat= setting to a list of comma-separated combinable options: no, force_rport, comedia, auto_force_rport, and auto_comedia. nat=yes remains as an undocumented option equal to "force_rport,comedia". The first instance of 'yes' or 'no' in the list stops parsing and overrides any previously set options. If an auto_* option is specified with its non-auto_ counterpart, the auto setting takes precedence. This patch builds upon the patch posted to ASTERISK-17860 by JIRA user pedro-garcia. (closes issue ASTERISK-17860) Review: https://reviewboard.asterisk.org/r/1698/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17Make all of the various rtpqos parameters in this branch available from the ↵Tilghman Lesher
CHANNEL function. Also includes a test for retrieving rtpqos parameters, including a NULL RTP driver. Additionally, some further separation of the SIP internal API into headers was necessary. (closes issue #16652) Reported by: kkm Patches: 20100204__issue16652.diff.txt uploaded by tilghman (license 14) Review: https://reviewboard.asterisk.org/r/501/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-15chan_sip parse code refactoring plus two new unit testsDavid Vossel
Code Refactoring Changes - read_to_parts() moved to reqresp_parser.c and has been renamed as get_name_and_number() - get_in_brackets() moved to reqresp_parser.c - find_closing_quotes() added to sip_utils.h Logic Changes - get_name_and_number() now uses parse_uri() and get_calleridname() for parsing. Before this change only names within quotes were found, when names not within quotes are possible. New Unit Tests -sip_get_name_and_number_test -sip_get_in_brackets_test (closes issue #16707) Reported by: Nick_Lewis Patches: issue16706.diff uploaded by dvossel (license 671) Review: https://reviewboard.asterisk.org/r/499/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-07Tweak formatting and add minor updates to some comments.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-03-----Changes -----David Vossel
New files - channels/sip/sip.h – A new header for shared #define, enum, and struct definitions. - channels/sip/include/sip_utils.h – sip util functions shared among the all the sip APIs - channels/sip/include/config_parser.h – sip config-parser API - channels/sip/config_parser.c – Contains sip.conf parsing helper functions with unit tests. - channels/sip/include/reqresp_parser.h – sip request response parser API - channels/sip/reqresp_parser.c – Contains sip request and response parsing helper functions with unit tests. New Unit Tests - sip_parse_uri_test - sip_parse_host_test - sip_parse_register_line_test Code Refactoring - All reusable #define, enum, and struct definitions were moved out of chan_sip.c into sip.h. During this process formatting changes were made to comments in both sip.h and chan_sip.c in order to better adhere to the coding guidelines. - The beginnings of three new sip APIs, sip-utils.h, config-parser.h, reqresp-parser.h using existing chan_sip.c functions. - parse_uri() and get_calleridname() were moved from chan_sip.c to request-parser.c along with unit tests for both functions. - sip_parse_host() and sip_parse_register_line() were moved from chan_sip.c to config-parser.c along with unit tests for both functions. Changes to parse_uri() -removal of the options parameter. It was never used and did not behave correctly. -additional check for [?header] field. When this field was present, the transport type was not being set correctly. ----- Overview ----- This patch is introduced with the hope that unit tests for all our sip parsing functions will be written soon. chan_sip is a huge file, and with the addition of each unit test chan_sip is going to grow larger and harder to maintain. I'm proposing we begin refactoring chan_sip, starting with the parsing functions. With each parsing function we move into a separate helper file, a unit test should accompany it. I've attempted to lay down the ground work for this change by creating two new parser helper files (config-parser.c and reqresp-parser.c) and moving all shared structs, enums, and defines from chan_sip.c into a shared sip.h file. We can't verify everything in Asterisk using unit tests, but string parsing is one area where unit tests make the most sense. By beginning to restructure the code in this way, chan_sip not only becomes less bloated, but Asterisk as a whole will become more stable. Review: https://reviewboard.asterisk.org/r/477/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244597 65c4cc65-6c06-0410-ace0-fbb531ad65f3