Commit Graph

21749 Commits

Author SHA1 Message Date
Jonathan Rose
6aa2cd51f9 Adds pjmedia probation concepts to res_rtp_asterisk's learning mode.
In order to better handle RTP sources with strictrtp enabled (which is now default in 10)
using the learning mode to figure out new sources when they change is handled by checking
for a number of consecutive (by sequence number) packets received to an rtp struct
based on a new configurable value called 'probation'. Also, during learning mode instead
of liberally accepting all packets received, we now reject packets until a clear source
has been determined.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 16:55:41 +00:00
Mark Michelson
eae2207967 Use built-in parsing functions for Contact and Record-Route headers.
If a Contact or a Record-Route header had a quoted string with an
item in angle brackets, then we would mis-parse it. For instance,
"Bob <1234>" <1234@example.org>
would be misparsed as having the URI "1234"
The fix for this is to use parsing functions from reqresp_parser.h
since they are heavily tested and are awesome.

(issue ASTERISK-18990)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 16:41:23 +00:00
Matthew Jordan
ec47280520 Fix udptl issue with initial INVITE introduced by r351027
When an inital INVITE occurs that contains image media, a channel
is not yet associated with the SIP dialog.  The file descriptor
associated with the udptl session needs to be set in
initialize_udptl or in sip_new to account for this scenario.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 16:06:42 +00:00
Russell Bryant
afcb666f2e Add some missing locking in chan_sip.
This patch adds some missing locking to the function 
send_provisional_keepalive_full().  This function is called from the scheduler,
which is processed in the SIP monitor thread.  The associated channel (or pbx)
thread will also be using the same sip_pvt and ast_channel so locking must be
used.  The sip_pvt_lock_full() function is used to ensure proper locking order
in a safe manner.

In passing, document a suspected reference counting error in this function.
The "fix" is left commented out because when the "fix" is present, crashes
occur.  My theory is that fixing it is exposing a reference counting error
elsewhere, but I don't know where.  (Or my analysis of this being a problem
could have been completely wrong in the first place).  Leave the comment in
the code for so that someone may investigate it again in the future.

Also add a bit of doxygen to transmit_provisional_response().

(closes issue ASTERISK-18979)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17 01:37:03 +00:00
Terry Wilson
d310ccf250 Ensure ACK retransmit & hangup on non-200 response to INVITE
When handling a non-2xx final response on an INVITE transaction, we have to
keep the transaction around after we send an ACK in case we receive a
retransmission of the response so we can re-transmit the ACK, but also tear
down the ast_channel as soon as we transmit the ACK. Before this patch, we
could fail at both of these things. Calling sip_alreadygone/needdestroy
prevented us from keeping the transaction up and retransmitting the ACK, and
queueing CONGESTION was not sufficient to cause the channel to be torn down
when originating calls via the CLI, for example.

This patch queues a hangup with CONGESTION instead of just queueing CONGESTION
for these responses and removes the sip_alreadygone and sip_needdestroy calls
from handle_response_invite on non-2xx responses. It relies on the hangup
calling sip_scheddestroy.

For more information, see section 17.1.1.1 of RFC 3261.

(closes issue ASTERISK-17717)
Review: https://reviewboard.asterisk.org/r/1672/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 21:12:53 +00:00
Terry Wilson
1dbaee36b5 Don't prematurely stop SIP session timer
When Asterisk is the UAS (incoming call, endpoint is re-inviting) the SIP session timer expires after half the time the sip endpoint indicates in the Session-expires header in proc_session_timer(). The session timer was being stopped totally and being handled as an error case instead of running again until the second expiry. This patch treats the half-time expiry as a non-error case and continues the timer until the true expiry.

