Commit Graph

7542 Commits

Author SHA1 Message Date
Mark Michelson c7b23cbb0a Do not use a FILE handle when doing SIP TCP reads.
This is used to solve an issue where a poll on a file
descriptor does not necessarily correspond to the readiness
of a FILE handle to be read.

This change makes it so that for TCP connections, we do a
recv() on the file descriptor instead.

Because TCP does not guarantee that an entire message or even
just one single message will arrive during a read, a loop has
been introduced to ensure that we only attempt to handle a
single message at a time. The tcptls_session_instance structure
has also had an overflow buffer added to it so that if more
than one TCP message arrives in one go, there is a place to
throw the excess.

Huge thanks goes out to Walter Doekes for doing extensive review
on this change and finding edge cases where code could fail.

(closes issue ASTERISK-20212)
reported by Phil Ciccone

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

Merged revisions 374905 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374906 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374914 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-12 16:31:01 +00:00
Joshua Colp ccb7b3a1b5 Fix a bug where audio on Google Voice would not work due to ignoring candidates.
Instead of ignoring parts of the message that are not known just ignore the ones
we know may be present and that would cause a problem.
........

Merged revisions 374877 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 21:19:33 +00:00
Joshua Colp cd9745be1b Fix an issue where outgoing calls would fail to establish audio due to ICE negotiation failures.
This change removes the requirement for ufrag and pwd in the transport stanza and also
makes us the controlling agent.

(closes issue ASTERISK-20554)
Reported by: mmichelson

........

Merged revisions 374850 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 16:06:28 +00:00
Mark Michelson 825607e09b Don't make chan_sip export global symbols.
During testing, it was discovered that having chan_sip
export global symbols was problematic.

The biggest problem was that load order was affected.
Trying to use realtime could be problematic since in
all likelihood the necessary realtime driver(s) would
not be loaded before chan_sip.

In addition, it was found that it was impossible to
use the Digium Phone Module for Asterisk since it
must be loaded before chan_sip since it must hook
into chan_sip's configuration parsing.

The solution is to use a virtual table in the same
manner that other modules in Asterisk do, like
app_voicemail.

(closes issue ASTERISK-20545)
Reported by: kmoore

........

Merged revisions 374842 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 15:49:02 +00:00
Joshua Colp 755c2b8708 Consider the Google Talk content stanza name (jin:content) valid.
........

Merged revisions 374833 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-11 13:34:52 +00:00
Joshua Colp 766d133c62 Improve logging for DTLS-SRTP failure situations.
(closes issue ASTERISK-20487)
Reported by: mjordan
........

Merged revisions 374756 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-09 21:35:53 +00:00
Richard Mudgett 79baef5bbd Merged revisions 374515-374535 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier

................
  r374515 | rmudgett | 2012-10-04 17:52:36 -0500 (Thu, 04 Oct 2012) | 10 lines

  chan_misdn: Remove some deadcode

  * Made setup_bc() static.

  Patches:
	patch1_unused-code.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified

  JIRA ABE-2882

................
  r374516 | rmudgett | 2012-10-04 18:01:01 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Remove unused bchan states

  Patches:
	patch2_unused-states.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374517 | rmudgett | 2012-10-04 18:17:51 -0500 (Thu, 04 Oct 2012) | 16 lines

  chan_misdn: Remove unnecessary null pointer checks and checks for stack->nt

  * cleanup_bc() is always called with valid bc (or it would've crashed
  before).

  * Value of stack->nt is known in advance at some places.

  * Rename handle_event() to handle_event_te(), handle_frm() to
  handle_frm_te().

  Patches:
	patch3_checks.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified

  JIRA ABE-2882

