Commit Graph

613 Commits

Author SHA1 Message Date
Naveen Albert 40fd161575 app_dial: Add dial time for progress/ringing.
Add a timeout option to control the amount of time
to wait if no early media is received before giving
up. This allows aborting early if the destination
is not being responsive.

Resolves: #588

UserNote: The timeout argument to Dial now allows
specifying the maximum amount of time to dial if
early media is not received.

(cherry picked from commit e4adc962ca)
2024-03-07 14:17:23 +00:00
Maximilian Fridrich 8f9200d106 app_dial: Add option "j" to preserve initial stream topology of caller
Resolves: #462

UserNote: The option "j" is now available for the Dial application which
uses the initial stream topology of the caller to create the outgoing
channels.

(cherry picked from commit dcf58ee88f)
2024-01-12 18:29:19 +00:00
Naveen Albert 7959c64792 app_dial: Fix infinite loop when sending digits.
If the called party hangs up while digits are being
sent, -1 is returned to indicate so, but app_dial
was not checking the return value, resulting in
the hangup being lost and looping forever until
the caller manually hangs up the channel. We now
abort if digit sending fails.

ASTERISK-29428 #close

Resolves: #281
(cherry picked from commit 4542ffe5d5)
2023-09-06 16:56:00 +00:00
Naveen Albert 0dd0bc3e65 app_dial: Fix DTMF not relayed to caller on unanswered calls.
DTMF frames are not handled in app_dial when sent towards the
caller. This means that if DTMF is sent to the calling party
and the call has not yet been answered, the DTMF is not audible.
This is now fixed by relaying DTMF frames if only a single
destination is being dialed.

ASTERISK-29516 #close

Change-Id: Iafd7430ac2915126d42dc48f0b73b262452ee027
(cherry picked from commit 090ec448cf)
2023-05-08 18:13:35 +00:00
Naveen Albert bcc18ca9f5 general: Fix various typos.
ASTERISK-30089 #close

Change-Id: I1f5db911fd05a3a211c522c13e990fa1d0e62275
2022-07-12 07:46:03 -05:00
Naveen Albert 626fefdf7d app_dial: Fix dial status regression.
ASTERISK_28638 caused a regression by incorrectly aborting
early and overwriting the status on certain calls.
This was exhibited by certain technologies such as DAHDI,
where DAHDI returns NULL for the request if a line is busy.
This caused the BUSY condition to be incorrectly treated
as CHANUNAVAIL because the DIALSTATUS was getting incorrectly
overwritten and call handling was aborted early.

This is fixed by instead checking if any valid peers have been
specified, as opposed to checking the list size of successful
requests. This is because the latter could be empty but this
does not indicate any kind of problem. This restores the
previous working behavior.

ASTERISK-29989 #close

Change-Id: I4d4b209b967816b1bc791534593ababa2b99bb88
2022-07-01 10:18:47 -05:00
Naveen Albert ae8a36a7d9 app_dial: Propagate outbound hook flashes.
The Dial application currently stops hook flashes
dead in their tracks from propagating through on
outbound calls. This fixes that so they can go
down the wire.

ASTERISK-30115 #close

Change-Id: Id4e78b29a049f35c5b1e7520eaa10d0eb5b7f97c
2022-07-01 10:14:17 -05:00
Naveen Albert 892c06564f chan_dahdi: Document dial resource options.
Documents the Dial syntax for DAHDI, namely the channel group,
distinctive ring, answer confirmation, and digital call options
that are specified in the resource itself.

ASTERISK-24827 #close

Change-Id: Ib95e78497fb00dc5cbfde1c93a69f034bfd08c30
2022-05-02 15:47:26 -05:00
Maximilian Fridrich 53a3af6321 app_dial: Flip stream direction of outgoing channel.
When executing dial, the topology of the incoming channel is cloned and
used for the outgoing channel. This creates issues when an incoming
stream is sendonly or recvonly as the stream state of the outgoing
channel will be the same as the stream state of the incoming channel.

Now the stream state is flipped for the outgoing stream in
dial_exec_full if the incoming stream topology is recvonly or sendonly.

ASTERISK-29655
Reported by: Michael Auracher

ASTERISK-29638
Reported by: Michael Auracher

Change-Id: I294dc834ac9a5f048b101b691669959e9df630e1
2022-04-26 12:22:46 -05:00
Naveen Albert 1e87cadf8e app_dial: Document DIALSTATUS return values.
Adds documentation for all of the possible return values
for the DIALSTATUS variable in the Dial application.

