Commit Graph

4703 Commits

Author SHA1 Message Date
Joshua Colp b4e10e7c90 Merge "app_confbridge: Add a regcontext option for confbridge bridge profiles." 2016-05-10 04:48:35 -05:00
Jaco Kroon 8923c9ac96 app_confbridge: Add a regcontext option for confbridge bridge profiles.
This patch allows for having app_confbridge register the name of the
conference as an extension into a specific context, similar to
regcontext for chan_sip.  This variant is not quite as involved as the
one in chan_sip and doesn't allow for multiple contexts or custom
extensions, you can only specify the context and the conference name
will always be used as the extension to register.

ASTERISK-25989 #close

Change-Id: Icacf94d9f2b5dfd31ef36f6cb702392619a7902f
2016-05-09 08:18:56 -05:00
Joshua Colp 122895f864 Merge "app_chanspy: fix audiohook options in non read-only mode" 2016-05-04 04:49:29 -05:00
Jean Aunis 0c9faaee47 app_chanspy: fix audiohook options in non read-only mode
When option 'o' was not set, ChanSpy created its audiohook with the flag
AST_AUDIOHOOK_MUTE_WRITE, which caused ChanSpy to listen audio from one
direction only.

ASTERISK-25866 #close

Change-Id: I5c745855eea29a3fbc4e4aed0b0c0f53580535e0
2016-05-03 17:17:48 -05:00
Andrew Nagy 080c6216b6 app_voicemail: always copy dynamic struct to avoid race condition
Voicemail email addresses can be corrupt or voicemail
emails can end up being sent to the wrong email address if asterisk is
reading voicemail.conf during a reload and processing an email at the
same time. This patch always copies the struct that would otherwise only
be copied once.

ASTERISK-24463 #close
Reported by: John Campbell
Tested by: Etienne Lessard
Tested by: Andrew Nagy
Change-Id: I3a0643813116da84e2617291903d0d489b7425fb
2016-05-03 05:25:28 -05:00
Jean Aunis 7281770710 app_chanspy: reduce audio loss on the spying channel.
ChanSpy was creating its audiohook with the flags AST_AUDIOHOOK_TRIGGER_SYNC
and AST_AUDIOHOOK_SMALL_QUEUE, which caused audio frames to be lost when
queues grow too large or when read and write queues go out of sync.
Now these flags are set conditionally:
- AST_AUDIOHOOK_TRIGGER_SYNC is not set if the option "o" is set
- a new option "l" is created: if set, AST_AUDIOHOOK_SMALL_QUEUE will not
be set on the audiohook

ASTERISK-25866

Change-Id: I9c7652f41d9fa72c8691e4e70ec4fd16b047a4dd
2016-04-27 15:39:59 +02:00
Joshua Colp 8ae69cffef app_queue: Fix crash when unloading module.
When unloading the app_queue module the members in each queue are
destroyed and as part of this they are removed from the pending
members container. Unfortunately a crash would occur as the container
was destroyed before the members were removed.

This change tweaks ordering so the container destruction occurs
after the members are destroyed.

ASTERISK-16115

Change-Id: I48c728668c55aee3d05b751a5d450fb57e87f44b
2016-04-26 05:52:54 -05:00
zuul 811e24f595 Merge "Bridge system: Fix memory leaks and double frees on impart failure." 2016-04-25 21:08:16 -05:00
Joshua Colp 456600a641 Merge "app_queue: queue members can receive multiple calls" 2016-04-25 19:34:09 -05:00
DarkS f99ec857c8 Fix case sensitive actions in AMI QueueSummary and QueueStatus
ASTERISK-25954 #close
Reported by: Javier Acosta

Change-Id: I00be83d45cc7e8385de2523012bd196aafeeb256
(cherry picked from commit c0688a6398)
2016-04-25 14:22:11 -05:00
Kevin Harwell 30ab21d5fa app_queue: queue members can receive multiple calls
It was possible for a queue member that is a member of at least 2 or more
queues to receive mulitiple calls at the same time. This happened because
of a race between when a member was being rung and when the device state
notified the other queue(s) member object of the state change.