................
  r374518 | rmudgett | 2012-10-04 18:21:59 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Fix spelling in log messages

  Patches:
	patch4_spelling.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374519 | rmudgett | 2012-10-04 18:31:59 -0500 (Thu, 04 Oct 2012) | 15 lines

  chan_misdn: Don't cleanup a bc twice.

  In handle_frm_te() after calling misdn_lib_send_event(bc,
  EVENT_RELEASE_COMPLETE) bc is emptied, cleaned and set not in use,
  although misdn_lib_send_event() already did the same.  This is bad.  When
  it's not in use we are not allowed to touch it.

  * Moved log message in front of the resulting actions and fixed it to
  match the case.

  Patches:
	patch5_bccleanup.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374520 | rmudgett | 2012-10-04 18:43:56 -0500 (Thu, 04 Oct 2012) | 12 lines

  chan_misdn: Fix memory leaks, bc, chan not cleaned up etc., really bad stuff.

  * Fix return codes of cb_events() for EVENT_SETUP to use caller's cleanup
  mechanisms.

  * Move cl_queue_chan() call after bearer check.

  Patches:
	patch6_leaks.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374521 | rmudgett | 2012-10-04 18:48:38 -0500 (Thu, 04 Oct 2012) | 11 lines

  chan_misdn: We must initialize cause on sending a DISCONNECT.

  We must initialize cause on sending a DISCONNECT, so it is later correctly
  indicated to ast_channel in case the answer (RELEASE/RELEASE_COMPLETE)
  does not include one.

  Patches:
	patch7_hangupcause.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374522 | rmudgett | 2012-10-04 19:03:56 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Remove unused code for upqueue

  Patches:
	patch8_unused-upqueue.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374523 | rmudgett | 2012-10-04 19:11:50 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Improve debugging (port number, messages fixed, dups removed)

  Patches:
	patch9_debug.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374533 | rmudgett | 2012-10-05 12:17:18 -0500 (Fri, 05 Oct 2012) | 8 lines

  chan_misdn: Better debug: we can print_bc_info even if there's no ast leg.

  Patches:
	patch10_debug-bc-2.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified.

  JIRA ABE-2882