ASTERISK-25716

Change-Id: Id22593f1f1f7ea86e5734cee49516ec50848e8c0
2022-03-23 18:09:58 -05:00
Naveen Albert f7c4a3800c app_sf: Add full tech-agnostic SF support
Adds tech-agnostic support for SF signaling
by adding SF sender and receiver applications
as well as Dial integration.

ASTERISK-29802 #close

Change-Id: I7ec50752e9a661af639425e5d1e339f17411bcad
2022-01-05 09:34:18 -06:00
Naveen Albert ee9eef492c app_mf: Add full tech-agnostic MF support
Adds tech-agnostic support for MF signaling by adding
MF sender and receiver applications as well as Dial
integration.

ASTERISK-29496-mf #do-not-close

Change-Id: I61962b359b8ec4cfd05df877ddf9f5b8f71927a4
2021-12-13 09:42:46 -06:00
Mark Petersen a8b2692836 apps/app_dial.c: HANGUPCAUSE reason code for CANCEL is set to AST_CAUSE_NORMAL_CLEARING
changed that when we recive a CANCEL that we set HANGUPCAUSE to AST_CAUSE_NORMAL_CLEARING

ASTERISK-28053
Reported by: roadkill

Change-Id: Ib653aec2282f55b59d87484391cc07c8e6612b89
2021-12-06 09:17:14 -06:00
Alexander Traud 196c24df22 apps: Fix for Doxygen.
ASTERISK-29740

Change-Id: Icb6fbcfea0a5f1c82caa5001902b6a786adbf307
2021-11-18 10:37:56 -06:00
Josh Soref eb03b18ff9 apps: Spelling fixes
Correct typos of the following word families:

simultaneously
administrator
directforward
attachfmt
dailplan
automatically
applicable
nouns
explicit
outside
sponsored
attachment
audio
spied
doesn't
counting
encoded
implements
recursively
emailaddress
arguments
queuerules
members
priority
output
advanced
silencethreshold
brazilian
debugging
argument
meadmin
formatting
integrated
sneakiness

ASTERISK-29714

Change-Id: Ie5ecaec91c00b26309da4e51cfc0991a5bb7d092
2021-11-16 05:38:29 -06:00
Naveen Albert 1e5a2cfe30 app_dial: Expanded A option to add caller announcement
Hitherto, the A option has made it possible to play
audio upon answer to the called party only. This option
is expanded to allow for playback of an audio file to
the caller instead of or in addition to the audio
played to the answerer.

ASTERISK-29442

Change-Id: If6eed3ff5c341dc8c588c8210987f2571e891e5e
2021-06-23 13:28:32 -05:00
Sean Bright 8987de270f app_dial.c: Only send DTMF on first progress event.
ASTERISK-29329 #close

Change-Id: Ic58e7a17f1ff3f785a5b21dced88682581149601
2021-03-10 04:23:11 -06:00
George Joseph 64ca2d48da scope_trace: Added debug messages and added additional macros
The SCOPE_ENTER and SCOPE_EXIT* macros now print debug messages
at the same level as the scope level.  This allows the same
messages to be printed to the debug log when AST_DEVMODE
isn't enabled.

Also added a few variants of the SCOPE_EXIT macros that will
also call ast_log instead of ast_debug to make it easier to
use scope tracing and still print error messages.

Change-Id: I7fe55f7ec28069919a0fc0b11a82235ce904cc21
2020-08-24 08:41:27 -05:00
George Joseph 647c53c41f ACN: Changes specific to the core
Allow passing a topology from the called channel back to the
calling channel.

 * Added a new function ast_queue_answer() that accepts a stream
   topology and queues an ANSWER CONTROL frame with it as the
   data.  This allows the called channel to indicate its resolved
   topology.

 * Added a new virtual function to the channel tech structure
   answer_with_stream_topology() that allows the calling channel
   to receive the called channel's topology.  Added
   ast_raw_answer_with_stream_topology() that invokes that virtual
   function.

 * Modified app_dial.c and features.c to grab the topology from the
   ANSWER frame queued by the answering channel and send it to
   the calling channel with ast_raw_answer_with_stream_topology().

 * Modified frame.c to automatically cleanup the reference
   to the topology on ANSWER frames.