This patch makes it so when a queue member is being rung it gets added to
a global pool of queue members. If that same member is tried again, e.g.
from another queue, and it is found to already exist in the pending member
container then it will not ring that member.

ASTERISK-16115 #close

Change-Id: I546dd474776d158c2b6be44205353dee5bac7e48
2016-04-25 12:39:56 -05:00
Richard Mudgett a63656b419 Bridge system: Fix memory leaks and double frees on impart failure.
You cannot reference the passed in features struct after calling
ast_bridge_impart().  Even if the call fails.

Change-Id: I902b88ba0d5d39520e670fb635078a367268ea21
2016-04-22 15:45:47 -05:00
Joshua Colp d95512a7dd app_talkdetect: Make the module core supported.
This module is used as part of testsuite tests to confirm
stuff works. I'm accordingly marking it as core as it is
required by those tests.

Change-Id: I558e7af7679b22b8ed641d7dd37ee4ca35b11e88
2016-04-19 13:02:56 -05:00
ibercom dbb47e0a47 app_queue: Frequent segfaults in function can_ring_entry()
ASTERISK-25888 #close

Change-Id: I007a2f2dd99823e04fb5be3ff01f02b0a2956117
2016-04-18 05:06:55 -05:00
Joshua Colp f7a434fa6d Merge "app_voicemail/IMAP: function 'save_to_folder' creates wrong folder" 2016-04-15 14:37:28 -05:00
Joshua Colp 5a0534dc62 app_voicemail: Fix test_voicemail_notify_endl test.
The test_voicemail_notify_endl test checks the end-of-line
characters of an email message to confirm that they are consistent.
The test wrongfully assumed that reading from the email message
into a buffer will always result in more than 1 character being
read. This is incorrect. If only 1 character was read the test
would go outside of the buffer and access other memory causing
a crash.

The test now checks to ensure that 2 or more characters are read
in ensuring the test stays within the buffer.

ASTERISK-25874 #close

Change-Id: Ic2c89cea6e90f2c0bc2d8138306ebbffd4f8b710
2016-04-12 10:22:06 -05:00
Alexei Gradinari c00c298a0e app_voicemail/IMAP: function 'save_to_folder' creates wrong folder
If try to move message to Cust1 (number 5)
the function 'save_to_folder' tries to create Greeting folder instead of Cust1.

This patch fixed it by setting GREETINGS_FOLDER = -1

ASTERISK-24927 #close

Change-Id: I03d1a761894bcc2d130ec9b003bbcddc28e25c51
2016-04-11 22:31:21 -05:00
zuul c3339816f1 Merge "app_voicemail/IMAP: IMAP access FATAL error: Out of memory" 2016-04-11 14:21:21 -05:00
Alexei Gradinari f9dab80816 app_voicemail/IMAP: IMAP access FATAL error: Out of memory
Sometimes uw-imap function 'mail_fetchbody' returns huge len
which then pass to uw-imap function 'rfc822_base64'.
uw-imap tries to allocate huge memory and abort() on fail.

This patch check the len.
If the len more than max size (128 Mbytes) log error.
This patch also set variables len, newlen to avoid uninizialezed len.
This patch also check pointer returned by rfc822_base64.

ASTERISK-25899 #close

Change-Id: I4a0e7d655f11abef6a5224e2169df6d5c1f1caca
2016-04-08 13:04:02 -05:00
Richard Mudgett 6138a75e8e pbx.h: Make ast_state_cb_type take more const.
This eliminates some casts that I made a note saying v10 and above
would no longer need them.

Better late than never :)

Change-Id: I346cdb3032b6478ceb40eb6fe732978b54035572
2016-04-07 17:20:17 -05:00
Jacek Konieczny 9785e8d090 app_echo: forward and generate VIDUPDATE frames
When using app_echo via WebRTC with VP8 video the video would appear
only after a few minutes, because there would be nothing to request
a full reference frame.

This fixes the problem in both ways:
- echos any VIDUPDATE frames received on the channel
- sends one such frame when first video frame is to be forwarded