................
  r374534 | rmudgett | 2012-10-05 12:34:10 -0500 (Fri, 05 Oct 2012) | 16 lines

  chan_misdn: setup_bc() is called too early for an incoming SETUP on TE.

  This prevents the B channel from being setup for HDLC mode when requested
  by the bearer capability and config option hdlc=yes.  It violates
  ETS300102 Ch.5.2.3.2: "The user, in any case, must not connect to the
  channel until a CONNECT ACKNOWLEDGE message has been received."

  * Call setup_bc() on receipt of CONNECT_ACKNOWLEGDE for PTMP, and on first
  response to SETUP for PTP.

  Patches:
	abe-2881-2.diff (license #6372) patch uploaded by Guenther Kelleter
	Modified.

  JIRA ABE-2881

................
  r374535 | rmudgett | 2012-10-05 12:41:05 -0500 (Fri, 05 Oct 2012) | 2 lines

  chan_misdn: Remove some more deadcode.

................
........

Merged revisions 374536 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374537 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374538 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-05 18:42:14 +00:00
Joshua Colp d78f7f92b2 Add support for applying direct media ACLs between differing channel technologies.
Review: https://reviewboard.asterisk.org/r/2122/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 13:49:45 +00:00
Matthew Jordan a094707d51 Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

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

Merged revisions 374177 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374196 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 01:47:16 +00:00
Andrew Latham 99e1174bfa Doxygen Cleanup
Start adding configuration file linking and pages.  Add module loading doxygen block.

Breaking up commits to keep it easy to track

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 23:24:35 +00:00
Matthew Jordan c3c317433f Fix ref leak when adding ICE candidates to an SDP
There was a missing decrement to the reference count for the current ICE
candidate when local candidates are being added to an outbound SDP.  This
patch corrects that.
........

Merged revisions 374085 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-29 03:56:49 +00:00
Richard Mudgett b5138fccf4 Add pause one second W dial modifier.
* The following dialplan applications now recognize 'W' to pause sending
DTMF for one second in addition to the previously existing 'w' that paused
sending DTMF for half a second.  Dial, ExternalIVR, and SendDTMF.

* The chan_dahdi analog port dialing and deferred DTMF dialing for PRI now
distinguishes between 'w' and 'W'.  The 'w' pauses dialing for half a
second.  The 'W' pauses dialing for one second.

* Created dahdi_dial_str() in chan_dahdi that eliminated a lot of
duplicated dialing code and diagnostic messages for the channel driver.

(closes issue ASTERISK-20039)
Reported by: Jeremiah Gowdy
Patches:
      jgowdy-wait-6-22-2012.diff (license #5621) patch uploaded by Jeremiah Gowdy
      Expanded patch to add support in chan_dahdi.
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 18:27:02 +00:00
Joshua Colp 9f55e5e928 Make res_http_websocket an optional dependency on supported platforms for chan_sip.
(closes issue ASTERISK-20439)
Reported by: sruffell
Patches:
     0001-chan_sip-websocket-support-is-an-optional-API.patch uploaded by sruffell (license 5417)
........

Merged revisions 373914 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27 17:12:08 +00:00
Joshua Colp 10eb78d213 Fix an issue where Local channels dialed by app_queue are considered in use immediately.
The chan_local channel driver returns a device state of in use even if a created Local
channel has not yet been dialed. This fix changes the logic to return a state of not
in use until the channel itself has been dialed.

(closes issue ASTERISK-20390)
Reported by: tim_ringenbach

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

Merged revisions 373878 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373879 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373880 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27 11:33:54 +00:00
Mark Michelson b6a780b923 Move handling of 408 response so there is no misleading warning message.
(closes issue ASTERISK-20060)
Reported by: Walter Doekes
........

Merged revisions 373848 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373849 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373850 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-26 21:17:16 +00:00
Mark Michelson 2b56626b43 Remove dead code and documentation for nonexistent feature.
multiplelogin was removed from chan_agent back in 1.6.0 when
AgentCallbackLogin() was removed.

(closes issue AST-948)
reported by Steve Pitts
........

Merged revisions 373768 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373769 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373770 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 22:57:56 +00:00
Joshua Colp 318c7bea44 Fix T.38 support when used with chan_local in between.
Users of the T.38 API can indicate AST_T38_REQUEST_PARMS on a channel to request that the
channel indicate a T.38 negotiation with the parameters present on the channel. The return
value of this indication is expected to be AST_T38_REQUEST_PARMS upon success but with
chan_local involved this could never occur.

This fix changes chan_local to always return AST_T38_REQUEST_PARMS for this situation. If
the underlying channel technology on the other side does not support T.38 this would have
been determined ahead of time using ast_channel_get_t38_state and an indication would
not occur.

(closes issue ASTERISK-20229)
Reported by: wdoekes
Patches:
     ASTERISK-20229.patch uploaded by wdoekes (license 5674)

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

Merged revisions 373705 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373706 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373707 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 20:14:13 +00:00
Mark Michelson fdfb3ae5fa Allow for redirecting reasons to be set to arbitrary strings.
This allows for the REDIRECTING dialplan function to be
used to set the reason to any string.

The SIP channel driver has been modified to set the redirecting
reason string to the value received in a Diversion header. In
addition, SIP 480 response reason text will set the redirecting
reason as well.

(closes issue AST-942)
reported by Malcolm Davenport

(closes issue AST-943)
reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 19:29:14 +00:00
Terry Wilson b7233b18eb Properly handle UAC/UAS roles for SIP session timers
The SIP session timer mechanism contains a mandatory 'refresher' parameter
(included in the Session-Expires header) which is used in the session timer
offer/answer signaling within a SIP Invite dialog. It looks like asterisk is
interpreting the uac resp. uas role only as the initial role of client and
server (caller is uac, callee is uas). The standard rfc 4028 however assigns
the client role to the ((RE)-Invite) requester, the server role to the
((RE)-Invite) responder.

This patch has Asterisk track the actual refresher as "us" or "them" as opposed
to relying on just the configured "uas" or "uac" properties.

(closes issue AST-922)
Reported by: Thomas Airmont

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

Merged revisions 373652 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373665 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373690 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 19:08:02 +00:00
Jonathan Rose c7850a198b chan_sip: Set Quality of Service for video rtp instance
(closes issue ASTERISK-20201)
Reported by: ddkprog
Patches:
    chan_sip.c.diff uploaded by ddkprog (license 6008)
........

Merged revisions 373617 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373631 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373632 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 16:45:02 +00:00
Richard Mudgett da8c22fe45 Be consistent, send From: "Anonymous" <sip:anonymous@anonymous.invalid>
When setting CALLERID(pres)=unavailable in the dialplan, the From header
in the SIP message contains "Anonymous" <sip:Anonymous@anonymous.invalid>.
For consistency, Asterisk should use a lowercase a in the userpart of the
URI.

* Make the From header use a lowercase A in the userpart of the anonymous
URI.

(closes issue ASTERISK-19838)
Reported by: Antti Yrjola
Patches:
      chan_sip_patch_ASTERISK-19838.patch (license #6383) patch uploaded by Antti Yrjola
........

Merged revisions 373500 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373501 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373502 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 22:14:28 +00:00
Richard Mudgett bc090677bc Fix potential reentrancy problems in chan_sip.
Asterisk v1.8 and later was not as vulnerable to this issue.

* Made find_call() lock each private as it processes the found dialogs.
(Primary cause of ABE-2876)

* Made the other functions that traverse the dialogs container lock each
private as it examines them.

* Fix race condition in sip_call() if the thread that sent the INVITE is
held up long enough for a response to be processed.  The p->initid for the
INVITE retransmission could be added after it was canceled by the response
processing.

* Made __sip_destroy() clean up resource pointers after freeing.  This is
primarily defensive in case someone has a stale private pointer.

* Removed redundant memset() in reqprep().  The call to init_req() already
does the memset() and is the first reference to req in reqprep().

* Removed useless set of req.method in transmit_invite().  The calls to
initreqprep() and reqprep() have to do this because they memset() the req.

JIRA ABE-2876

..........

Merged -r373423 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

Merged revisions 373424 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373466 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373469 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 21:15:26 +00:00
Joshua Colp f6e0406239 Fix a deadlock caused by a race condition between removing a hint and reloading the dialplan and subscribing to the removed hint.
If conditions were right it was possible for both the PBX core and chan_sip to deadlock by both having a lock that the other
wants. In the case of the PBX core it had the contexts lock and wanted a SIP dialog lock, while in the case of chan_sip it
had the SIP dialog lock and wanted the contexts lock.

This fix unlocks the SIP dialog before getting the extension state so that the other thread will not block on trying to lock
it. Once the extension state is retrieved the SIP dialog is locked again and life carries on.

As the SIP dialog is reference counted it is not possible for it to go away after unlocking.

(closes issue ASTERISK-20437)
Reported by: jhutchins
........

Merged revisions 373438 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373440 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373454 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 19:23:32 +00:00
Joshua Colp ad3e51bf4c Fix an issue with H.264 format attribute comparison and fix an issue with improper SDP being produced.
The H.264 format attribute module compares two format attribute structures to determine if they are
compatible or not. In some instances it was possible for this check to determine that both structures
were incompatible when they actually should be considered compatible. This check has now been made even
more permissive by assuming that if no attribute information is available the two structures are compatible.
If both structures contain attribute information a base level comparison of the H.264 IDC value is done to
see if they are compatible or not.

The above issue uncovered a secondary issue in chan_sip where the SDP being produced would be incorrect if
the formats were considered incompatible. This has now been fixed by checking that all information required
to produce the SDP is available instead of assuming it is.

(closes issue ASTERISK-20464)
Reported by: Leif Madsen
........

Merged revisions 373413 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 14:27:17 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Jonathan Rose ca8aeeef1b iax2-provision: Fix improper return on failed cache retrieval
(closes issue ASTERISK-20337)
reported by: John Covert
Patches:
    iax2-provision.c.patch uploaded by John Covert (license 5512)
........

Merged revisions 373342 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373343 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373368 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 19:35:37 +00:00
Andrew Latham 6f61cb50c5 Doxygen Updates - janitor work
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style.  Some missing txt file links are removed but their content or essense will be included in some later updates.  A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.

Further updates coming.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 17:14:59 +00:00
Joshua Colp e8380afc8a Add support for DTLS-SRTP to res_rtp_asterisk and chan_sip.
As mentioned on the review for this, WebRTC has moved towards choosing
DTLS-SRTP as the mechanism for key exchange for SRTP. This commit adds
support for this but makes it available for normal SIP clients as well.

Testing has been done to ensure that this introduces no regressions with
existing behavior and also that it functions as expected.

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

Merged revisions 373229 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 18:27:28 +00:00
Kinsey Moore afa6b8f320 Correct handling of unknown SDP stream types
When the patch to handle arbitrary SDP stream arrangements went into
Asterisk, it also included an ability to transparently decline unknown
stream types. The scanf calls used were not checked properly causing
this part of the functionality to be broken.

(closes issue ASTERISK-20203)
........

Merged revisions 373211 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 13:04:22 +00:00
Richard Mudgett b0f01e5a6f Made companding law for SS7 calls only determined by SS7 signaling type.
For SS7, the companding law for a call was chosen inconsistently depending
upon ss7type (ITU vs ANSI) and the DAHDI companding default (T1 vs E1).
For incoming calls, the companding law was determined by ss7type.  For
outgoing calls, the companding law was determined by the DAHDI default.
With the wrong combination you would get A-law/u-law conflicts.  An
A-law/u-law conflict sounds like bad static on the line.

SS7 ITU  signaling with E1 line: ok
SS7 ITU  signaling with T1 line: noise
SS7 ANSI signaling with E1 line: noise
SS7 ANSI signaling with T1 line: ok

* Fix the companding law used to be determined by the SS7 signaling type
only.
........

Merged revisions 373090 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373101 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373107 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-15 00:32:37 +00:00
Matthew Jordan f92bb6265c Resolve memory leaks in TLS initialization and TLS client connections
This patch resolves two sources of memory leaks when using TLS in Asterisk:
1) It removes improper initialization (and multiple re-initializations) of
   portions of the SSL library.  Asterisk calls SSL_library_init and
   SSL_load_error_strings during SSL initialization; collectively this
   obviates the need for calling any of the following during initialization
   or client connection handling:
   * ERR_load_crypto_strings (handled by SSL_load_error_strings)
   * OpenSSL_add_all_algorithms (synonym for SSL_library_init)
   * SSLeay_add_ssl_algorithms (synonym for SSL_library_init)
2) Failure to completely clean up all memory allocated by Asterisk and by
   the SSL library for TLS clients.  This included not freeing the SSL_CTX
   object in the SIP channel driver, as well as not clearing the error
   stack when the TLS client exited.

Note that these memory leaks were found by Thomas Arimont, and this patch
was essentially written by him with some minor tweaks.

(closes issue AST-889)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
patches:
  (bugAST-889.patch) by Thomas Arimont (license 5525)

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

Merged revisions 373061 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373062 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 373079 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-14 19:53:43 +00:00
Joshua Colp 189249cc73 Skip any non-content information when looking for and handling content.
This fixes a bug with Jitsi and conference calling. Jitsi implements XEP-0298
which places some conference-info information in the session-initiate request
which chan_motif did not expect to occur.
........

Merged revisions 372995 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-12 20:54:38 +00:00
Mark Michelson b0a4f08928 Add channel name to a warning to make debugging easier.
The "autodestruct with owner in place" message is typically
indicative of a channel reference leak. Printing out the name
of the channel in the message may be helpful when trying to
debug the issue.
........

Merged revisions 372932 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 372933 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372937 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-12 15:21:19 +00:00
Jonathan Rose 6f8bad0eac chan_local: Switch from using a random 4 digit hex identifier to unique id
Changes chan_local channels to use an 8 digit hex identifier generated
atomically and sequentially in order to eliminate the chance of having
multiple channels with the same name during high call volume situations.

(issue ASTERISK-20318)
Reported by: Dan Cropp
Review: https://reviewboard.asterisk.org/r/2104/
........

Merged revisions 372902 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 372916 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372917 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-11 22:40:02 +00:00
Jonathan Rose 23a298f28c chan_sip: Change SIPQualifyPeer to improve initial response time
Prior to this patch, The acknowledgement wasn't produced until after
executing the sip_poke_peer action actually responsible for
qualifying the peer. Now the response is given immediately once it is
known that a peer will be qualified and a SIPqualifypeerdone event
is issued when the process is finished. Thanks to OEJ for identifying
the problem and helping to come up with a solution.

(issue AST-969)
Reported by John Bigelow
Review: https://reviewboard.asterisk.org/r/2098/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 21:15:38 +00:00
Kinsey Moore e65dea4616 Ensure iax2 debug output is displayed when expected
When IAX2 debug was changed from iax_showframe to iax_outputframe,
some instances were missed (or added afterward). This was causing
debug output to not be displayed when expected.

(closes issue ASTERISK-20338)
Reported-by: John Covert
Patch-by: John Covert
........

Merged revisions 372804 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 372805 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372806 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 21:00:22 +00:00
Kinsey Moore d96b832787 Deprecate chan_gtalk, chan_jingle, and res_jabber
chan_gtalk, chan_jingle, and res_jabber are now deprecated in favor of
using chan_motif and res_xmpp. They are a feature-equivalent
replacement and are written to be more easily maintainable.

(closes issue ASTERISK-20298)
Review: https://reviewboard.asterisk.org/r/2082/
Reported-by: Leif Madsen
........

Merged revisions 372795 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 19:49:30 +00:00
Matthew Jordan ae179ac5b4 Only re-create an SRTP session when needed
In r356604, SRTP handling was fixed to accomodate multiple crypto keys in an
SDP offer and the ability to re-create an SRTP session when the crypto keys
changed.  In certain circumstances - most notably when a phone is put on
hold after having been bridged for a significant amount of time - the act
of re-creating the SRTP session causes problems for certain models of phones.
The patch committed in r356604 always re-created the SRTP session regardless
of whether or not the cryptographic keys changed.  Since this is technically
not necessary, this patch modifies the behavior to only re-create the SRTP
session if Asterisk detects that the remote key has changed.  This allows
models of phones that do not handle the SRTP session changing to continue
to work, while also providing the behavior needed for those phones that do
re-negotiate cryptographic keys.

(issue ASTERISK-20194)
Reported by: Nicolo Mazzon
Tested by: Nicolo Mazzon

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

Merged revisions 372709 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 372710 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372711 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-09 01:28:31 +00:00
Richard Mudgett 8b933196e9 Fix loss of MOH on an ISDN channel when parking a call for the second time.
Using the AMI redirect action to take an ISDN call out of a parking lot
causes the MOH state to get confused.  The redirect action does not take
the call off of hold.  When the call is subsequently parked again, the
call no longer hears MOH.

* Make chan_dahdi/sig_pri restart MOH on repeated AST_CONTROL_HOLD frames
if it is already in a state where it is supposed to be sending MOH.  The
MOH may have been stopped by other means.  (Such as killing the generator.)

This simple fix is done rather than making the AMI redirect action post an
AST_CONTROL_UNHOLD unconditionally when it redirects a channel and thus
potentially breaking something with an unexpected AST_CONTROL_UNHOLD.

(closes issue ABE-2873)
Patches:
      jira_abe_2873_c.3_bier.patch (license #5621) patch uploaded by rmudgett
........

Merged revisions 372521 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

Merged revisions 372522 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372523 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06 22:14:52 +00:00
Darren Sessions 7e46e4d17b LDAP Realtime Peers Cannot Register
Prior to 1.8, it was not necessary for an explicit "type" to be set for an
asterisk LDAP realtime peer. Now the routine find_peer actually checks the
type field during registration and fails to find the peer if it is not set.

The attached patch makes the realtime type equal whatever type is being 
searched for if the type is 0 upon return from routine build_peer. 

(closes issue ASTERISK-17222)
Reported by: John Covert
Patch by: David Vossel
Tested by: Darren Sessions

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 14:12:11 +00:00
Mark Michelson a40f702aef Fix issue where SIP devices were not notified when custom devices changed to "ringing".
The problem had to do with logic used when checking for what the oldest ringing channel
was. The problem was that if no channel was found, then no notification would be sent.
For custom device states, there is no associated channel, so no notification would get
sent. This fixes the issue by still sending the notification even if no associated
channel can be found for a ringing device state change.

(closes issue ASTERISK-20297)
Reported by Noah Engelberth
........

Merged revisions 372137 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-04 15:50:30 +00:00
Matthew Jordan acbe1f90e7 AST-2012-013: Resolve ACL rules being ignored during calls by some IAX2 peers
When an IAX2 call is made using the credentials of a peer defined in a dynamic
Asterisk Realtime Architecture (ARA) backend, the ACL rules for that peer are
not applied to the call attempt. This allows for a remote attacker who is aware
of a peer's credentials to bypass the ACL rules set for that peer.

This patch ensures that the ACLs are applied for all peers, regardless of their
storage mechanism.

(closes issue ASTERISK-20186)
Reported by: Alan Frisch
Tested by: mjordan, Alan Frisch
........

Merged revisions 372028 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30 16:25:34 +00:00
Matthew Jordan 8018b879a2 Clean up doxygen warnings
This patch fixes numerous doxygen warnings across Asterisk.  It also updates
the makefile to regenerate the doxygen configuration on the local system
before running doxygen to help prevent warnings/errors on the local system.

Much thanks to Andrew for tackling one of the Asterisk janitor projects!

(issue ASTERISK-20259)
Reported by: Andrew Latham
Patches:
  doxygen_partial.diff uploaded by Andrew Latham (license 5985)
  make_progdocs.diff uploaded by Andrew Latham (license 5985)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30 14:23:28 +00:00
Jonathan Rose 6c07c904aa chan_sip: Change manager event to confirm SIPqualifypeer into an ack
Matt Jordan  informed me that it was more appropriate to use an
astman_send_ack here instead of making an event response. I've also
used this opportunity to update UPGRADE.txt to mention this change
in behavior.

(issue AST-969)
Reported by: John Bigelow


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-29 19:38:52 +00:00
Jonathan Rose 3f69a4e34f chan_sip: Send 408 on retransmit timeout instead of 603
(closes issue ASTERISK-20124)
Reported by: Walter Doekes
........

Merged revisions 371824 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 371825 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 371845 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-29 17:35:32 +00:00
Jonathan Rose 504cfd1070 chan_sip: Send a manager event to confirm SIPqualifypeer completes
Prior to this patch, Issuing SIPqualifypeer either resulted in an
error or if it succeeded, a few \r\ns.  This patch adds a
SIPqualifypeerComplete event issued as a response when the command
is successfully executed.

(closes issue AST-969)
Reported by: John Bigelow



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-29 16:44:48 +00:00
Joshua Colp 09b121bb50 Add support for call-id logging to chan_motif.
Review: https://reviewboard.asterisk.org/r/2077/
........

Merged revisions 371619 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-22 15:55:26 +00:00
Mark Michelson 6a539ace84 Fix misuses of asprintf throughout the code.
This fixes three main issues

* Change asprintf() uses to ast_asprintf() so that it
pairs properly with ast_free() and no longer causes
MALLOC_DEBUG to freak out.

* When ast_asprintf() fails, set the pointer NULL if
it will be referenced later.

* Fix some memory leaks that were spotted while taking
care of the first two points.

(Closes issue ASTERISK-20135)
reported by Richard Mudgett

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

Merged revisions 371590 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 371591 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 371592 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21 21:01:11 +00:00
Joshua Colp 1a95c9a906 When a peer registers using WebSocket do not resolve the Contact provided.
(closes issue ASTERISK-20238)
Reported by: james.mortensen
........

Merged revisions 371482 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-17 19:50:58 +00:00
Jonathan Rose d4879edd8e chan_sip: Use pvt outgoing_call variable to set Remote-Party-ID Header
Previously the pvt SIP_OUTGOING flag was used instead, which will frequently
flip during reinvites.

(closes issue AST-897)
Reported by: Thomas Arimont
........

Merged revisions 371357 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 371358 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 371382 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-16 19:52:08 +00:00