dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

2922 Commits

Author SHA1 Message Date
russell b40e92597a Tell the RTP engine API about the initial read and write format.
Peer reviewed out-of-band by file.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252627 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-15 22:14:18 +00:00
tilghman 3c26b0b9c6 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: http://svn.digium.com/svn/asterisk/trunk@252442 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-15 04:25:35 +00:00
twilson 88bfcb6713 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: http://svn.digium.com/svn/asterisk/trunk@252089 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-12 22:04:51 +00:00
russell 5e8a340e01 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: http://svn.digium.com/svn/asterisk/trunk@251137 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-06 14:16:20 +00:00
russell a920117367 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: http://svn.digium.com/svn/asterisk/trunk@250917 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-05 05:03:41 +00:00
dvossel eef192b568 fixes signed to unsigned int comparision issue for FaxMaxDatagram value.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250246 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-03 00:18:28 +00:00
dvossel 3b12e80473 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: http://svn.digium.com/svn/asterisk/trunk@249893 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-02 19:08:38 +00:00
mmichelson cc013d0f9a 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: http://svn.digium.com/svn/asterisk/trunk@249101 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-26 17:04:58 +00:00
dvossel bae3ac487b 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: http://svn.digium.com/svn/asterisk/trunk@248397 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-23 16:34:39 +00:00
mmichelson f18ebf7f35 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: http://svn.digium.com/svn/asterisk/trunk@248347 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-22 20:19:00 +00:00
dvossel 0d6e0a0843 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: http://svn.digium.com/svn/asterisk/trunk@247915 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-19 17:40:26 +00:00
tilghman df209a3f23 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: http://svn.digium.com/svn/asterisk/trunk@247787 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-18 21:42:53 +00:00
tilghman eae21bd2ff 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: http://svn.digium.com/svn/asterisk/trunk@247124 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-17 06:25:15 +00:00
tilghman e636142894 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: http://svn.digium.com/svn/asterisk/trunk@246724 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-16 00:19:38 +00:00
dvossel d39a409a7e 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: http://svn.digium.com/svn/asterisk/trunk@246627 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-15 15:45:02 +00:00
dvossel 02a324bee2 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: http://svn.digium.com/svn/asterisk/trunk@246420 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-12 17:59:39 +00:00
mnicholson 2d98c63352 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: http://svn.digium.com/svn/asterisk/trunk@245727 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-09 17:40:04 +00:00
mmichelson 11727b12fb 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: http://svn.digium.com/svn/asterisk/trunk@245230 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-07 19:51:54 +00:00
mmichelson 3821fedd30 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: http://svn.digium.com/svn/asterisk/trunk@245192 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-06 14:43:03 +00:00
dvossel 05cb355977 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: http://svn.digium.com/svn/asterisk/trunk@244924 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-05 16:59:06 +00:00
dvossel 2a0fdcc054 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: http://svn.digium.com/svn/asterisk/trunk@244769 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-04 23:16:30 +00:00
dvossel 10d028214d -----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: http://svn.digium.com/svn/asterisk/trunk@244597 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-03 20:33:32 +00:00
dvossel 58fe88b0cc 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: http://svn.digium.com/svn/asterisk/trunk@244443 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-02 22:27:23 +00:00
russell 74bd0f4837 Add a missing line terminator for T.38 SDP.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243860 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-28 18:35:15 +00:00
russell 07d74c25ba 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: http://svn.digium.com/svn/asterisk/trunk@243780 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-28 15:07:23 +00:00
dvossel 1bc7ad599c 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: http://svn.digium.com/svn/asterisk/trunk@243200 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 16:30:08 +00:00
oej 9acb1a538e 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: http://svn.digium.com/svn/asterisk/trunk@242227 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-22 09:28:34 +00:00
seanbright adc69e041d Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240368 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 18:21:50 +00:00
oej 1e093315b0 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: http://svn.digium.com/svn/asterisk/trunk@239663 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-13 10:24:23 +00:00
dvossel ba2fce3739 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: http://svn.digium.com/svn/asterisk/trunk@239427 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-12 16:14:41 +00:00
dvossel 78f305ec34 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: http://svn.digium.com/svn/asterisk/trunk@238405 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-07 20:00:31 +00:00
tilghman c26a1c46a0 Whoa, duplicate setting (dead code).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237968 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-06 06:53:23 +00:00
tilghman 484fd7c9a4 global_contact_ha was renamed in trunk
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237213 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-02 16:35:35 +00:00
oej 99a6da6b87 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: http://svn.digium.com/svn/asterisk/trunk@237136 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-02 09:54:22 +00:00
jpeeler 5c6045484e 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: http://svn.digium.com/svn/asterisk/trunk@236893 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-30 20:34:41 +00:00
tilghman 4e9d12bf8b 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: http://svn.digium.com/svn/asterisk/trunk@236802 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-29 23:05:45 +00:00
dvossel a845ce2e73 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: http://svn.digium.com/svn/asterisk/trunk@236063 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-22 17:00:08 +00:00
file 0f9b717f2d 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: http://svn.digium.com/svn/asterisk/trunk@235521 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-17 23:21:07 +00:00
dvossel a063e81a8e 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: http://svn.digium.com/svn/asterisk/trunk@235132 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-15 18:43:06 +00:00
oej 0641077477 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: http://svn.digium.com/svn/asterisk/trunk@234526 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-14 10:46:20 +00:00
tilghman 87288bd3d6 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: http://svn.digium.com/svn/asterisk/trunk@234129 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-10 16:24:26 +00:00
dvossel 004794f6bd 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: http://svn.digium.com/svn/asterisk/trunk@233472 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-07 18:08:46 +00:00
mnicholson 68a300e46a 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: http://svn.digium.com/svn/asterisk/trunk@233394 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-07 16:14:42 +00:00
mmichelson 989993214b 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: http://svn.digium.com/svn/asterisk/trunk@232365 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 17:18:07 +00:00
file a8f66229ae 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: http://svn.digium.com/svn/asterisk/trunk@232345 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 16:40:14 +00:00
file 9690295931 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: http://svn.digium.com/svn/asterisk/trunk@232230 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 14:54:28 +00:00
tilghman f4d89e410a 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: http://svn.digium.com/svn/asterisk/trunk@231850 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 20:27:37 +00:00
kpfleming 9b2fe661f9 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: http://svn.digium.com/svn/asterisk/trunk@231692 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:47:42 +00:00
file 9065ff70f8 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: http://svn.digium.com/svn/asterisk/trunk@231602 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 20:44:30 +00:00
file 5891500dc9 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: http://svn.digium.com/svn/asterisk/trunk@231436 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 16:29:29 +00:00
file 637beb5d89 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: http://svn.digium.com/svn/asterisk/trunk@230881 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-23 15:45:45 +00:00
kpfleming 7fd651a24f 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: http://svn.digium.com/svn/asterisk/trunk@230877 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-23 15:34:16 +00:00
kpfleming ad6a44c39d 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: http://svn.digium.com/svn/asterisk/trunk@230773 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-23 14:15:48 +00:00
file 7a55e1be13 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: http://svn.digium.com/svn/asterisk/trunk@230145 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 22:00:44 +00:00
tilghman 317ea2e45d Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230111 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 20:42:03 +00:00
file 9f930a0147 Fix T.38 negotiation regression introduced with the SDP parser changes.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229912 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 15:56:16 +00:00
mnicholson 9fb84e9fcb Reverted revision 201717.
(closes issue 0016175)
Reported by: paul-tg


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229102 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-10 15:53:52 +00:00
file 9baa79d4f1 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: http://svn.digium.com/svn/asterisk/trunk@228548 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-06 18:37:59 +00:00
mnicholson 0faabfe8fc 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: http://svn.digium.com/svn/asterisk/trunk@227759 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 20:13:50 +00:00
file 2088c56027 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: http://svn.digium.com/svn/asterisk/trunk@227712 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 19:20:46 +00:00
tilghman 22a9bedb8b Two other trunk build fixes (reported by seanbright on #asterisk-dev)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227615 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 16:17:18 +00:00
tilghman 3bacd4082e Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 14:05:12 +00:00
mnicholson cc975eadf7 Fixed a spelling error in the q850 reason header option in the output of sip show settings.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227298 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 18:22:28 +00:00
dvossel 4d4eccc296 user.conf entries in SIP were not having their peer type set.
(closes issue #16120)
Reported by: jsmith


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227238 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 17:12:52 +00:00
oej 76f7d4f24d 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: http://svn.digium.com/svn/asterisk/trunk@227091 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 11:11:15 +00:00
dbrooks 0213b3cdb2 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: http://svn.digium.com/svn/asterisk/trunk@226974 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-02 20:59:37 +00:00
mnicholson 918b5f261a 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: http://svn.digium.com/svn/asterisk/trunk@226687 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-02 14:57:11 +00:00
file cdf1218361 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: http://svn.digium.com/svn/asterisk/trunk@226060 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-27 13:30:27 +00:00
kpfleming ae8a2db381 Fix building in REF_DEBUG mode.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225956 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-26 22:04:04 +00:00
jpeeler 24886e89c9 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: http://svn.digium.com/svn/asterisk/trunk@225912 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-26 19:40:26 +00:00
kpfleming 71f1e05d0d 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: http://svn.digium.com/svn/asterisk/trunk@225727 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-24 14:40:37 +00:00
dvossel 8f0f7a226d Fixes an iterator memory leak and uninitialized memory
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225650 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-23 14:41:50 +00:00
dvossel 226347511b 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: http://svn.digium.com/svn/asterisk/trunk@225445 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 19:55:51 +00:00
kpfleming 755e994df5 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: http://svn.digium.com/svn/asterisk/trunk@225245 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 21:15:40 +00:00
file 4ee1202b6a 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: http://svn.digium.com/svn/asterisk/trunk@225089 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 15:35:09 +00:00
file a4b1c3dd6a Revert media_address commit, I'm going to roll a fix to the SDP generation in the next version.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225034 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 15:04:33 +00:00
dvossel 7f743355f9 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: http://svn.digium.com/svn/asterisk/trunk@225033 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 14:39:10 +00:00
file 5371fe2fc8 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: http://svn.digium.com/svn/asterisk/trunk@225003 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 13:34:49 +00:00
jpeeler d02738f592 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: http://svn.digium.com/svn/asterisk/trunk@224035 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-14 17:48:57 +00:00
kpfleming ab9e4d6141 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: http://svn.digium.com/svn/asterisk/trunk@223652 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-12 14:25:29 +00:00
mmichelson 1274cfa248 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: http://svn.digium.com/svn/asterisk/trunk@223617 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-11 22:19:22 +00:00
dvossel 1bb56d7d53 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: http://svn.digium.com/svn/asterisk/trunk@223206 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-09 17:53:37 +00:00
dvossel 02f5821a59 '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: http://svn.digium.com/svn/asterisk/trunk@223132 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-09 16:54:02 +00:00
dvossel 5e43f2f50c 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: http://svn.digium.com/svn/asterisk/trunk@223088 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-09 15:49:30 +00:00
dvossel ce4286ad28 fixed comment line for do_magic_pickup
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223015 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 22:57:53 +00:00
dvossel a9eb411a7e 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: http://svn.digium.com/svn/asterisk/trunk@222981 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 22:04:41 +00:00
dvossel acff726a55 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: http://svn.digium.com/svn/asterisk/trunk@222947 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 20:53:14 +00:00
dvossel 41a7e60c45 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: http://svn.digium.com/svn/asterisk/trunk@222761 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-07 22:58:38 +00:00
dvossel 2e8cd2c584 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: http://svn.digium.com/svn/asterisk/trunk@222543 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-07 17:44:52 +00:00
dvossel e0cd2b2101 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: http://svn.digium.com/svn/asterisk/trunk@222398 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 22:39:56 +00:00
kpfleming e299cf0653 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: http://svn.digium.com/svn/asterisk/trunk@222176 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 01:24:24 +00:00
kpfleming f5671885b8 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: http://svn.digium.com/svn/asterisk/trunk@222110 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-05 19:45:00 +00:00
tilghman d70b10c8f6 Revision 220906 (a merge from 1.4) was not merged correctly, causing a problem with non-dynamic peers.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221705 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01 20:09:46 +00:00
dvossel eebac19726 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: http://svn.digium.com/svn/asterisk/trunk@221697 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01 19:33:33 +00:00
mnicholson d5aef5d4fc 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: http://svn.digium.com/svn/asterisk/trunk@221589 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01 15:26:20 +00:00
oej c450edf568 Simplify code for porturi, use TRUE/FALSE constructs when it's just TRUE or FALSE.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221554 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01 07:00:04 +00:00
mnicholson c6f4c011f3 Cleaned up merge from r221432
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221484 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 23:04:03 +00:00
mnicholson b5d9a1eff9 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: http://svn.digium.com/svn/asterisk/trunk@221432 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 20:40:20 +00:00
twilson b8e1d3fe36 Use rtp properties instead of adding a callback
Thanks, Josh.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221278 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 18:21:03 +00:00
twilson bc354c76f4 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: http://svn.digium.com/svn/asterisk/trunk@221266 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 17:52:30 +00:00
tilghman d3c2823fc7 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: http://svn.digium.com/svn/asterisk/trunk@220906 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-29 19:57:37 +00:00
jpeeler 4754a40bd5 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: http://svn.digium.com/svn/asterisk/trunk@220718 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-28 19:10:10 +00:00
mnicholson 7037729f69 Ensure the numeric portion of the P-Asserted-Identity header is properly escaped.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220174 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 16:33:20 +00:00
dvossel 8a55297f29 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: http://svn.digium.com/svn/asterisk/trunk@219451 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-18 16:20:41 +00:00
dvossel 443c110821 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: http://svn.digium.com/svn/asterisk/trunk@219371 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17 22:37:28 +00:00
mmichelson c0792a9c30 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: http://svn.digium.com/svn/asterisk/trunk@219324 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17 22:22:01 +00:00
dvossel f22a0ecb78 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: http://svn.digium.com/svn/asterisk/trunk@219304 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17 21:59:21 +00:00
file d99b2c0999 Ensure no spaces exist before "refresher=" when doing the comparison.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219264 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17 19:57:39 +00:00
mmichelson bdc586caee 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: http://svn.digium.com/svn/asterisk/trunk@218933 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-16 19:25:36 +00:00
file bfbc078467 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: http://svn.digium.com/svn/asterisk/trunk@218918 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-16 18:31:47 +00:00
dvossel eb39751215 upward bound checking for port string to int conversion
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218687 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15 19:22:37 +00:00
mnicholson fc0d24d1d9 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: http://svn.digium.com/svn/asterisk/trunk@218586 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15 16:15:02 +00:00
mmichelson 37b9a0031a Use a better method of ensuring null-termination of the buffer
while reading the SDP when using TCP.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218566 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15 15:40:14 +00:00
mmichelson ff9c8e969f Ensure that SDP read from TCP socket is null-terminated.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218504 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15 15:05:53 +00:00
mmichelson f5aa5d608b Fix off-by-one error when reading SDP sent over TCP.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218499 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15 14:59:50 +00:00
tilghman 0e328e2e61 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: http://svn.digium.com/svn/asterisk/trunk@217916 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 23:12:16 +00:00
oej 111eb071bd Don't assign UINT_MAX to an INT.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217663 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 18:29:21 +00:00
oej a97e99188d 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: http://svn.digium.com/svn/asterisk/trunk@217593 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 12:06:55 +00:00
oej 9b18f38a6d 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: http://svn.digium.com/svn/asterisk/trunk@217482 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-09 20:09:31 +00:00
oej 659c6e9ada Not having any TLS session to write to is a serious XMIT_ERROR.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217368 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-09 10:39:43 +00:00
oej 7dbb4fcea6 Formatting and doxygen updates
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217367 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-09 10:38:45 +00:00
dvossel 8bd1cbda04 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: http://svn.digium.com/svn/asterisk/trunk@216993 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-08 14:26:30 +00:00
oej 92f38b32ee 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: http://svn.digium.com/svn/asterisk/trunk@216917 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 18:29:45 +00:00
oej d7abc8467a Move "deprecated_username" to a flag like the others - unsigned int blah:1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216912 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 18:26:37 +00:00
oej 6f0ee304aa - 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: http://svn.digium.com/svn/asterisk/trunk@216905 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 18:24:04 +00:00
oej d38be2c15f 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: http://svn.digium.com/svn/asterisk/trunk@216883 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 18:00:48 +00:00
oej ccc05a3e9f Make sure we reset global_exclude_static at channel reload
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216842 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 16:35:12 +00:00
oej dc6fc3c18a Move capability into sip_cfg. While at it, make sure we reset it at channel reload.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216841 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 16:31:36 +00:00
oej 5235f4fb01 Move global_regcontext into the sip_cfg structure
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216834 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 16:26:04 +00:00
oej c16bfc9b8d Move contact_ha to sip_cfg structure
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216826 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 16:23:39 +00:00
oej fe1294fbd8 Doxygen updates
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216806 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 16:16:58 +00:00
oej c8e7d6a547 Since it's possible to have more than 999 calls, I'm changing the call counter roof to something higher.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216805 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 16:08:08 +00:00
oej 81088476ee add doxygen and remove duplicate declaration of variable
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216804 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 16:00:41 +00:00
oej 33bb032a54 After many years, remove VOCAL_DATA_HACK definition
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216803 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 15:48:41 +00:00
oej 3fdaf788c2 Remove unneeded header files (tested on Linux and OS/X)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216802 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 15:47:40 +00:00
oej db82e86ec3 Don't send MESSAGE with sendtext() if recepient doesn't allow MESSAGE requests
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216769 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 14:54:14 +00:00
oej d990771e5f Add some doxygen
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216748 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 14:21:01 +00:00
oej dd1af7eba2 Fix typo
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216735 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 14:04:40 +00:00
oej 706a4e2e00 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: http://svn.digium.com/svn/asterisk/trunk@216695 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 13:06:19 +00:00
oej 8ef30dd8a7 Simplify the code in this function
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216652 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-07 11:31:19 +00:00
dvossel daa3bdc670 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: http://svn.digium.com/svn/asterisk/trunk@216594 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 19:32:07 +00:00
oej 6a9ca399c1 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: http://svn.digium.com/svn/asterisk/trunk@216438 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 14:02:34 +00:00
russell 6c5991c6a8 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: http://svn.digium.com/svn/asterisk/trunk@216368 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 13:14:25 +00:00
oej bdc4118a20 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: http://svn.digium.com/svn/asterisk/trunk@215891 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 13:02:41 +00:00
tilghman 7e4c619f6b Default the callback extension to "s". This is a regression.
(closes issue #15764)
 Reported by: elguero
 Change-type: bugfix


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215801 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 03:43:51 +00:00
twilson cfc9e68644 Merged revisions 215682 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r215682 | twilson | 2009-09-02 16:41:22 -0500 (Wed, 02 Sep 2009) | 18 lines
  
  Re-send non-100 provisional responses to prevent cancellation
  
  From section 13.3.1.1 of RFC 3261:
  
     If the UAS desires an extended period of time to answer the INVITE,
     it will need to ask for an "extension" in order to prevent proxies
     from canceling the transaction. A proxy has the option of canceling
     a transaction when there is a gap of 3 minutes between responses in a
     transaction. To prevent cancellation, the UAS MUST send a non-100
     provisional response at every minute, to handle the possibility of
     lost provisional responses.
  
  (closes issue #11157)
  Reported by: rjain
  Tested by: twilson
  
  Review: https://reviewboard.asterisk.org/r/315/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215758 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 23:31:04 +00:00
dvossel ed68a7c6fe port string to int conversion using sscanf
There are several instances where a port is parsed
from a uri or some other source and converted to
an int value using atoi(), if for some reason the
port string is empty, then a standard port is used.
This logic is used over and over, so I created a function
to handle it in a safer way using sscanf().



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215681 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 21:39:31 +00:00
mvanbaak 5289ec4c5b add Parkinglot info to sip show peer <foo> and skinny show line <foo>
If we had this from the start, debugging the 'parking not using configured parkinglot'
bug would have been easier.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215665 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 21:23:17 +00:00
dvossel 5575faefc3 SIP uri parsing cleanup
Now, the scheme passed to parse_uri can either be a
single scheme, or a list of schemes ',' delimited.
This gets rid of the whole problem of having to create
two buffers and calling parse_uri twice to check for
separate schemes.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215522 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 17:26:40 +00:00
dvossel b1db895f3c SIP support for keep-alive event
keep-alive events are used by Sipura/Linksys for NAT keepalive.
There currently don't appear to be any problems with NAT, but
everytime a keep-alive event is received, Asterisk responds with a
"489 Bad event".  This error may indicate to a user that NAT
problems exist just because this even is not supported.  Now,
rather than respond with an error, the packet is consumed and
a "200 ok" is sent just to indicate we received the packet.

(issue #15084)
Patches:
      chan_sip.keepalive.v1.diff uploaded by IgorG (license 20)




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215466 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 16:08:00 +00:00