This makes the echo work with Firefox and Chrome WebRTC implementation.

ASTERISK-25867 #close

Change-Id: I73bda87bf7532ee8bfb28d917045a21034908c1e
2016-03-29 10:39:49 -05:00
Gianluca Merlo 894071ea2c config: fix flags in uint option handler
The configuration unsigned integer option handler sets flags for the
parser as if the option should be a signed integer (PARSE_INT32),
leading to errors on "out of range" values. Fix flags (PARSE_UINT32).

A fix to res_pjsip is also present which stops invalid flags from
being passed when registering sorcery object fields for qualify
status.

ASTERISK-25612 #close

Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e
2016-03-24 11:15:30 -05:00
Andrew Nagy 7964e260d3 app_stasis: Don't hang up if app is not registered
This prevents pbx_core from hanging up the channel if the app isn't
registered.

ASTERISK-25846 #close

Change-Id: I63216a61f30706d5362bc0906b50b6f0544aebce
2016-03-16 11:18:28 -05:00
Walter Doekes dcb25bb057 app_chanspy: Fix occasional deadlock with ChanSpy and Local channels.
Channel masquerading had a conflict with autochannel locking.

When locking autochannel->channel, the channel is fetched from the
autochannel and then locked. During the fetch, the autochannel -- which
has no locks itself -- can be modified by someone who owns the channel
lock. That means that the value of autochan->channel cannot be trusted
until you hold the lock.

In practice, this caused problems with Local channels getting
masqueraded away while the ChanSpy attempted to get info from that
channel. The old channel which was about to get removed got locked, but
the new (replaced) channel got unlocked (no-op). Because the replaced
channel was now locked (and would never get unlocked), it couldn't get
removed from the channel list in a timely manner, and would now cause
deadlocks when iterating over the channel list.

This change checks the autochannel after locking the channel for changes
to the autochannel. If the channel had been changed, the lock is
reobtained on the new channel.

In theory it seems possible that after this fix, the lock attempt on the
old (wrong) channel can be on an already destroyed lock, maybe causing
a crash. But that hasn't been observed in the wild and is harder induce
than the current deadlock.

Thanks go to Filip Frank for suggesting a fix similar to this and
especially to IRC user hexanol for pointing out why this deadlock was
possible and testing this fix. And to Richard for catching my rookie
while loop mistake ;)

ASTERISK-25321 #close

Change-Id: I293ae0014e531cd0e675c3f02d1d118a98683def
2016-03-11 16:05:30 -06:00
Rodrigo Ramírez Norambuena 15aeb78c66 app_queue: fix Calculate talktime when is first call answered
Fix calculate of average time for talktime is wrong when is completed the
first call beacuse the time for talked would be that call.

ASTERISK-25800 #close

Change-Id: I94f79028935913cd9174b090b52bb300b91b9492
2016-02-17 02:42:46 -03:00
Richard Mudgett 1bc54aee80 app_confbridge: Only use b_profile options from the conference.
A user cannot set new bridge options after the conference is created by
the first user.  Attempting to do so is documented as undefined behavior.

This patch ensures that the bridge profile options used are from the
conference and not what a subsequent user may have tried to set.

Change-Id: I1b6383eba654679e5739d5a8de98199cf074a266
2016-02-05 11:57:48 -06:00
Joshua Colp 0aea293450 Merge "app_confbridge.c: Replace inlined code with existing function." 2016-02-05 11:49:43 -06:00
Joshua Colp e541d9cf34 Merge topic 'ASTERISK-20987'
* changes:
  app_confbridge: Add ability to get the muted conference state.
  app_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation.
  app_confbridge: Make non-admin users join a muted conference muted.
2016-02-05 11:49:15 -06:00
Richard Mudgett af6b15976d app_confbridge.c: Replace inlined code with existing function.
Change-Id: Ida5594e9f8d7c1fc18eeb733a11f8fb96326da51
2016-01-27 16:46:20 -06:00
Richard Mudgett 7932336a3d app_confbridge: Add ability to get the muted conference state.
* Added CONFBRIDGE_INFO(muted,) for querying the muted conference state.