Added a few debugging messages to stream.c.

Change-Id: I0115d2ed68d6bae0f87e85abcf16c771bdaf992c
2020-08-18 05:16:43 -05:00
George Joseph 9bd1d686a1 ACN: Add tracing to existing code
Prior to making any modifications to the pjsip infrastructure
for ACN, I've added the tracing functions to the existing code.
This should make the final commit easier to review, but we can also
now run a "before and after" trace.

No functional changes were made with this commit.

Change-Id: Ia83a1a2687ccb96f2bc8a2a3928a5214c4be775c
2020-07-08 09:24:42 -05:00
Richard Mudgett abcb4ab321 app_dial.c: Simplify dialplan using Dial.
Dialplan has to be careful about passing an empty destination list or
empty positions in the list.  As a result, dialplan has to check for
these conditions before using Dial.  Simplify dialplan by making Dial
handle these conditions gracefully.

* Made tolerate empty positions in the dialed device list.

* Reduced some message log levels from notice to verbose.

ASTERISK-28638

Change-Id: I6edc731aff451f8bdfaee5498078dd18c3a11ab9
2020-01-05 21:24:27 -06:00
Antoni Goldstein 8e21c25ce5 app_dial.c: RINGTIME, PROGRESSTIME and ms resolution dial timings
Added RINGTIME, RINGTIME_MS, PROGRESSTIME, PROGRESSTIME_MS variables filled
at the earliest received PROGRESS or RINGING.
Added millisecond versions of DIALEDTIME and ANSWEREDTIME.

Added millisecond versions of ast_channel_get_up_time and
ast_channel_get_duration in channel.c.

ASTERISK-28363

Change-Id: If95f1a7d8c4acbac740037de0c6e3109ff6620b1
2019-04-24 06:27:41 -06:00
Alexei Gradinari 4a567cee3a app_dial/queue/followme: 'I' options to block initial updates in both directions
The 'I' option currently blocks initial CONNECTEDLINE or REDIRECTING updates
from the called parties to the caller.

This patch also blocks updates in the other direction before call is
answered.

ASTERISK-27980

Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
2018-10-24 14:15:27 -05:00
Richard Mudgett 9838a5e57a app_dial/app_queue: Update application option documentation
* Update the post-answer documentation and example.  The Dial example was
incorrect and misleading for the post-answer subroutine useage.

* Fix note and warning paragraphs in option descriptions.  They don't show
up in the wiki.

Change-Id: I81019a1fd75d5b9151f76b52c38e2a90da682d14
2018-10-18 17:23:01 -05:00
Rodrigo Ramírez Norambuena 1a3115d1c5 app_dial: set the comment for OPT_ARG_ANNOUNCE to really what is done
Change-Id: I08f88adb09f7e5813f37e70fecd787468cdb32c8
2018-09-03 11:27:07 -03:00
Jenkins2 5843a19797 Merge "loader: Convert reload_classes to built-in modules." 2018-03-19 12:53:12 -05:00
Florian Floimair ecc846b26b app_dial: Enable early-media video
Certain applications (e.g. door-phone) require that also video is transmitted
before a call is accepted.

Change-Id: I9842e1dc2f6e1c2c49dc33fe615255007d2f821e
2018-03-16 17:53:20 +01:00
Corey Farrell 572a508ef2 loader: Convert reload_classes to built-in modules.
* acl (named_acl.c)
* cdr
* cel
* ccss
* dnsmgr
* dsp
* enum
* extconfig (config.c)
* features
* http
* indications
* logger
* manager
* plc
* sounds
* udptl

These modules are now loaded at appropriate time by the module loader.
Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
the module loader will abort startup on failure of these modules.

Some of these modules are still initialized or shutdown from outside the
module loader.  logger.c is initialized very early and shutdown very
late, manager.c is initialized by the module loader but is shutdown by
the Asterisk core (too much uses it without holding references).

Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
2018-03-14 05:20:12 -04:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Corey Farrell 955a891a84 app_macro deprecation.
* Mark the module deprecated.
* Disable the module by default.
* Produce a warning the first time a macro is used.
* Note deprecation related options in app_dial and app_queue.

ASTERISK-27350

