Commit Graph

2927 Commits

Author SHA1 Message Date
Mark Michelson 6cad0f1602 func_srv and explicit specification of a remote IP for SIP.
From Review Board:
There are two interrelated changes here.

First, there is the introduction of func_srv. This adds two new read-only
dialplan functions, SRVQUERY and SRVRESULT. They work very similarly to the
ENUMQUERY and ENUMRESULT functions, except that this allows one to query SRV
records instead. In order to facilitate this work, I added a couple of new API
calls to srv.h. ast_srv_get_record_count tells the number of records returned
by an SRV lookup. This number is calculated at the time of the SRV lookup.
ast_srv_get_nth_record allows one to get a numbered SRV record.

Second, there is the modification to chan_sip that allows one to specify a
hostname or IP address (along with a port) to send an outgoing INVITE to when
dialing a SIP peer. This goes hand-in-hand with func_srv. You can query SRV
records and then use the host and port from the results to dial via a specific
host instead of what is configured in sip.conf.

Review: https://reviewboard.asterisk.org/r/608
SWP-1200



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 14:37:50 +00:00
David Vossel d3f44c979c fixes deadlock in chan_sip caused by usage of MASTER_CHANNEL dialplan function
(closes issue #16767)
Reported by: lmsteffan
Patches:
      deadlock_16767v3.diff uploaded by dvossel (license 671)

Review: https://reviewboard.asterisk.org/r/606/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-06 14:42:10 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Mark Michelson 284ac3a4d9 Fix improper comaparison of anonymous URI when getting P-Asserted-Identity.
There was a bug where we split the URI on the @ sign and then attempted
to compare to "anonymous@anonymous.invalid" afterwards. This comparison
could never evaluate true. So now we keep a copy of the URI prior to the
split so that the comparison is valid.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-31 22:35:20 +00:00
Kevin P. Fleming 42577406fd Improve handling of T.38 re-INVITEs that arrive before a T.38-capable
application is executing on a channel.

This patch addresses an issue found during working with end-users
using res_fax. If an incoming call is answered in the dialplan, or
jumps to the 'fax' extension due to reception of a CNG tone (with
faxdetect enabled), and then the remote endpoint sends a T.38
re-INVITE, it is possible for the channel's T.38 state to be
'T38_STATE_NEGOTIATING' when the application starts up. Unfortunately,
even if the application wants to use T.38, it can't respond to the
peer's negotiation request, because the AST_CONTROL_T38_PARAMETERS
control frame that chan_sip sent originally has been lost, and the
application needs the content of that frame to be able to formulate a
reply.

This patch adds a new 'request' type to AST_CONTROL_T38_PARAMETERS,
AST_T38_REQUEST_PARMS. If the application sends this request, chan_sip
will re-send the original control frame (with
AST_T38_REQUEST_NEGOTIATE as the request type), and the application
can respond as normal. If this occurs within the five second timeout
in chan_sip, the automatic cancellation of the peer reinvite will be
stopped, and the application will 'own' the negotiation process from
that point onwards.

This also improves the code path in chan_sip to allow sip_indicate(),
when called for AST_CONTROL_T38_PARAMETERS, to be able to return a
non-zero response, which should have been in place before since the
control frame *can* fail to be processed properly. It also modifies
ast_indicate() to return whatever result the channel driver returned
for this control frame, rather than converting all non-zero results
into '-1'. Finally, the new request type intentionally returns a
positive value, so that an application that sends
AST_T38_REQUEST_PARMS can know for certain whether the channel driver
accepted it and will be replying with a control frame of its own, or
whether it was ignored (if the sip_indicate()/ast_indicate() path had
properly supported failure responses before, this would not be
necessary).

This patch also modifies res_fax to take advantage of the new request.

In addition, this patch makes sip_t38_abort() actually lock the
private structure before doing its work... bad programmer, no donut.

This patch also enhances chan_sip's 'faxdetect' support to allow
triggering on T.38 re-INVITEs received as well as CNG tone detection.

Review: https://reviewboard.asterisk.org/r/556/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 15:27:31 +00:00
Russell Bryant ce4086bbdc Tell the RTP engine API about the initial read and write format.
Peer reviewed out-of-band by file.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-15 22:14:18 +00:00
Tilghman Lesher 7d963333e2 THIS IS NOT PYTHON. Indentation doesn't matter, only braces do.
(closes issue #17025)
 Reported by: smurfix
 Patches: 
       sip.patch uploaded by smurfix (license 547)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-15 04:25:35 +00:00
Terry Wilson 68d1ded8dd Only change the RTP ssrc when we see that it has changed
This change basically reverts the change reviewed in
https://reviewboard.asterisk.org/r/374/ and instead limits the
updating of the RTP synchronization source to only those times when we
detect that the other side of the conversation has changed the ssrc.

The problem is that SRCUPDATE control frames are sent many times where
we don't want a new ssrc, including whenever Asterisk has to send DTMF
in a normal bridge. This is also not the first time that this mistake
has been made. The initial implementation of the ast_rtp_new_source
function also changed the ssrc--and then it was removed because of
this same issue. Then, we put it back in again to fix a different
issue. This patch attempts to only change the ssrc when we see that
the other side of the conversation has changed the ssrc.

It also renames some functions to make their purpose more clear.

Review: https://reviewboard.asterisk.org/r/540/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-12 22:04:51 +00:00
Russell Bryant 0c45fc4eda Fix a crash in SIP blind transfer handling found by an automated external test.
The first real test added to the external test suite found a pretty nasty crash
that occurred in Asterisk trunk.  The crash was due to a race condition between
the REFER handling and channel destruction in the channel thread.  After the
transfer has been completed, we go back to the transferrer channel and try to
lock it so we can fire off a CEL event.  However, there was no guarantee that
the channel was still around at that point since it's racing against the channel
thread.

Since ast_channel is a reference counted object, the fix is simple.  The code
unlocks the transferrer channel before finally completing the transfer with
an async goto.  At this point the channel thread is going to start call tear
down and the channel will eventually be destroyed.  To ensure that the channel
is valid when we want to fire off the CEL event, increase the channel's
reference count.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-06 14:16:20 +00:00
Russell Bryant 7f8e8d01de Fix up some of chan_sip's usage of the RTP engine API.
The get_local_address() function for an RTP instance was used when building an
SDP, but the results were not honored.  The RTP engine activate() function was
not being used once we have determined that media will now flow.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-05 05:03:41 +00:00
David Vossel ba1a8d3ff0 fixes signed to unsigned int comparision issue for FaxMaxDatagram value.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 00:18:28 +00:00
David Vossel 862ebf4d00 fixes adaptive jitterbuffer configuration
When configuring the adaptive jitterbuffer, the target_extra
value not only could not be set from the configuration, but was
not even being set to its proper default.  This value is required
in order for the adaptive jitterbuffer to work correctly.  To resolve
this a config option has been added to expose this value to the conf
files, and a default value is provided when no config specific value
is present.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 19:08:38 +00:00
Mark Michelson 86f0690571 Merged revisions 249100 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r249100 | mmichelson | 2010-02-26 11:04:29 -0600 (Fri, 26 Feb 2010) | 8 lines
  
  For T.38 reINVITEs treat a 606 the same as a 488.
  
  (closes issue #16792)
  Reported by: vrban
  Patches:
        t38_606.patch uploaded by vrban (license 756)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 17:04:58 +00:00
David Vossel 6568b06d29 Merged revisions 248396 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248396 | dvossel | 2010-02-23 10:26:05 -0600 (Tue, 23 Feb 2010) | 9 lines
  
  fixes invite with replaces deadlock
  
  (closes issue #16862)
  Reported by: pwalker
  Patches:
        replaces_deadlock_1.4 uploaded by dvossel (license 671)
  Tested by: pwalker, dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-23 16:34:39 +00:00
Mark Michelson 3a422d7796 Move the REF_DEBUG comment higher in the include list.
Uncommenting the REF_DEBUG definition where it was in the source
resulted in only a small part of the astobj2 references being logged
to a file. Moving this up higher in the include list causes all references
to be logged as they should be.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-22 20:19:00 +00:00
David Vossel fc0cb53aa5 handle_request_invite revise comment, fix coding guideline issues
I'm working with this code right now trying to analyze a deadlock.
This change is just to clean up a few things before I make a more
complex patch.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-19 17:40:26 +00:00
Tilghman Lesher 6fb7e0ece7 If the peer record is from realtime, it could be set to 0, due to MySQL not representing NULL well in integer columns.
NULL means the value is not specified for the column, which normally means
the driver uses whatever is the default value.  However, on MySQL, placing
a NULL in either a float or integer column results in a retrieval of the 0
value.  Hence, users get an errant error on load.  This patch suppresses
that error and makes the value as if it was not there.

Note that this cannot be done in the realtime driver, because the lack of
difference between NULL and 0 can only be intepreted correctly by the
driver itself.  If we did it in the realtime driver, then it would be
effectively impossible to set any realtime field to 0, because it would act
as if the field were unspecified and possibly take on a different value.

(closes issue #16683)
 Reported by: wdoekes


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 21:42:53 +00:00
Tilghman Lesher e7a5fb5459 Make all of the various rtpqos parameters in this branch available from the 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-17 06:25:15 +00:00
Tilghman Lesher b26b519159 Allow Timer B to be set on the peer, and ensure SIP rules are followed (or warn) in comparison to Timer T1.
(closes issue #16643)
 Reported by: nahuelgreco
 Patches: 
       20100204__issue16643.diff.txt uploaded by tilghman (license 14)
 Tested by: oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16 00:19:38 +00:00
David Vossel 2003243947 chan_sip parse code refactoring plus two new unit tests
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-15 15:45:02 +00:00
David Vossel 72dcd51cc8 fixes areas where port should be removed from domain during parsing
A patch was committed recently that converted duplicate uri parsing
code to use the parse_uri function.  There were two instances where
this conversion did not mimic previous behavior exactly because the
port was not being parsed off the end of the domain. In order to do
this, a dummy pointer argument needs to be passed into parse_uri so
it will know it must parse out the port from the domain.  If a port
output paramenter is not present,   the domain is returned with the
port still attached.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-12 17:59:39 +00:00
Matthew Nicholson f935799e51 This commit removes an extra newline in T.38 generated SDP packets. This bug was caused by the fix introduced in r243860.
(closes issue #16766)
Reported by: raivisr
Patches:
      t38-sdp-newline-fix1.diff uploaded by mnicholson (license 96)
Tested by: raivisr


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-09 17:40:04 +00:00
Mark Michelson a1ac799b58 Remove parsing of constantssrc from reload_config.
This config option is already handled by the function handle_common_options
and it is unnecessary to parse the value again.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-07 19:51:54 +00:00
Mark Michelson 38cb3e2ac9 Remove useless sip options related to hash table size.
First off, these options weren't actually doing anything.
By the time the options were parsed, the peer and dialog
containers had already been allocated with their default
values.

Second, hash table size is something that doesn't really
make sense to change in a config file. If a user is that
interested in changing the hashtable size, he can modify
the source itself.

I have removed the parsing of the hash_peer, hash_user,
and hash_dialog options. I have removed the hash_user_size
variable altogether since it is not used at all. I also
changed hash_peer_size and hash_dialog_size to be constant,
and have changed the symbols to be in all caps as constants
typically are. I have also removed the entire section in
sip.conf.sample regarding configurable hashtable sizes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-06 14:43:03 +00:00
David Vossel 1810f1efff fixes issue with sip registry not having correct default expiry
default expiry was not being set correctly for a registry object.
Thanks to ebroad for reporting the issue and testing the patch.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-05 16:59:06 +00:00
David Vossel f30de5ef0e parse_moved_contact tries to parse contact_name twice
parse_moved_contact attempts to remove a quoted string
twice, and the first try wasn't even being done correctly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-04 23:16:30 +00:00
David Vossel a9932363a9 -----Changes -----
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
2010-02-03 20:33:32 +00:00
David Vossel 36bbf8f902 fixes crash during T.38 negotiation caused by invalid or missing FaxMaxDatagram field
AST-2010-001

(closes issue #16634)
Reported by: krn

(closes issue #16724)
Reported by: barthpbx

(closes issue #16517)
Reported by: bklang

(closes issue #16485)
Reported by: elsto




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 22:27:23 +00:00
Russell Bryant 5766b06ad4 Add a missing line terminator for T.38 SDP.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-28 18:35:15 +00:00
Russell Bryant 9ae1efe42c Merged revisions 243779 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243779 | russell | 2010-01-28 09:03:17 -0600 (Thu, 28 Jan 2010) | 2 lines
  
  Fix a bogus third argument to ast_copy_string().
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-28 15:07:23 +00:00
David Vossel d16b89be17 RFC compliant uri and display-name encode/decode
1.  URI Encoding
This patch changes ast_uri_encode()'s behavior when doreserved is enabled.
Previously when doreserved was enabled only a small set of reserved
characters were encoded.  This set was comprised primarily of the reserved
characters defined in RFC3261 section 25.1, but contained other characters as
well.  Rather than only escaping the reserved set, doreserved now escapes
all characters not within the unreserved set as defined by RFC 3261 and
RFC 2396.  Also, the 'doreserved' variable has been renamed to 'do_special_char'
in attempts to avoid confusion.

When doreserve is not enabled, the previous logic of only encoding the
characters <= 0X1F and > 0X7f remains, except for the '%' character, which
must always be encoded as it signifies a HEX escaped character during the decode
process.

2. URI Decoding: Break up URI before decode.
In chan_sip.c ast_uri_decode is called on the entire URI instead of it's
individual parts after it is parsed.  This is not good as ast_uri_decode
can introduce special characters back into the URI which can mess up parsing.
This patch resolves this by not decoding a URI until parsing is completely
done.  There are many instances where we check to see if pedantic checking
is enabled before we decode a URI.  In these cases a new macro,
SIP_PEDANTIC_DECODE, is used on the individual parsed segments of the URI
rather than constantly putting if (pedantic) { decode() } checks everywhere
in the code.  In the areas where ast_uri_decode is not dependent upon
pedantic checking this macro is not used, but decoding is still moved to
each individual part of the URI.  The only behavior that should change from
this patch is the time at which decoding occurs.

Since I had to look over every place URI parsing occurs to create this
patch, I found several places where we use duplicate code for parsing.
To consolidate the code, those areas have updated to use the parse_uri()
function where possible.

3. SIP display-name decoding according to RFC3261 section 25.
To properly decode the display-name portion of a FROM header, chan_sip's
get_calleridname() function required a complete re-write.  More information
about this change can be found in the comments at the beginning of this function.

4. Unit Tests.
Unit tests for ast_uri_encode, ast_uri_decode, and get_calleridname() have been
written.  This involved the addition of the test_utils.c file for testing the
utils api.

(closes issue #16299)
Reported by: wdoekes
Patches:
      astsvn-16299-get_calleridname.diff uploaded by wdoekes (license 717)
      get_calleridname_rewrite.diff uploaded by dvossel (license 671)
Tested by: wdoekes, dvossel, Nick_Lewis

Review: https://reviewboard.asterisk.org/r/469/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 16:30:08 +00:00
Olle Johansson 64b76fa41a Merged revisions 242226 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r242226 | oej | 2010-01-22 10:19:30 +0100 (Fre, 22 Jan 2010) | 3 lines

Initialize notify_types to NULL


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-22 09:28:34 +00:00
Sean Bright e612d87695 Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 18:21:50 +00:00
Olle Johansson c15a667733 SIP Show channelstats fix - use float division to show proper stats
(closes issue #15819)
Reported by: klaus3000
Patches: 
      asterisk-sip-show-channelstats-trunk.txt uploaded by klaus3000 (license 65)
Tested by: klaus3000, oej

This patch is for trunk only and will be blocked in 1.6.2



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 10:24:23 +00:00
David Vossel fa0ef8031d fixes text support in sdp answer
The code that handled setting 'm=text' in the sdp was not executing
in the correct order.  The check to see if text was needed came after
the check to add 'm=text' to the sdp, this resulted in 'm=text' always
being set to 0 because it looked like text was never required.

(closes issue #16457)
Reported by: peterj
Patches:
      textportinsdp.diff uploaded by peterj (license 951)
      issue16457.diff uploaded by dvossel (license 671)
Tested by: peterj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-12 16:14:41 +00:00
David Vossel 084e235a8c Change in sip show channels display format allowing more digits for CID
(closes issue #16459)
Reported by: Rzadzins
Patches:
      chan_sip_longer_cid.patch uploaded by Rzadzins (license 953)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-07 20:00:31 +00:00
Tilghman Lesher 82f998dcd4 Whoa, duplicate setting (dead code).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-06 06:53:23 +00:00
Tilghman Lesher 0078b3bc5c global_contact_ha was renamed in trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-02 16:35:35 +00:00
Olle Johansson 6da31b48d7 Merged revisions 237135 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r237135 | oej | 2010-01-02 10:52:30 +0100 (Lör, 02 Jan 2010) | 2 lines

Release memory of the contact acl before unloading module

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-02 09:54:22 +00:00
Jeff Peeler 1a219ad725 Fix compiling with LOW_MEMORY.
Modified handle_verbose to be LOW_MEMORY aware, removed old RTP related code
in chan_sip.

(closes issue #16381)
Reported by: michael_iedema
Patches: 
      ast_complete_source_filename.patch uploaded by michael iedema (license 942)
      modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-30 20:34:41 +00:00
Tilghman Lesher 5d2b47ffb8 Shut down the SIP session timers more gracefully, in order to prevent a possible crash.
(closes issue #16452)
 Reported by: corruptor
 Patches: 
       20091221__issue16452.diff.txt uploaded by tilghman (license 14)
 Tested by: corruptor


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-29 23:05:45 +00:00
David Vossel b74201f2b6 Merged revisions 236062 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r236062 | dvossel | 2009-12-22 10:58:19 -0600 (Tue, 22 Dec 2009) | 11 lines
  
  fixes issue with p->method incorrectly set to ACK
  
  It is possible for a second ACK to come in for a retransmitted message.
  If an ack does not match an unacked message in our queue, restore the previous
  p->method as this ACK is completely ignored.
  
  (closes issue #16295)
  Reported by: omolenkamp
  Patches:
        issue16295_v2.diff uploaded by dvossel (license 671)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-22 17:00:08 +00:00
Joshua Colp ff0f861383 Remove some old code for going to the 'fax' extension when a T.38 switchover occurs. This would have
already happened when we detected the CNG tone so this was basically a noop.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-17 23:21:07 +00:00
David Vossel 181f617fd7 reverse minor sip registration regression
A registration regression caused by a code tweak in (issue #14331)
and a bug fix in (issue #15539) caused some sip registration
config entries to be constructed incorrectly.  Origially
issue #14331 contained the code tweak as well as a bug fix, but since
the issue was reported as a tweak the bug fix portion was moved into
issue #15539.  Both the tweak and the bug fix contained minor incorrect
logic that resulted in some SIP registrations to fail.

(issue #14331)
(issue #15539)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-15 18:43:06 +00:00
Olle Johansson 2d49d547ed Merged revisions 234492 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r234492 | oej | 2009-12-14 11:16:00 +0100 (Mån, 14 Dec 2009) | 8 lines

Stop sending 183's after call hangup.

There where still cases where the 183 keep-alive mechanism would not stop
sending 183's even though the Asterisk server had sent a final reply to
the invite.

EDVX-28

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-14 10:46:20 +00:00
Tilghman Lesher 84678fc77d Merged revisions 234095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r234095 | tilghman | 2009-12-10 10:08:20 -0600 (Thu, 10 Dec 2009) | 9 lines
  
  When we receive no response at all to our INVITE, allow the channel to be destroyed.
  (closes issue #15627)
   Reported by: falves11
   Patches:
         20091209__issue15627__1.6.0.diff.txt uploaded by tilghman (license 14)
         20091209__issue15627__1.4.diff.txt uploaded by tilghman (license 14)
   Tested by: falves11
  Review: https://reviewboard.asterisk.org/r/446/
  (closes issue #15716)
  Reported by: dant
  (closes issue #16270)
  Reported by: corruptor
  (closes issue #15356)
  Reported by: falves11
  (issue #16382)
  Reported by: lftsy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-10 16:24:26 +00:00
David Vossel 86dc66625c Merged revisions 233471 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r233471 | dvossel | 2009-12-07 12:07:38 -0600 (Mon, 07 Dec 2009) | 9 lines
  
  fixes missing Contact header angle brackets
  
  (closes issue #16298)
  Reported by: mgernoth
  Patches:
        reg_parse_issue_1.4.diff uploaded by dvossel (license 671)
  Tested by: dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-07 18:08:46 +00:00
Matthew Nicholson 3069bab67c Do not reject SDP packets describing only non audio streams.
(closes issue #16387)
Reported by: zalex1953
Patches:
      media-level-c-fix1.diff uploaded by mnicholson (license 96)
Tested by: mnicholson, zalex1953


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-07 16:14:42 +00:00
Mark Michelson 74b388ea4a Do not change the exten string field or rebuild the contact header
on an inbound sip_pvt if the outbound call is redirected.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 17:18:07 +00:00
Joshua Colp 6a7f37e07d Add support for handling the 415 Unsupported media type response like we do for a 488 Not acceptable here response.
(closes issue #16186)
Reported by: atis
Patches:
      sip_t38_response_415.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 16:40:14 +00:00
Joshua Colp 23781604aa Fix a bug where a scheduled item ID would get retained on registrations in a certain scenario
causing code to execute during reload that should not.

(issue AST-263)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 14:54:28 +00:00
Tilghman Lesher f59fe83c56 More 32->64 bit codec conversions.
In the process of swapping ULAW to a place in the extended codec space, we
found several unhandled cases, where a 32-bit integer was still being used to
handle a codec field.  Most of these have been fixed with this commit, although
there is at least one case (codec_dahdi) which depends upon outside headers to
be altered before a conversion can be made.
(Fixes AST-278, SWP-459)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 20:27:37 +00:00
Kevin P. Fleming 5ba2b689b2 Another round of UDPTL stack fixes/improvements:
1) Allow users of UDPTL stack to associate a character-string tag with a UDPTL
   session, so that log/error/debug messages generated by the UDPTL stack can
   be 'connected' to the endpoint that caused them to be generated.

2) Improve comments (and process) of calculating the far end's maximum IFP size
   when redundancy mode is in use for error correction.

3) When an IFP larger than the calculated 'far max IFP' size is presented for
   writing, truncate it rather than putting in the buffer and allowing the buffer
   to overflow; this will cause the ends to retrain to a lower bit rate that
   produces IFPs of an appropriate size if possible, and if not possible, the
   FAX transfer will fail completely. In these cases, it is due to the one endpoint
   supplying a T38FaxMaxDatagram value that is improperly calculated and is
   too low to be of use; we have configuration options available to override
   this behavior.

4) Eliminate use of T38FaxMaxDatagram value in udptl.conf; it is no longer
   needed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 21:47:42 +00:00
Joshua Colp c899add7f9 When receiving SDP that matches the version of the last one do not treat it as a fatal error.
(closes issue #16238)
Reported by: seandarcy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 20:44:30 +00:00
Joshua Colp 28b009b266 Fix a bug where an immediate masquerade would cause a queued unhold frame to get lost. Now we just
indicate unhold directly after the masquerade is complete.

(issue ABE-2011)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 16:29:29 +00:00
Joshua Colp 60e10aba46 Change fax detection in chan_sip so it behaves as one would expect.
Internally the way T.38 is negotiated has changed and the option no longer
reflects a behavior that is valid. It will now look for a CNG tone on
received calls and if present send the call to the 'fax' extension. It is
then up to the application or channel to request the switch over to T.38.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-23 15:45:45 +00:00
Kevin P. Fleming fe1ebc8d46 Merged revisions 230839 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230839 | kpfleming | 2009-11-23 09:09:24 -0600 (Mon, 23 Nov 2009) | 1 line
  
  Correct fix for issue #16268... the reporter's original patch was very close to correct.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-23 15:34:16 +00:00
Kevin P. Fleming 1f759eddfa Merged revisions 230772 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230772 | kpfleming | 2009-11-23 08:13:56 -0600 (Mon, 23 Nov 2009) | 5 lines
  
  Ensure that SDP parsing does not ignore the last line of the SDP.
  
  (closes issue #16268)
  Reported by: sgimeno
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-23 14:15:48 +00:00
Joshua Colp 8ba56154bb Merged revisions 230144 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230144 | file | 2009-11-13 16:00:19 -0600 (Fri, 13 Nov 2009) | 8 lines
  
  Respect the maddr parameter in the Via header.
  
  (closes issue #14446)
  Reported by: frawd
  Patches:
        via_maddr.patch uploaded by frawd (license 610)
  Tested by: frawd
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 22:00:44 +00:00
Tilghman Lesher 5e2aa190fe Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 20:42:03 +00:00
Joshua Colp b3b6537e71 Fix T.38 negotiation regression introduced with the SDP parser changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 15:56:16 +00:00
Matthew Nicholson 2cc2bade4b Reverted revision 201717.
(closes issue 0016175)
Reported by: paul-tg


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-10 15:53:52 +00:00
Joshua Colp c205958f4c Merged revisions 228547 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228547 | file | 2009-11-06 14:32:58 -0400 (Fri, 06 Nov 2009) | 4 lines
  
  Don't overwrite caller ID name on a trunk with the configured fullname when using users.conf
  
  (issue ABE-1989)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 18:37:59 +00:00
Matthew Nicholson b3bd43366f Modify the SDP parsing code to parse session and media level items separately.
With the new code, media level proprieties should no longer be confused with session level proprieties. This change also reorganizes some of the SDP parsing code which should make it easier to manage in the future.

(closes issue #14994)
Reported by: frawd
Tested by: frawd, mnicholson, file

Review: https://reviewboard.asterisk.org/r/414/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 20:13:50 +00:00
Joshua Colp 45f0f0cfef Merged revisions 227700 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r227700 | file | 2009-11-04 15:17:39 -0400 (Wed, 04 Nov 2009) | 5 lines
  
  Fix a security issue where sending a REGISTER with a differing username in the From
  URI and Authorization header would reveal whether it was valid or not.
  
  (AST-2009-008)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 19:20:46 +00:00
Tilghman Lesher 2bbda7a7c8 Two other trunk build fixes (reported by seanbright on #asterisk-dev)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 16:17:18 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Matthew Nicholson 4b69c3af69 Fixed a spelling error in the q850 reason header option in the output of sip show settings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 18:22:28 +00:00
David Vossel 8cd25fc043 user.conf entries in SIP were not having their peer type set.
(closes issue #16120)
Reported by: jsmith


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 17:12:52 +00:00
Olle Johansson ede3699c6e Merged revisions 227088 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r227088 | oej | 2009-11-03 11:29:59 +0100 (Tis, 03 Nov 2009) | 7 lines

Use proper response code when violating Contact ACL's.

https://reviewboard.asterisk.org/r/415/

Thanks kpfleming for a quick review.
(EDVX-003)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 11:11:15 +00:00
David Brooks 2c4d3b3168 SIP channel name uniqueness
SIP channel names were supposed to be unique by way of a name suffix derived from the
pointer to the channel's private data. Uniqueness was preserved on 32-bit systems, but
not on 64-bit systems. This patch, as suggested by kpfleming, replaces this suffix with
a simple incremented unsigned int.

(closes issue #15152)
Reported by: palbrecht

Review: https://reviewboard.asterisk.org/r/420/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-02 20:59:37 +00:00
Matthew Nicholson 93e43578ec This patch adds support for a draft proposal for adding Q.850 reason headers to sip messages.
(closes issue #13385)
Reported by: adomjan
Patches:
      sip.conf.sample-trunk20090929-reason_q850.patch uploaded by adomjan (license 487)
      CHANGES-trunk20090929-reason_q850.patch uploaded by adomjan (license 487)
      chan_sip.c-trunk20090929-reason_q850_atoi_fix.patch uploaded by adomjan (license 487)
      sip-q850-hangupcause1.diff uploaded by mnicholson (license 96)
Tested by: adomjan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-02 14:57:11 +00:00
Joshua Colp 5825f68e8b Add support for receiving unsolicited MWI NOTIFY messages.
This change adds a configuration option to SIP peers, unsolicited_mailbox, which
configures a virtual mailbox to use for received new/old MWI information. This
virtual mailbox can then be used by any device supporting MWI.

(closes issue #13028)
Reported by: AsteriskRocks
Patches:
      bug_13028_chan_sip_external_mwi_20090707.patch uploaded by cmaj (license 830)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-27 13:30:27 +00:00
Kevin P. Fleming ea8b54fb9d Fix building in REF_DEBUG mode.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-26 22:04:04 +00:00
Jeff Peeler ec0a1882c9 ACL check not present for verifying SIP INVITEs
The ACL check in check_peer_ok was missing and has now been restored. The
missing check allowed for calls to be made on prohibited networks where an ACL
was defined in sip.conf and the allowguest option was set to off. See the AST
security advisory below for more information.

Merge code associated with AST-2009-007.

(closes issue #16091)
Reported by: thom4fun


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-26 19:40:26 +00:00
Kevin P. Fleming fb0196fce6 Improve performance of pedantic mode dialog searching in chan_sip.
This patch changes chan_sip to use the new astobj2 OBJ_MULTIPLE iterator support
to make pedantic mode dialog searching in find_call() not require a linear search
of all dialogs in the list of dialogs. This patch does *not* change the dialog
matching logic (more on that later), just improves the searching performance.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-24 14:40:37 +00:00
David Vossel 2208fb171b Fixes an iterator memory leak and uninitialized memory
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-23 14:41:50 +00:00
David Vossel 776a14386a SIP TCP/TLS: move client connection setup/write into tcp helper thread, various related locking/memory fixes.
What this patch fixes
1.Moves sip TCP/TLS connection setup into the TCP helper thread:
  Connection setup takes awhile and before this it was being
  done while holding the monitor lock.
2.Moves TCP/TLS writing to the TCP helper thread:  Through the
  use of a packet queue and an alert pipe, the TCP helper thread
  can now be woken up to write data as well as read data.
3.Locking error: sip_xmit returned an XMIT_ERROR without giving
  up the tcptls_session lock.  This lock has been completely removed
  from sip_xmit and placed in the new sip_tcptls_write() function.
4.Memory leak:  When creating a tcptls_client the tls_cfg was alloced
  but never freed unless the tcptls_session failed to start.  Now the
  session_args for a sip client are an ao2 object which frees the
  tls_cfg on destruction.
5.Pointer to stack variable: During sip_prepare_socket the creation
  of a client's ast_tcptls_session_args was done on the stack and
  stored as a pointer in the newly created tcptls_session.  Depending
  on the events that followed, there was a slight possibility that
  pointer could have been accessed after the stack returned.  Given
  the new changes, it is always accessed after the stack returns
  which is why I found it.

Notable code changes
1.I broke tcptls.c's ast_tcptls_client_start() function into two
  functions.  One for creating and allocating the new tcptls_session,
  and a separate one for starting and handling the new connection.
  This allowed me to create the tcptls_session, launch the helper
  thread, and then establish the connection within the helper thread.
2.Writes to a tcptls_session are now done within the helper thread.
  This is done by using an alert pipe to wake up the thread if new
  data needs to be sent.  The thread's sip_threadinfo object contains
  the alert pipe as well as the packet queue.
3.Since the threadinfo object contains the alert pipe, it must now be
  accessed outside of the helper thread for every write (queuing of a
  packet).  For easy lookup, I moved the threadinfo objects from a
  linked list to an ao2_container.

(closes issue #13136)
Reported by: pabelanger
Tested by: dvossel, whys

(closes issue #15894)
Reported by: dvossel
Tested by: dvossel

Review: https://reviewboard.asterisk.org/r/380/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 19:55:51 +00:00
Kevin P. Fleming 87ff40d3f3 Add 'mohsuggest' configuration option to 'sip show peer' CLI command and
SIPShowPeer AMI action.

(closes issue #15990)
Reported by: _brent_
Patches:
      sip_peer_info_mohsuggest-r3.patch uploaded by brent (license 388)

Review: https://reviewboard.asterisk.org/r/381/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 21:15:40 +00:00
Joshua Colp 01ab66275a Add support for specifying the IP address to use for media streams in sip.conf
This is the second commit for this and documents the text stream using the configured
IP address and fixes a bug in the original patch where the UDPTL stream would also
use the different IP address.

(closes issue #14729)
Reported by: _brent_
Patches:
      media_address.patch uploaded by brent (license 388)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 15:35:09 +00:00
Joshua Colp a31eb5bb35 Revert media_address commit, I'm going to roll a fix to the SDP generation in the next version.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 15:04:33 +00:00
David Vossel 984d6500ce Merged revisions 225032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225032 | dvossel | 2009-10-21 09:37:04 -0500 (Wed, 21 Oct 2009) | 20 lines
  
  IAX/SIP shrinkcallerid option
  
  The shrinking of caller id removes '(', ' ', ')', non-trailing '.',
  and '-' from the string.  This means values such as 555.5555 and
  test-test result in 555555 and testtest.  There are instances,
  such as Skype integration, where a specific value is passed via
  caller id that must be preserved unmodified.  This patch makes
  the shrinking of caller id optional in chan_sip and chan_iax in
  order to support such cases.  By default this option is on to
  preserve previous expected behavior.
  
  (closes issue #15940)
  Reported by: dimas
  Patches:
        v2-15940.patch uploaded by dimas (license 88)
        15940_shrinkcallerid_trunk.c uploaded by dvossel (license 671)
  Tested by: dvossel
  
  Review: https://reviewboard.asterisk.org/r/408/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225033 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 14:39:10 +00:00
Joshua Colp 28d0ec5421 Add support for specifying the IP address to use for media streams in sip.conf
(closes issue #14729)
Reported by: _brent_
Patches:
      media_address.patch uploaded by brent (license 388)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 13:34:49 +00:00
Jeff Peeler e3f473f4f3 Allow for adding message body to the SIP NOTIFY message
Ability has been added to both manager command SIPnotify as well as console
command sip notify. Message body is stored in the "Content" variable. An 
example is present in sip_notify.conf.

(closes issue #13926)
Reported by: jthurman
Patches:
      sip-notify-svn189463.diff uploaded by gareth (license 208)
Tested by: gareth


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-14 17:48:57 +00:00
Kevin P. Fleming e197f85b8c Remove automatic switching from T.38 to voice mode in chan_sip.
chan_sip has some code to automatically switch from T.38 mode to voice mode when
a voice frame is written to the channel while it is in T.38 mode; this was
intended to handle the situation when a FAX transmission has ended and the channel
is not yet hung up, but is causing problems at the beginning of FAX sessions as
well when there are still voice frames 'in flight' at the time the T.38 negotiation
completes. This patch removes the automatic switchover, and changes app_fax to
explicitly switch off T.38 mode when the FAX transmission process ends.

(closes issue #16025)
Reported by: jamicque


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-12 14:25:29 +00:00
Mark Michelson 9e1598b762 Check the proper page for the SENDRPID flag.
If a pending reinvite were sent, we might not properly
send connected party info since we were checking the wrong
flag. This was a rare occurrence, but could still happen
nevertheless.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-11 22:19:22 +00:00
David Vossel fc27da108d Merged revisions 223205 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r223205 | dvossel | 2009-10-09 12:52:35 -0500 (Fri, 09 Oct 2009) | 10 lines
  
  fixes sip registration using authuser in user.conf
  
  (closes issue #14954)
  Reported by: tornblad
  Tested by: mmichelson, tornblad, dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-09 17:53:37 +00:00
David Vossel 0a50c512da 'auth=' did not parse md5 secret correctly
(closes issue #15949)
Reported by: ebroad
Patches:
      authparsefix.patch uploaded by ebroad (license 878)
      15949_trunk.diff uploaded by dvossel (license 671)
Tested by: ebroad


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-09 16:54:02 +00:00
David Vossel b2a7eecd6e p->peerauth is always empty in transmit_register()
When using callbackextension or specifing the peer name
in a registration string, the peer's specific auth settings
set by the "auth=" strings within the peer definition are not
used by the registration.  Thanks to ebroad for reporting the
issue and providing the patch.

(closes issue #15955)
Reported by: ebroad
Patches:
      regauthfix.patch uploaded by ebroad (license 878)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-09 15:49:30 +00:00
David Vossel 799e9962b6 fixed comment line for do_magic_pickup
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-08 22:57:53 +00:00
David Vossel c0ee60419d Deadlock between ast_cel_report_event and ast_do_masquerade
chan_sip calls pbx_exec on a pvt's owner channel while only the
pvt lock is held.  Since pbx_exec calls ast_cel_report_event which
attempts to lock the channel, invalid locking order occurs.  Channels
should be locked before pvt's.

(closes issue #15512)
Reported by: lmsteffan
Patches:
      ast_cel_deadlock_15512.diff uploaded by dvossel (license 671)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-08 22:04:41 +00:00
David Vossel b764544641 makes externtcpport and externtlsport static variables
externtcpport and externtlsport need to be declared as static
variables.  Thanks to russell for finding and pointing this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-08 20:53:14 +00:00
David Vossel 9456ab2724 Deadlock in channel masquerade handling
Channels are stored in an ao2_container.  When accessing an item within
an ao2_container the proper locking order is to first lock the container,
and then the items within it.

In ast_do_masquerade both the clone and original channel must be locked
for the entire duration of the function.  The problem with this is that
it attemptes to unlink and link these channels back into the ao2_container
when one of the channel's name changes.  This is invalid locking order as
the process of unlinking and linking will lock the ao2_container while
the channels are locked!!! Now, both the channels in do_masquerade are
unlinked from the ao2_container and then locked for the entire function.
At the end of the function both channels are unlocked and linked back
into the container with their new names as hash values.

This new method of requiring all channels and tech pvts to be unlocked
before ast_do_masquerade() or ast_change_name() required several
changes throughout the code base.

(closes issue #15911)
Reported by: russell
Patches:
      masq_deadlock_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel, atis

(closes issue #15618)
Reported by: lmsteffan
Patches:
      deadlock_local_attended_transfers_trunk.diff uploaded by dvossel (license 671)
Tested by: lmsteffan, dvossel

Review: https://reviewboard.asterisk.org/r/387/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 22:58:38 +00:00
David Vossel f819ce5b20 Merged revisions 222542 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222542 | dvossel | 2009-10-07 12:41:21 -0500 (Wed, 07 Oct 2009) | 8 lines
  
  crash on transfer
  
  handle_invite_replaces() attempts to uplock a pvt's
  owner channel without first verifing that it exists.
  
  (issue #16027)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 17:44:52 +00:00
David Vossel 1d40faebac contact header port ignored transport when using externip
This patch adds support for TCP/TLS in the Contact header when using
NAT, specifically externip or externhost. The original issue was that
Asterisk sent 5060 as the port in the contact header whether TLS was
used or not. Additionally, this patch adds 2 config options to sip.conf,
specifically externtcpport and externtlsport. This allows a user to
specify different external ports for TCP and TLS other than those used
internally, this is especially useful in in a PAT/port redirection setup.
Thanks to ebroad for reporting the issue and providing the patch!

(closes issue #15880)
Reported by: ebroad
Patches:
      portmap.patch uploaded by ebroad (license 878)
      externtXXport_v2.patch uploaded by ebroad (license 878)
Tested by: ebroad

Review: https://reviewboard.asterisk.org/r/392/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 22:39:56 +00:00
Kevin P. Fleming 1c9fe00920 Recorded merge of revisions 222152 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
  
  Fix ao2_iterator API to hold references to containers being iterated.
  
  See Mantis issue for details of what prompted this change.
  
  Additional notes:
  
  This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
  has become an enum instead of a macro, with a name that fits our
  naming policy; also, it is now necessary to call
  ao2_iterator_destroy() on any iterator that has been
  created. Currently this only releases the reference to the container
  being iterated, but in the future this could also release other
  resources used by the iterator, if the iterator implementation changes
  to use additional resources.
  
  (closes issue #15987)
  Reported by: kpfleming
  
  Review: https://reviewboard.asterisk.org/r/383/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 01:24:24 +00:00
Kevin P. Fleming 20743ec07d Allow non-compliant T.38 endpoints to be supportable via configuration option.
Many T.38 endpoints incorrectly send the maximum IFP frame size they can accept
as the T38FaxMaxDatagram value in their SDP, when in fact this value is
supposed to be the maximum UDPTL payload size (datagram size) they can accept.
If the value they supply is small enough (a commonly supplied value is '72'),
T.38 UDPTL transmissions will likely fail completely because the UDPTL packets
will not have enough room for a primary IFP frame and the redundancy used for
error correction. If this occurs, the Asterisk UDPTL stack will emit log messages
warning that data loss may occur, and that the value may need to be overridden.

This patch extends the 't38pt_udptl' configuration option in sip.conf to allow
the administrator to override the value supplied by the remote endpoint and
supply a value that allows T.38 FAX transmissions to be successful with that
endpoint. In addition, in any SIP call where the override takes effect, a debug
message will be printed to that effect. This patch also removes the
T38FaxMaxDatagram configuration option from udptl.conf.sample, since it has not
actually had any effect for a number of releases.

In addition, this patch cleans up the T.38 documentation in sip.conf.sample
(which incorrectly documented that T.38 support was passthrough only).

(issue #15586)
Reported by: globalnetinc


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-05 19:45:00 +00:00
Tilghman Lesher c0a884ba29 Revision 220906 (a merge from 1.4) was not merged correctly, causing a problem with non-dynamic peers.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 20:09:46 +00:00
David Vossel aaa7284c00 outbound tls connections were not defaulting to port 5061
(closes issue #15854)
Reported by: dvossel
Patches:
      sip_port_config_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel

Review: https://reviewboard.asterisk.org/r/357/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 19:33:33 +00:00
Matthew Nicholson da169b2db4 Merged revisions 221588 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221588 | mnicholson | 2009-10-01 10:24:00 -0500 (Thu, 01 Oct 2009) | 2 lines
  
  Use unsigned ints for portinuri flags.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 15:26:20 +00:00
Olle Johansson 73697dc2c7 Simplify code for porturi, use TRUE/FALSE constructs when it's just TRUE or FALSE.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 07:00:04 +00:00
Matthew Nicholson d043f52a2d Cleaned up merge from r221432
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 23:04:03 +00:00
Matthew Nicholson a5eee590f4 Merged revisions 221360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221360 | mnicholson | 2009-09-30 14:36:06 -0500 (Wed, 30 Sep 2009) | 10 lines
  
  Fix SRV lookup and Request-URI generation in chan_sip.
  
  This patch adds a new field "portinuri" to the sip dialog struct and the sip peer struct.  That field is used during RURI generation to determine if the port should be included in the RURI.  It is also used in some places to determine if an SRV lookup should occur.
  
  (closes issue #14418)
  Reported by: klaus3000
  Tested by: klaus3000, mnicholson
  
  Review: https://reviewboard.asterisk.org/r/369/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 20:40:20 +00:00
Terry Wilson 10ce6cd757 Use rtp properties instead of adding a callback
Thanks, Josh.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 18:21:03 +00:00
Terry Wilson 865daf4858 Merged revisions 221086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221086 | twilson | 2009-09-30 09:49:11 -0500 (Wed, 30 Sep 2009) | 25 lines
  
  Change the SSRC by default when our media stream changes
  
  Be default, change SSRC when doing an audio stream changes Asterisk doesn't
  honor marker bit when reinvited to already-bridged RTP streams,resulting in
  far-end stack discarding packets with "old" timestamps that areactually part of
  a new stream.  This patch sends AST_CONTROL_SRCUPDATE whenever there is a
  reinvite, unless the 'constantssrc' is set to true in sip.conf.
  
  The original issue reported to Digium support detailed the following situation:
  ITSP <-> Asterisk 1.4.26.2 <-> SIP-based Application Server Call comes in
  fromITSP, Asterisk dials the app server which sends a re-invite back
  toAsterisk--not to negotiate to send media directly to the ITSP, but to
  indicatethat it's changing the stream it's sending to Asterisk.  The app
  servergenerates a new SSRC, sequence numbers, timestamps, and sets the marker
  bit on the new stream.  Asterisk passes through the teimstamp of the new stream,
  butdoes not reset the SSRC, sequence numbers, or set the marker bit.
  
  When the timestamp on the new stream is older than the timestamp on the
  originalstream, the ITSP (which doesn't know there has been any change) discards
  the newframes because it thinks they are too old.  This patch addresses this by
  changing the SSRC on a stream update unless constantssrc=true is set in
  sip.conf.
  
  Review: https://reviewboard.asterisk.org/r/374/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 17:52:30 +00:00
Tilghman Lesher 6f5e763fe5 Merged revisions 220873 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r220873 | tilghman | 2009-09-29 12:59:26 -0500 (Tue, 29 Sep 2009) | 9 lines
  
  Reduce CPU usage related to building a peer merely for devicestates.
  This fixes a 100% CPU problem in the SIP driver, found by profiling
  the driver while the problem was occurring.
  (closes issue #14309)
   Reported by: pkempgen
   Patches: 
         20090924__issue14309.diff.txt uploaded by tilghman (license 14)
   Tested by: pkempgen, vrban
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-29 19:57:37 +00:00
Jeff Peeler 05f94a05c2 Fix building of registration entry in build_peer when using callbackextension
Check for remotesecret option was unintentionally always true, which therefore
caused the secret option to never be used. Thanks to dvossel for pointing out
the exact fix.

(closes issue #15943)
Reported by: tpsast



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-28 19:10:10 +00:00
Matthew Nicholson 944b05d51a Ensure the numeric portion of the P-Asserted-Identity header is properly escaped.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24 16:33:20 +00:00
David Vossel e85e39899f Merged revisions 219450 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219450 | dvossel | 2009-09-18 11:19:15 -0500 (Fri, 18 Sep 2009) | 14 lines
  
  via-header branches not updated correctly on INVITE
  
  INVITE requests must always contain a new unique branch id. When
  a new branch id is created for an INVITE, the dialog's invite_branch
  variable must be updated so CANCEL requests use the correct branch id.
  
  (closes issue #15262)
  Reported by: maniax
  Patches:
        asterisk-1.6.1.0-sip-branch.patch uploaded by tweety (license 608)
        invite_new_branch_trunk.diff uploaded by dvossel (license 671)
  Tested by: maniax, dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-18 16:20:41 +00:00
David Vossel 06782af238 fixes deadlock when performing directed pickup w Invite/replaces
(closes issue #15340)
Reported by: lmsteffan
Patches:
      deadlock.patch uploaded by lmsteffan (license 779)
Tested by: lmsteffan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 22:37:28 +00:00
Mark Michelson dc6f08e275 Merged revisions 219320 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219320 | mmichelson | 2009-09-17 17:20:50 -0500 (Thu, 17 Sep 2009) | 6 lines
  
  Send a 100 Trying response when we detect a spiral.
  
  This was problematic during spiral tests at SIPit...
  along with some other things as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 22:22:01 +00:00
David Vossel 0284951e77 Merged revisions 219303 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219303 | dvossel | 2009-09-17 16:29:37 -0500 (Thu, 17 Sep 2009) | 21 lines
  
  INVITE w/Replaces deadlock fix
  
  This patch cleans up the locking logic in chan_sip.c's
  handle_invite_replaces() function as well as making use
  of ast_do_masquerade() rather than forcing the masquerade
  on an ast_read().  The code had several redundant unlocks
  that would result in 'freed more times than we've locked!'
  errors. I cleaned these up as well as moving all the unlock
  logic to the end of the function.  This patch should also
  resolve the issue people were having with the replacecall
  channel never being unlocked with one legged calls.
  
  (closes issue #15151)
  Reported by: irroot
  Patches:
        invite_w_replaces_1.4.diff uploaded by dvossel (license 671)
  Tested by: irroot, dvossel
  
  Review: https://reviewboard.asterisk.org/r/371/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 21:59:21 +00:00
Joshua Colp 8a3f2fff91 Ensure no spaces exist before "refresher=" when doing the comparison.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 19:57:39 +00:00
Mark Michelson 19aeff195a Reverse order of args to fread.
This way, we don't always write a null byte into
byte 1 of the buffer

(closes issue #15905)
Reported by: ebroad
Patches:
      freadfix.patch uploaded by ebroad (license 878)
Tested by: ebroad



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-16 19:25:36 +00:00
Joshua Colp 5c52a7a746 On TCP and TLS connections do not attempt to stop retransmission of the packet internally.
This was preventing responses from being properly processed because the packet was not being found
causing handle_response to return prematurely.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-16 18:31:47 +00:00
David Vossel c373c8807e upward bound checking for port string to int conversion
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-15 19:22:37 +00:00
Matthew Nicholson 6f6998fef7 Merged revisions 218578 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r218578 | mnicholson | 2009-09-15 11:03:54 -0500 (Tue, 15 Sep 2009) | 8 lines
  
  Send request contact header field with response to registrer queries instead of the address of record.
  
  (closes issue #14438)
  Reported by: ravindrad
  Patches:
        regquerypatch uploaded by ravindrad (license 684)
  Tested by: ravindrad
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-15 16:15:02 +00:00
Mark Michelson 15c7e6dea2 Use a better method of ensuring null-termination of the buffer
while reading the SDP when using TCP.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-15 15:40:14 +00:00
Mark Michelson 579919e831 Ensure that SDP read from TCP socket is null-terminated.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-15 15:05:53 +00:00
Mark Michelson b72f28ea01 Fix off-by-one error when reading SDP sent over TCP.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-15 14:59:50 +00:00
Tilghman Lesher 1b147b0094 Make calltoken support work with realtime users and peers.
In the course of this, I also found that the results of ast_gethostbyname
were being used incorrectly in both chan_iax2 and chan_sip, so both have
been fixed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 23:12:16 +00:00
Olle Johansson 58c4e9506a Don't assign UINT_MAX to an INT.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 18:29:21 +00:00
Olle Johansson c5b0e6e78e Include ActionID in all events that are responsed to AMI Action SIPShowRegistry
(closes issue #15868)
Reported by: nic_bellamy
Patches: 
      manager_SIPshowregistry_actionid.patch uploaded by nic bellamy (license 299)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 12:06:55 +00:00
Olle Johansson b6122d1a00 Don't report transfer success until we actually know. 1xx messages are not final.
Related to #12713

Patch by oej

A big thank you to file for finally fixing the transfer() dialplan application.
I've been waiting for years for this. Great work!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-09 20:09:31 +00:00
Olle Johansson cc01708520 Not having any TLS session to write to is a serious XMIT_ERROR.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-09 10:39:43 +00:00
Olle Johansson b9b6639694 Formatting and doxygen updates
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-09 10:38:45 +00:00
David Vossel 7476991786 caller id number empty
parse_uri was not being given the correct scheme's, as
a result, uri parsing did not parse the username correctly.
One of the side effects of this is an empty caller id.

(closes issue #15839)
Reported by: ebroad
Patches:
      blank_cidv2.patch uploaded by ebroad (license 878)
      parse_uri_fix.diff uploaded by dvossel (license 671)
Tested by: ebroad, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-08 14:26:30 +00:00
Olle Johansson 730715337e Moving another function declared in the middle of forward declarations.
Please follow the structure of the source code, thanks. Chan_sip is messy enough as it is :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 18:29:45 +00:00
Olle Johansson dce193357f Move "deprecated_username" to a flag like the others - unsigned int blah:1
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 18:26:37 +00:00
Olle Johansson 8e37e119f8 - Doxygen additions
- Remove unused string in sip_registry -- "random"
- Someone added a function in the middle of all forward declarations... Weird. Moved it out of that
  section.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 18:24:04 +00:00
Olle Johansson c55469da80 Clean up the "offered_media" code
- Add variable for number of known media streams instead of hardcoding in definition of sip_pvt
- Rename "text" to "codecs" - beacuse it's what it is
- Add documentation for future developers so that we make sure that we define new sdp media types
  for SRTP-variants


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 18:00:48 +00:00
Olle Johansson 42a4b05811 Make sure we reset global_exclude_static at channel reload
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 16:35:12 +00:00
Olle Johansson b890815521 Move capability into sip_cfg. While at it, make sure we reset it at channel reload.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 16:31:36 +00:00
Olle Johansson 3b8cec9d32 Move global_regcontext into the sip_cfg structure
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 16:26:04 +00:00
Olle Johansson 320b514b18 Move contact_ha to sip_cfg structure
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 16:23:39 +00:00
Olle Johansson c20324021d Doxygen updates
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 16:16:58 +00:00
Olle Johansson 11574bcfcf Since it's possible to have more than 999 calls, I'm changing the call counter roof to something higher.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 16:08:08 +00:00
Olle Johansson 246e0852a7 add doxygen and remove duplicate declaration of variable
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 16:00:41 +00:00
Olle Johansson 2e1d7378be After many years, remove VOCAL_DATA_HACK definition
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 15:48:41 +00:00
Olle Johansson 9c63a09344 Remove unneeded header files (tested on Linux and OS/X)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 15:47:40 +00:00
Olle Johansson 5afc513ae3 Don't send MESSAGE with sendtext() if recepient doesn't allow MESSAGE requests
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 14:54:14 +00:00
Olle Johansson 008b7a4ab8 Add some doxygen
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 14:21:01 +00:00
Olle Johansson e242e1b2ad Fix typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 14:04:40 +00:00
Olle Johansson e1c711b7de If there is no session timer in the INVITE, set it to default value (not unset minimum = -1)
Patch by oej

closes issue #15621
Reported by: fnordian
Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 13:06:19 +00:00
Olle Johansson 109cab6862 Simplify the code in this function
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 11:31:19 +00:00
David Vossel 4596fdb788 sip peer matching by address only with TCP/TLS
This patch removes the contact header matching logic and
adds logic to match all tcp/tls connections by ip only.
Thanks to oej for finding the issue and suggesting solutions.

Review: https://reviewboard.asterisk.org/r/354/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-04 19:32:07 +00:00
Olle Johansson 98f18d56b8 Merged revisions 216430 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r216430 | oej | 2009-09-04 15:45:48 +0200 (Fre, 04 Sep 2009) | 27 lines

Make apps send PROGRESS control frame for early media and fix too early media issue in SIP

The issue at hand is that some legacy (dying) PBX systems send empty media frames on PRI
links *before* any call progress. The SIP channel receives these frames and by default
signals 183 Session progress and starts sending media. This will cause phones to 
play silence and ignore the later 180 ringing message. A bad user experience.

The fix is twofold:
- We discovered that asterisk apps that support early media ("noanswer") did not send
  any PROGRESS frame to indicate early media. Fixed.
- We introduce a setting in chan_sip so that users can disable any relay of media frames
  before the outbound channel actually indicates any sort of call progress.
  In 1.4, 1.6.0 and 1.6.1, this will be disabled for backward compatibility. In later versions
  of Asterisk, this will be enabled. We don't assume that it will change your Asterisk
  phone experience - only for the better.

We encourage third-party application developers to make sure that if they have applications
that wants to send early media, add a PROGRESS control frame transmission to make sure that
all channel drivers actually will start sending early media. This has not been the default
in Asterisk previous to this patch, so if you got inspiration from our code, you need to
update accordingly. Sorry for the trouble and thanks for your support.

This code has been running for a few months in a large scale installation (over 250
servers with PRI and/or BRI links to old PBX systems). 
That's no proof that this is an excellent patch, but, well, it's tested :-)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-04 14:02:34 +00:00
Russell Bryant ca23afaf2d Do not treat every SIP peer as if they were configured with insecure=port.
There was a problem in the function responsible for doing peer matching by
IP address and port number such that during the second pass for checking for
a peer configured with insecure=port, it would end up treating every peer as
if it had been configured that way.  These changes fix the logic in the peer
IP and port comparison callback to handle insecure=port checking properly.

This problem was introduced when SIP peers were converted to astobj2.  Many
thanks to dvossel for noticing this while working on another peer matching
issue.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-04 13:14:25 +00:00
Olle Johansson 6d6ce303cb Add known internal IP address when autodomain=yes
(closes issue #14573)
Reported by: pj
Patches: 
      sip-internip-autodomain1.diff uploaded by mnicholson (license 96)
	modified by oej
Tested by: pj



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 13:02:41 +00:00
Tilghman Lesher a6ba2b64b1 Default the callback extension to "s". This is a regression.
(closes issue #15764)
 Reported by: elguero
 Change-type: bugfix


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 03:43:51 +00:00