* Added Muted header to AMI ConfbridgeListRooms action response list
events to indicate the muted conference state.

* Added Muted column to CLI "confbridge list" output to indicate the muted
conference state and made the locked column a yes/no value instead of a
locked/unlocked value.

ASTERISK-20987
Reported by: hristo

Change-Id: I4076bd8ea1c23a3afd4f5833e9291b49a0c448b1
2016-01-27 16:46:20 -06:00
Richard Mudgett 894045e7cf app_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation.
Change-Id: Ic1f9e22ba1f2ff3b3f5cb017c5ddcd9bd48eccc7
2016-01-27 16:46:20 -06:00
Richard Mudgett 12c93e8f81 app_confbridge: Make non-admin users join a muted conference muted.
ASTERISK-20987 #close
Reported by: hristo

Change-Id: Ic61a2b524ab3a4cfadf227fc6b3506527bc03f38
2016-01-27 16:46:20 -06:00
Rodrigo Ramírez Norambuena f299dc0d76 app_queue: Add Lastpause field of queue member
Add time when started a the last pause for a queue member for
QueueMemberStatus ami event.

Also show accumulate time in seconds when started a pause for a queue
member to CLI command 'queue show'.

ASTERISK-16394 #close

Change-Id: I4b12aa3b2efa8d02939db3e13712510b4879865c
2016-01-25 03:51:41 -03:00
Joshua Colp ef293354dc Merge "app_queue: fix some tab format" 2016-02-03 06:19:48 -06:00
Joshua Colp fe059b3534 Merge "app_queue: Fix preserved reason of pause when Asterisk is restared" 2016-02-03 06:19:19 -06:00
Joshua Colp 527057ae24 Merge "app_queue.c: remove include for core_unreal.h not used in code." 2016-02-03 06:18:58 -06:00
George Joseph 40da6434c1 build_system: Fix some warnings highlighted by clang
Fix some warnings found with clang.

Change-Id: I5195b6189b148c2ee3ed4a19d015a6d4ef3e77bd
2016-02-01 19:22:40 -06:00
Rodrigo Ramírez Norambuena 8c664da0ff app_queue: fix some tab format
Change-Id: I2734392b131f1fb0949515d538f83f30fbc15d8c
2016-01-23 15:34:11 -03:00
Rodrigo Ramírez Norambuena d3969d09ae app_queue.c: remove include for core_unreal.h not used in code.
Change-Id: Idc2ae8a6bd869a66544916906744a5678622262d
2016-01-22 14:18:57 -03:00
Rodrigo Ramírez Norambuena 378fed4900 app_queue: Fix preserved reason of pause when Asterisk is restared
When the Asterisk is restared is not preseved reason paused of members.
This patch fixed this cases, retain data on astdb and set when Asterisk
is started.

ASTERISK-25732 #close

Report by: Rodrigo Ramírez Norambuena

Change-Id: Id3fb744c579e006d27cda4a02334ac0e4bed9eb5
2016-01-19 10:14:17 -03:00
Martin Tomec 90b06d1a3c app_queue: Add member flag "in_call" to prevent reading wrong lastcall time
Member lastcall time is updated later than member status. There was chance to
check wrapuptime for available member with wrong (old) lastcall time.
New boolean flag "in_call" is set to true right before connecting call, and
reset to false after update of lastcall time. Members with "in_call" set to true
are treat as unavailable.

ASTERISK-19820 #close

Change-Id: I1923230cf9859ee51563a8ed420a0628b4d2e500
2016-01-05 17:44:11 +01:00
Joshua Colp 0c62e0a55c Merge "voicemail: Move app_voicemail / res_mwi_external conflict to runtime" 2016-01-05 05:55:56 -06:00
George Joseph 6d18fe151c voicemail: Move app_voicemail / res_mwi_external conflict to runtime
The menuselect conflict between app_voicemail and res_mwi_external
makes it hard to package 1 version of Asterisk.  There no actual
build dependencies between the 2 so moving this check to runtime
seems like a better solution.