Change-Id: I560ea043bacdbc5534a17d97854273d52c2f1bdc
2017-10-18 09:54:58 -05:00
Joshua Colp 5a7af00e80 asterisk: Audit locking of channel when manipulating flags.
When manipulating flags on a channel the channel has to be
locked to guarantee that nothing else is also manipulating
the flags. This change introduces locking where necessary to
guarantee this. It also adds helper functions that manipulate
channel flags and lock to reduce repeated code.

ASTERISK-26789

Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
2017-05-16 14:25:23 +00:00
Joshua Colp 2b22c3c84b channel: Add ability to request an outgoing channel with stream topology.
This change extends the ast_request functionality by adding another
function and callback to create an outgoing channel with a requested
stream topology. Fallback is provided by either converting the
requested stream topology into a format capabilities structure if
the channel driver does not support streams or by converting the
requested format capabilities into a stream topology if the channel
driver does support streams.

The Dial application has also been updated to request an outgoing
channel with the stream topology of the calling channel.

ASTERISK-26959

Change-Id: Ifa9037a672ac21d42dd7125aa09816dc879a70e6
2017-04-27 10:39:46 +00:00
Joshua Colp 5d938045d4 channel: Remove old epoll support and fixed max number of file descriptors.
This change removes the old epoll support which has not been used or
maintained in quite some time.

The fixed number of file descriptors on a channel has also been removed.
File descriptors are now contained in a growable vector. This can be
used like before by specifying a specific position to store a file
descriptor at or using a new API call, ast_channel_fd_add, which adds
a file descriptor to the channel and returns its position.

Tests have been added which cover the growing behavior of the vector
and the new API call.

ASTERISK-26885

Change-Id: I1a754b506c009b83dfdeeb08c2d2815db30ef928
2017-03-27 19:54:44 +00:00
Richard Mudgett 16fdb11bc3 core: Cleanup some channel snapshot staging anomalies.
We shouldn't unlock the channel after starting a snapshot staging because
another thread may interfere and do its own snapshot staging.

* app_dial.c:dial_exec_full() made hold the channel lock while setting up
the outgoing channel staging.  Made hold the channel lock after the called
party answers while updating the caller channel staging.

* chan_sip.c:sip_new() completed the channel staging on off-nominal exit.
Also we need to use ast_hangup() instead of ast_channel_unref() at that
location.

* channel.c:__ast_channel_alloc_ap() added a comment about not needing to
complete the channel snapshot staging on off-nominal exit paths.

* rtp_engine.c:ast_rtp_instance_set_stats_vars() made hold the channel
locks while staging the channels for the stats channel variables.

Change-Id: Iefb6336893163f6447bad65568722ad5d5d8212a
2017-02-10 12:05:56 -06:00
Joshua Colp 4de5454ef1 app_dial: Fix incorrect device state when channel is picked up.
Given the scenario where multiple channels are dialed using Dial()
but the caller is picked up using PickupChan() all outgoing channels
except the channel specified to PickupChan() would be marked
as ringing until the call had been hung up.

When using the PickupChan application the channel executing the
application is swapped into place of another channel. As part
of this process the channel is answered. The Dial application
has explicit logic which checks if the channel is answered,
cancels all other outgoing channels, and bridges. This logic is
different than the normal logic that is executed when an outgoing
channel is answered. This different logic failed to publish dial
events stating that the other outgoing channels had been canceled.
As a result references to the outgoing channels were held onto by
the dial masquerade process until the call had been ended and
the channels had gone away. This would result in the channels
appearing in the "core show channels" list despite not being present
anymore and would also result in incorrect device state.

This change makes it so that this logic also publishes
dial events stating that the other outgoing channels have been
canceled.

ASTERISK-26549

Change-Id: Iea7168e6e82f7d4609ec0366153804e4f55ea64f
2016-11-02 09:16:41 -05:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
George Joseph 86e8716952 app_dial: Add the "Q" option to set the cause on unanswered channels
The "Q" option will set the cause on the unanswered channels when
another channel answers.  It overrides the default of
ANSWERED_ELSEWHERE.

NOTE:  chan_sip does not support setting the cause on a CANCEL to
anything other than ANSWERED_ELSEWHERE.

ASTERISK-26446 #close