(closes issue ASTERISK-18996)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches: session_timer_fix.diff by Terry Wilson (License #5357)
  based on session_timer.patch by Thomas Arimont (License #5525)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 20:06:45 +00:00
Matthew Jordan
51079c6f08 Create and initialize udptl only when dialog negotiates for image media
Prior to this patch, the udptl struct was allocated and initialized when a
dialog was associated with a peer that supported T.38, when a new SIP
channel was allocated, or what an INVITE request was received.  This resulted
in any dialog associated with a peer that supported T.38 having udptl support
assigned to it, including the UDP ports needed for communication.  This
occurred even in non-INVITE dialogs that would never send image media.

This patch creates and initializes the udptl structure only when the SDP
for a dialog specifies that image media is supported, or when Asterisk
indicates through the appropriate control frame that a dialog is to support
T.38.

(closes issue ASTERISK-16698)
Reported by: under
Tested by: Stefan Schmidt
Patches: udptl_20120113.diff uploaded by mjordan (License #6283)

(closes issue ASTERISK-16794)
Reported by: Elazar Broad
Tested by: Stefan Schmidt

review: https://reviewboard.asterisk.org/r/1668/




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 19:09:45 +00:00
Joshua Colp
91e4333579 Add missing code to set direct RTP setup information during dialing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 17:04:44 +00:00
Walter Doekes
2263f9d10e Allow only one thread at a time to do asterisk cleanup/shutdown.
Add locking around the really-really-quit part of the core stop/restart
part. Previously more than one thread could be called to do cleanup,
causing atexit handlers to be run multiple times, in turn causing
segfaults.

(issue ASTERISK-18883)
Reviewed by: Terry Wilson
Review: https://reviewboard.asterisk.org/r/1662/
Review: https://reviewboard.asterisk.org/r/1658/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-15 20:07:13 +00:00
Walter Doekes
6cb062d193 Fix -Werror=unused-but-set-variable compile error in utils/extconf.c.
Note that I'm not confirming legitimacy of having that file in tree at
all. Is anyone using aelparse/conf2ael?

(issue ASTERISK-15350)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350885 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-15 19:47:07 +00:00
Kevin P. Fleming
47805b192d Ensure that all AC_LANG_PROGRAM calls in the configure script are properly quoted.
Recent versions of autoconf (2.68 on my system) won't properly process the configure
script unless every call to AC_LANG_PROGRAM is m4-quoted. Many calls in the script
were, but many were not. This patch corrects the unquoted calls.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-14 16:40:17 +00:00
Kevin P. Fleming
3bfed7039f Correct some 'set-but-not-used' variable warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-14 15:23:32 +00:00
Kevin P. Fleming
689f7d5d6b Ensure that two prerequisites are properly installed on Debian-style distributions.
* Don't specify a specific version of libgmime; newer versions are available
  now and acceptable.

* Install libsrtp so that res_srtp can be built.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-14 15:22:33 +00:00
Kinsey Moore
d3d3ad2663 Run bootstrap.sh for the for the ASTERISK-18929 fix
configure and autoconfig.h.in were not regenerated when the fix was committed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 22:05:07 +00:00
Richard Mudgett
3fa4645c0b Correct eventtype names in cel_odbc and cel_pgsql sample files
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 21:51:03 +00:00
Kinsey Moore
2f0051982a Make sure asterisk builds on OpenBSD
OpenBSD defines SO_PEERCRED, but it returns a 'struct sockpeercred', not
'struct ucred', which causes compilation of main/asterisk.c to fail in
read_credentials().  This allows configure to check for sockpeercred and
asterisk to deal with it properly.

(closes issue ASTERISK-18929)
Reported-by: Barry Miller
Patch-by: Barry Miller


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 21:40:32 +00:00
Mark Michelson
f7876c1dfe Set port to a default sane value if a bogus one is provided when parsing hostnames.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 20:29:03 +00:00
Richard Mudgett
26966a5cd8 Use compatible names for event extra data for various CEL backends.
* Change eventextra to extra in cel_psql.c and cel_odbc.c.

* Change EventExtra to Extra in cel_manager.c.

(issue ASTERISK-17190)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 17:23:57 +00:00
Richard Mudgett
773074f3b7 Add missing CEL logging fields to various CEL backends.
* Add missing eventextra to cel_psql.c and cel_odbc.c.

* Add missing PeerAccount and EventExtra to cel_manager.c.

* Add missing userdeftype support for cel_custom.conf.sample and
cel_sqlite3_custom.conf.sample.

(closes issue ASTERISK-17190)
Reported by: Bryant Zimmerman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 17:12:51 +00:00
Matthew Jordan
a364b1e068 Realtime queues failed to load queue information without queue member table
Previously, realtime queues could be loaded without defining the queue member
table.  This allowed for queue members to be dynamic, while the realtime
queue definitions could exist in some backing storage.  Revision 342223 broke
this when it changed the return value for realtime_multientry to return NULL
when no results are returned.  Previously, an empty ast_config object was
expected.

(closes issue ASTERISK-19170)
Reported by: Rene Mendoza
Tested by: Rene Mendoza
Patches: 
  rt_queue_member_patch.diff uploaded by Matt Jordan (license 6283)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 16:57:33 +00:00
Jonathan Rose
f22392dbdc Adds peer to CEL report on CEL_BRIDGE_START and CEL_BRIDGE_END
(closes issue ASTERISK-17940)
Reporter: Nic Colledge
Patches:
	features_18.patch uploaded by Nic Colledge (license 6245)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-12 15:57:44 +00:00
Richard Mudgett
929c8c3cb7 Remove extraneous BRIDGEPEER AMI VarSet event on a CEL dummy channel.
(closes issue ASTERISK-19180)
Reported by: Corey Farrell
Patches:
      asterisk_cel_noevent_varset.diff (license #5909) patch uploaded by Corey Farrell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-11 22:50:50 +00:00
Richard Mudgett
99868648e4 Make FollowMe optionally update connected line information when the accepting endpoint is bridged.
Like Dial and Queue, FollowMe needs to deal with
AST_CONTROL_CONNECTED_LINE information so when the parties are initially
bridged, the connected line information will be correct.

* Added the 'I' option just like the app_dial and app_queue 'I' option.

(closes issue ASTERISK-18969)
Reported by: rmudgett
Tested by: rmudgett

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-11 19:18:37 +00:00
Richard Mudgett
ed61726748 Fix absolute/relative time mismatch in LOCK function.
The time passed by the LOCK function to an internal function was relative
time when the function expected absolute time.

* Don't use C++ keywords in get_lock().

(closes issue ASTERISK-16868)
Reported by: Andrey Solovyev
Patches:
      20101102__issue18207.diff.txt (license #5003) patch uploaded by Andrey Solovyev (modified)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-10 22:05:19 +00:00
Richard Mudgett
fb6b399324 Fix joinable thread terminating without joiner memory leak in chan_iax.c.
The iax2_process_thread() can exit without anyone waiting to join the
thread.  If noone is waiting to join the thread then a large memory leak
occurs.

* Made iax2_process_thread() deatach itself if nobody is waiting to join
the thread.

(closes issue ASTERISK-17339)
Reported by: Tzafrir Cohen
Patches:
      asterisk-1.8.4.4-chan_iax2-detach-thread-on-non-stop-exit.patch (license #5617) patch uploaded by Alex Villacis Lasso (modified)

(closes issue ASTERISK-17825)
Reported by: wangjin


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 21:54:01 +00:00
Richard Mudgett
8726d89f58 live_ast: valgrind: run asterisk under valgrind
Adds a new sub-command, "valgrind" to live_ast. It runs asterisk under
valgrind. The extra command-line parameters are passed to Asterisk as
usual, and parameters to valgrind are passed through LIVE_AST_VALGRIND_ARGS
in live.conf .

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 18:54:56 +00:00
Richard Mudgett
3609b8c19b Update contrib script live_ast to invoke Asterisk with valgrind and suppression file.
* Added valgrind_compare script to compare two valgrind log files for
differences.

(issue ASTERISK-17339)
Reported by: Tzafrir Cohen
Patches:
      valgrind_compare (license #5035) script uploaded by Tzafrir Cohen
      live_ast_valgrind.diff (license #5035) patch uploaded by Tzafrir Cohen
      live_ast_valgrind_v2.diff (license #5185) patch uploaded by Paul Belanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 18:40:33 +00:00
Richard Mudgett
c1f9b1277e Make Asterisk -x command line parameter imply -r parameter presence.
The Asterisk -x command line parameter is documented inconsistently.

* Made the -x documentation and behavior consistent.

* Since this is also a new year, updated the copyright notices while here.

(closes issue ASTERISK-19094)
Reported by: Eugene
Patches:
      issueA19094_correct_asterisk_option_x.patch (license #5674) patch uploaded by Walter Doekes (modified)
Tested by: Eugene


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 17:02:25 +00:00
Kinsey Moore
cf9df098bd Prevent SLA settings from getting wiped out on reload
If SLA was reloaded without the config file being changed, current settings got
wiped out before the SLA reload code decided it wasn't going to reload the file
since nothing was changed.  Moving the settings reset later in the reload
process fixes this.

(closes issue AST-744)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 15:37:12 +00:00
Terry Wilson
96770386a7 Don't leak CID in From header when presentation=unavailable
When someone does Set(CALLERPRES()=unavailable) (or
Set(CALLERID(pres)=unavailable)) when sendrpid=no, the From header shows
"Anonymous" <anonymous@anonymous.invalid>. When sendrpid=yes/pai, the From
header will still display the callerid info, even though we supply an rpid
header with the anonymous info. It seems like we shouldn't leak that info in
any case. Skimming http://tools.ietf.org/html/draft-ietf-sip-privacy-04 seems
to indicate that one shouldn't send identifying info in the From in this case.

This patch anonymizes the From header as well even when sendrpid=yes/pai.

(closes issue ASTERISK-16538)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-06 23:17:24 +00:00
Richard Mudgett
d377bc31ce Fix memory leaks in app_followme find_realtime().
(closes issue ASTERISK-19055)
Reported by: Matt Jordan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-06 16:46:47 +00:00
Richard Mudgett
9376320c82 Make not assume that the cel_sqlite3_custom SQL table primary key is AcctId.
If a table is created by some other application and the primary key is not
named "AcctId", cel/cel_sqlite3_custom.c will always try to create the
table and fail because it already exists.

* Change the SQL table query to not require AcctId as the primary key.

(closes issue ASTERISK-18963)
Reported by: socketpair
Patches:
      fix.patch (license #6337) patch uploaded by socketpair


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 23:44:27 +00:00
Kinsey Moore
49a980a427 Allow playback of formats that don't support seeking
ast_streamfile previously did unconditional seeking on files that broke
playback of formats that don't support that functionality.  This patch avoids
the seek that was causing the problem.  This regression was introduced in
r158062.

(closes issue ASTERISK-18994)
Patch-by: Timo Teras


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 22:06:46 +00:00
Jonathan Rose
1035b21f62 Fix an issue where dsp.c would interpret multiple dtmf events from a single key press.
When receiving calls from a mobile phone into a DISA system on a connection with
significant interference, the reporter's Asterisk system would interpret DTMF incorrectly
and replicate digits received. This patch resolves that by increasing the number of
frames a mismatch has to be detected before assuming the DTMF is over by 1 frame and
adjusts dtmf_detect function to reset hits and misses only when an edge is detected.

(closes issue ASTERISK-17493)
Reported by: Alec Davis
Patches:
	bug18904-refactor.diff.txt uploaded by Alec Davis (license 5546)
Review: https://reviewboard.asterisk.org/r/1130/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 21:46:55 +00:00
Jonathan Rose
879208db8e Ensures Asterisk closes when receiving terminal signals in 'no fork' mode.
When catching a signal, in no fork mode the console thread is identical to the thread
responsible for catching the signal and closing Asterisk, which requires it to first
dispense with the console thread. Prior to this patch, if these threads were identical,
upon receiving a killing signal, the thread will send an URG signal to itself, which
we also catch and then promptly do nothing with. Obviously this isn't useful behavior.

(closes issue ASTERISK-19127)
Reported By: Bryon Clark
Patches:
	quit_on_signals.patch uploaded by Bryon Clark (license 6157)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 15:25:29 +00:00
Richard Mudgett
6f7d995edc Fix segfault in chan_dahdi for CHANNEL(dahdi_span) evaluation on hangup.
* Added NULL private pointer checks in the following chan_dahdi channel
callbacks: dahdi_func_read(), dahdi_func_write(), dahdi_setoption(), and
dahdi_queryoption().

(closes issue ASTERISK-19142)
Reported by: Diego Aguirre
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 20:46:20 +00:00
Kinsey Moore
1414d5b804 Make debian init script conform to the LSB standard
Previously, this init script would return 1 if Asterisk was already running.
This is incorrect behavior according to the LSB standard and has been fixed by
returning 0 instead.

(closes issue ASTERISK-17958)
Reported-by: johnc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 20:23:04 +00:00
Kinsey Moore
7369c261ea Update autosupport script and man page
Added information collection from the output of the utilities: top, free, uptime, ifconfig
Added information collection from the output of the Asterisk command 'dahdi show status'
Added option / flag '-n, --non-interactive'
Updated man page to reflect new option / flag '-n, --non-interactive'

Patch-by: John Bigelow (itzanger)
(closes issue AST-749)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 20:00:33 +00:00
Jonathan Rose
21fa14919d Adds Subscription-State header to notify with call completion. per RFC3265
(Closes issue ASTERISK-17953)
Reported by: George Konopacki
Patches:
	19400.patch uploaded by mmichelson (license 5049)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 19:27:26 +00:00
Jonathan Rose
fc698edaad Fix documentation for SayNumber to reflect the fact that language is changed in CHANNEL()
(closes issue ASTERISK-18962)
reported by: Nir Simionovich


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 18:30:24 +00:00
Matthew Jordan
5bdcc834df Handle AST_CONTROL_UPDATE_RTP_PEER frames in local bridge loop
Failing to handle AST_CONTROL_UPDATE_RTP_PEER frames in the local bridge loop
causes the loop to exit prematurely.  This causes a variety of negative side
effects, depending on when the loop exits.  This patch handles the frame by
essentially swallowing the frame in the local loop, as the current channel
drivers expect the RTP bridge to handle the frame, and, in the case of the
local bridge loop, no additional action is necessary.

(issue ASTERISK-19040)
(issue ASTERISK-19128)
(issue ASTERISK-17725)
(issue ASTERISK-18340)
(closes issue ASTERISK-19095)
Reported by: Stefan Schmidt
Tested by: Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-29 15:13:03 +00:00
Sean Bright
a05723fd5f Use ast_audiohook_write_list_empty to determine if our lists are empty instead
of duplicating that logic.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-28 21:30:20 +00:00
Matthew Jordan
0ee313f076 Fix timing source dependency issues with MOH
Prior to this patch, res_musiconhold existed at the same module priority level
as the timing sources that it depends on.  This would cause a problem when
music on hold was reloaded, as the timing source could be changed after
res_musiconhold was processed.  This patch adds a new module priority level,
AST_MODPRI_TIMING, that the various timing modules are now loaded at.  This
now occurs before loading other resource modules, such that the timing source
is guaranteed to be set prior to resolving the timing source dependencies.

(closes issue ASTERISK-17474)
Reporter: Luke H
Tested by: Luke H, Vladimir Mikhelson, zzsurf, Wes Van Tlghem, elguero, Thomas Arimont
Patches:
 asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-1.8.diff uploaded by elguero (License #5026)
 asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-10.diff uploaded by elguero (License #5026)
 asterisk-17474-dahdi_timing-infinite-wait-fix_v3.diff uploaded by elguero (License #5026)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-27 20:48:11 +00:00
Sean Bright
c74793e570 Once an audiohook is attached to a channel, we continue to transcode all of the
frames, even after all of the hooks are detached.  This patch short-cicuits us
out before we transcode unnecessarily.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-27 17:09:14 +00:00
Sean Bright
b9bfee7ee6 In ChanSpy, don't create audiohooks that will never be used.
When ChanSpy is initialized it creates and attaches 3 audiohooks:

  1) Read audio off of the channel that we are spying on
  2) Write audio to the channel that we are spying on
  3) Write audio to the channel that is bridged to the channel that we are
     spying on.

The first is always necessary, but the others are used only when specific
options are passed to the ChanSpy application (B, d, w, and W to be specific).

When those flags are not passed, neither of those audiohooks are ever sent
frames, but we still try to process the hooks for each voice frame that we
recieve on the channel.

So in short - only create and attach audiohooks that we actually need.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 17:25:01 +00:00
Kinsey Moore
77fb12285d Fix missing doc tags found while fixing ASTERISK-18689
Add missing <variable></variable> tags in app_dial documentation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@348992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 15:24:33 +00:00
Richard Mudgett
9698383360 Fix extension state callback references in chan_sip.
Chan_sip gives a dialog reference to the extension state callback and
assumes that when ast_extension_state_del() returns, the callback cannot
happen anymore.  Chan_sip then reduces the dialog reference count
associated with the callback.  Recent changes (ASTERISK-17760) have
resulted in the potential for the callback to happen after
ast_extension_state_del() has returned.  For chan_sip, this could be very
bad because the dialog pointer could have already been destroyed.

* Added ast_extension_state_add_destroy() so chan_sip can account for the
sip_pvt reference given to the extension state callback when the extension
state callback is deleted.

* Fix pbx.c awkward statecbs handling in ast_extension_state_add_destroy()
and handle_statechange() now that the struct ast_state_cb has a destructor
to call.

* Ensure that ast_extension_state_add_destroy() will never return -1 or 0
for a successful registration.

* Fixed pbx.c statecbs_cmp() to compare the correct information.  The
passed in value to compare is a change_cb function pointer not an object
pointer.

* Make pbx.c ast_merge_contexts_and_delete() not perform callbacks with
AST_EXTENSION_REMOVED with locks held.  Chan_sip is notorious for
deadlocking when those locks are held during the callback.

* Removed unused lock declaration for the pbx.c store_hints list.

(closes issue ASTERISK-18844)
Reported by: rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@348940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 02:09:16 +00:00
Matthew Jordan
78f0d8d50b Fix for memory leaks / cleanup in cel_pgsql
There were a number of issues in cel_pgsql's pgsql_log method:
* If either sql or sql2 could not be allocated, the method would return while
the pgsql_lock was still locked
* If the execution of the log statement succeeded, the sql and sql2 structs
were never free'd
* Reconnection successes were logged as ERRORs.  In general, the severity of
several logging statements was reduced

(closes issue ASTERISK-18879)
Reported by: Niolas Bouliane
Tested by: Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@348888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-22 22:31:46 +00:00
Terry Wilson
05078f24e1 Allow packetization vaules > 127
According to the RTP packetization documentation, and the maximum values
listed in AST_FORMAT_LIST, we should support values > that the signed
char array that ast_codec_pref makes available to store the value. All
places in the code treat the framing field as though it were an int
array instaead of a char array anyway, so this just fixes the type of
the array.

(closes issue ASTERISK-18876)
Review: https://reviewboard.asterisk.org/r/1639/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@348833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-22 18:38:46 +00:00
Richard Mudgett
fc96f6eb9d Fix chan_iax2 to not report an RDNIS number if it is blank.
Some ISDN switches complain or block the call if the RDNIS number is
empty.

* Made chan_iax2 not save a RDNIS number into the ast_channel if the
string is blank.  This is what other channel drivers do.

(closes issue ASTERISK-17152)
Reported by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@348735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-20 23:08:21 +00:00