The ast_vm_register and ast_vm_greeter_register functions in app.c
were modified to return AST_MODULE_LOAD_DECLINE instead of -1 if there
is already a voicemail module registered. The modules' load_module
functions were then modified to return DECLINE instead of -1 to the
loader.  Since -1 is interpreted by the loader as AST_MODULE_LOAD_FAILURE,
the modules were incorrectly causing Asterisk to stop so this needed
to be cleaned up anyway.

Now you can build both and use modules.conf to decide which voicemail
implementation to load.

The default menuselect options still build app_voicemail and not
res_mwi_external but if both ARE built, res_mwi_external will load
first and become the voicemail provider unless modules.conf rules
prevent it.  This is noted in CHANGES.

Change-Id: I7d98d4e8a3b87b8df9e51c2608f0da6ddfb89247
2016-01-04 17:31:24 -06:00
Richard Mudgett f88b952093 app_dial: Immediately exit dial if the caller is already hung up.
If a caller hangs up before dial is executed within an AGI then the AGI
has likely eaten all queued frames before executing the dial in DeadAGI
mode.  With the caller hung up and no pending frames from the caller's
read queue, dial would not know that the call has hung up until a called
channel answers.  It is rather annoying to whoever just answered the
non-existent call.

Dial should not continue execution in DeadAGI mode, hangup handlers, or
the h exten.

* Added a check early in dial to abort dialing if the caller has hungup.

ASTERISK-25307 #close
Reported by: David Cunningham

Change-Id: Icd1bc0764726ef8c809f76743ca008d0f102f418
2016-01-04 13:34:13 -06:00
Dade Brandon ca394161cf app_amd: Correct maximum_number_of_words functionality & documentation
- The maximum_number_of_words was previously documented as being
the number of words that when exceeded, would result in the AMD
application returning that the audio represents a machine.

This was inconsistent with its actual functionality - it was
a number of words that when REACHED, would result in determination
as a machine.

This update corrects the functionality to match the previously
documented functionality.  This is a backwards incompatible change
in configuration file, and has been added to UPGRADE.txt as a result.

The sample configuration file and application defaults have been updated
so that the default value is now 2, which reflects the same default
functionality as previous versions.

- Update documentation for silence_threshold, which previously implied
that it was measuring time, rather than noise averages in the sample.

- Update the comments in amd.conf.sample.

ASTERISK-25639 #close
Change-Id: I4b1451e5dc9cb3cb06d59b6ab872f5275ba79093
2015-12-21 16:02:09 -08:00
Carlos Oliva 3e7522533c app_queue: update RT members when the 1st call joins a queue with no agents
If a call enters on a queue and the members on that queue are updated in
realtime (ex: using mysql inserting a new agent) the queue members are
never refreshed and the call will stay in the queue until other event occurs.
This happens only if this is the first call of the queue and there is no
agents servicing.
This patch prevent this issue, ensuring realtime members are updated if
there is one call in the queue and no available agents

ASTERISK-25442 #close

Change-Id: If1e036d013a5c1d8b0bf60d71d48fe98694a8682
2015-12-14 17:21:27 +01:00
Corey Farrell fcaebb0e43 app_meetme: Set default value for audio_buffers.
The default value was never set for audio_buffers, causing bad
audio quality.  This ensures the default is always set.

ASTERISK-25569 #close

Change-Id: I2d2ee3e644120b0f9f6ea6ab9286d7d590942a44
2015-12-09 15:57:48 -06:00
Rodrigo Ramírez Norambuena f2a84b500d app_queue: Show reason of pause on CLI
Add value of pause reason when is paused on CLI command "queue show"

ASTERISK-25581 #close

Report by: Rodrigo Ramírez Norambuena

Change-Id: I887028a40cd97b350da9a3bb2719616b7fec9864
2015-11-28 15:33:41 -03:00
Joshua Colp b52b494004 Merge "StatsD: Add sample rate compatibility" 2015-11-19 10:27:07 -06:00
Matt Jordan 65102d19bc Merge "app_bridgeaddchan: ability to barge into existing call" 2015-11-18 21:30:49 -06:00