Change-Id: I71742e0919aaa16784c30a2b2e73fbeed7672e47
2016-10-11 12:05:56 -05:00
zuul cc7e978149 Merge "apps/app_dial: Fix crash on non-connect call paths for Privacy/Screening option" 2016-09-07 17:23:45 -05:00
Matt Jordan 730cb3b0b7 apps/app_dial: Fix crash on non-connect call paths for Privacy/Screening option
In any scenario in which the callee is not connected to the caller, the
current code in app_dial will crash due to raising a Dial End Stasis
Message after the callee channel has been hung up. This patch corrects
the error by simply moving the explicit hangup of the callee (peer)
channel until after the dial end message.

ASTERISK-25691 #close

Change-Id: I816a414014424d0d8c80e2a3cbef13ef8c63798d
2016-09-03 16:07:36 -05:00
Matt Jordan 6e1a3b924e apps/app_dial: Set the DIALSTATUS to NOANSWER on privacy option 5
If the callee selects option '5' using the Dial application's privacy
(P) option, the DIALSTATUS is erroneously set to ANSWER. This option
reflects the callee sending the caller to VoiceMail one time; the call
is definitely *not* ANSWERed in such a scenario. With this patch, the
DIALSTATUS is instead set to NOANSWER, which is the same DIALSTATUS that
is set when the 'send to VoiceMail every time' option is set.

ASTERISK-25691

Change-Id: Iaf0c9f0fa00545e7366443875e2bb7d9a89a1358
2016-09-03 16:06:56 -05:00
Matt Jordan 9202ca34a8 app_dial: Improve documentation
* Add some helpful <literal> and other embedded paragraph tags

* Document some of the lesser known channel variables set by Dial

* Add examples for some common Dial uses, along with some more
  challenging but useful options

Change-Id: Ib2fb9301e8e044d14fbb2815ec64161f19bbfbc1
2016-08-15 07:42:44 -05:00
Joshua Colp 5c949d009e Merge "Fixes to include signal.h" 2016-06-09 04:40:24 -05:00
Timo Teräs 39b69ab537 Fixes to include signal.h
POSIX defines signal.h. sys/signal.h should not be used as it is
c-library internal header which may or may not exist. Notably with
musl it generates warning of being incorrect.

Change-Id: Ia56b0aa1d84b5c590114867b1b384a624f39a6fc
2016-06-08 20:37:08 +03:00
Alexei Gradinari 3e8d523d88 core/dial: New channel variable FORWARDERNAME
Added a new channel variable FORWARDERNAME which indicates which
channel was responsible for a forwarding requests received on dial attempt.

Fixed a bug in the app_queue: FORWARD_CONTEXT is not used.

ASTERISK-26059 #close

Change-Id: I34e93e8c1b5e17776a77b319703c48c8ca48e7b2
2016-06-04 11:07:22 -05:00
Mark Michelson 205a31f86c Expand the scope of Dial Events
Dial events up to this point have come in two flavors
* A Dial event with no status to indicate that dialing has begun
* A Dial event with a status to indicate that dialing has ended

With this change, Dial events have been expanded to also give
intermediate events, such as "RINGING", "PROCEEDING", and "PROGRESS".
This is especially useful for ARI dialing, as it gives the application
writer the opportunity to place a channel into an early bridge when
early media is detected.

AMI handles these in-progress dial events by sending a new event called
"DialState" that simply indicates that dial state has changed but has
not ended. ARI never distinguished between DialBegin and DialEnd, so no
change was made to the event itself.

Another change here relates to dial forwards. A forward-related event
was previously only sent when a channel was successfully able to forward
a call to a new channel. With this set of changes, if forwarding is
blocked, we send a Dial event with a forwarding destination but no
forwarding channel, since we were prevented from creating one. This is
again useful for ARI since application writers can now handle call
forward attempts from within their own application.

ASTERISK-25925 #close
Reported by Mark Michelson

Change-Id: I42cbec7730d84640a434d143a0d172a740995543
2016-05-31 11:43:24 -05: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
Walter Doekes 39daf9f066 docs: Fix a few typo's in app docs (more then, resourse).
Change-Id: Iba57efadf6c0b822e762c7a001bc89611d98afd7
2015-11-06 16:46:31 -05:00
Matt Jordan e0d8b6a65d Merge "app_dial.c: Make 'A' option pass COLP updates." 2015-09-29 07:27:02 -05:00
Matt Jordan 360d076dfc Merge "app_dial.c: Force COLP update if outgoing channel name changed." 2015-09-29 07:26:20 -05:00
Joshua Colp afabf9da7f Merge "app_dial.c: Factor out a connected line update routine." 2015-09-28 14:07:05 -05:00