Commit Graph

317 Commits

Author SHA1 Message Date
Terry Wilson
2da89b3022 Add missing datastore inherit (exists in all other branches)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 23:37:59 +00:00
David Vossel
f42e9eb6bf Cleaning up a few things in detect disconnect patch
Initialized ast_call_feature in detect_disconnect to avoid accessing uninitialized memory.  Cleaned up /param tags in features.h.  No longer send dynamic features in ast_feature_detect. 

issue #11583


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 19:40:07 +00:00
David Vossel
dd17912d68 Allow disconnect feature before a call is bridged
feature.conf has a disconnect option.  By default this option is set to '*', but it could be anything.  If a user wishes to disconnect a call before the other side answers, only '*' will work, regardless if the disconnect option is set to something else.  This is because features are unavailable until bridging takes place.  The default disconnect option, '*', was hardcoded in app_dial, which doesn't make any sense from a user perspective since they may expect it to be something different.  This patch allows features to be detected from outside of the bridge, but not operated on.  In this case, the disconnect feature can be detected before briding and handled outside of features.c.

(closes issue #11583)
Reported by: sobomax
Patches:
	patch-apps__app_dial.c uploaded by sobomax (license 359)
	11583.latest-patch uploaded by murf (license 17)
	detect_disconnect.diff uploaded by dvossel (license 671)
Tested by: sobomax, dvossel
Review: http://reviewboard.digium.com/r/195/






git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 16:15:16 +00:00
Terry Wilson
4e069885ce Fix feature inheritance with builtin features
When using builtin features like parking and transfers, the AST_FEATURE_* flags
would not be set correctly for all instances when either performing a builtin
attended transfer, or parking a call and getting the timeout callback.  Also,
there was no way on a per-call basis to specify what features someone should
have on picking up a parked call (since that doesn't involve the Dial() command).
There was a global option for setting whether or not all users who pickup a
parked call should have AST_FEATURE_REDIRECT set, but nothing for DISCONNECT,
AUTOMON, or PARKCALL.

This patch:
1) adds the BRIDGE_FEATURES dialplan variable which can be set either in the
dialplan or with setvar in channels that support it.  This variable can be set
to any combination of 't', 'k', 'w', and 'h' (case insensitive matching of the
equivalent dial options), to set what features should be activated on this
channel.  The patch moves the setting of the features datastores into the
bridging code instead of app_dial to help facilitate this.

2) adds global options parkedcallparking, parkedcallhangup, and
parkedcallrecording to be similar to the parkedcalltransfers option for
globally setting features.

3) has builtin_atxfer call builtin_parkcall if being transfered to the parking
extension since tracking everything through multiple masquerades, etc. is
difficult and error-prone

4) attempts to fix all cases of return calls from parking and completed builtin
transfers not having the correct permissions
(closes issue #14274)
Reported by: aragon
Patches: 
      fix_feature_inheritence.diff.txt uploaded by otherwiseguy (license 396)
Tested by: aragon, otherwiseguy

Review http://reviewboard.digium.com/r/138/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-30 17:47:41 +00:00
Joshua Colp
8a1faf0a58 When a call is forwarded stop any active indications. The new channel will provide an indication, if need be, itself.
(closes issue #14310)
Reported by: RadicAlish


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 19:06:54 +00:00
Steve Murphy
e3700a13a4 This merges the masqpark branch into 1.4
These changes eliminate the need for (and use of)
the KEEPALIVE return code in res_features.c;
There are other places that use this result code
for similar purposes at a higher level, these appear
to be left alone in 1.4, but attacked in trunk.

The reason these changes are being made in 1.4, is
that parking ends a channel's life, in some situations,
and the code in the bridge (and some other places),
was not checking the result code properly, and dereferencing
the channel pointer, which could lead to memory corruption
and crashes.

Calling the masq_park function eliminates this danger 
in higher levels.

A series of previous commits have replaced some parking calls
with masq_park, but this patch puts them ALL to rest,
(except one, purposely left alone because a masquerade
is done anyway), and gets rid of the code that tests
the KEEPALIVE result, and the NOHANGUP_PEER result codes.

While bug 13820 inspired this work, this patch does
not solve all the problems mentioned there.

I have tested this patch (again) to make sure I have
not introduced regressions. 

Crashes that occurred when a parked party hung up
while the parking party was listening to the numbers
of the parking stall being assigned, is eliminated.

These are the cases where parking code may be activated:

1. Feature one touch (eg. *3)
2. Feature blind xfer to parking lot (eg ##700)
3. Run Park() app from dialplan (eg sip xfer to 700)
   (eg. dahdi hookflash xfer to 700)
4. Run Park via manager.

The interesting testing cases for parking are:
I. A calls B, A parks B
    a. B hangs up while A is getting the numbers announced.
    b. B hangs up after A gets the announcement, but 
       before the parking time expires
    c. B waits, time expires, A is redialed,
       A answers, B and A are connected, after
       which, B hangs up.
    d. C picks up B while still in parking lot.

II. A calls B, B parks A
    a. A hangs up while B is getting the numbers announced.
    b. A hangs up after B gets the announcement, but 
       before the parking time expires
    c. A waits, time expires, B is redialed,
       B answers, A and B are connected, after
       which, A hangs up.
    d. C picks up A while still in parking lot.

Testing this throroughly involves acting all the permutations
of I and II, in situations 1,2,3, and 4.

Since I added a few more changes (ALL references to KEEPALIVE in the bridge
code eliimated (I missed one earlier), I retested
most of the above cases, and no crashes.

H-extension weirdness.

Current h-extension execution is not completely
correct for several of the cases.

For the case where A calls B, and A parks B, the
'h' exten is run on A's channel as soon as the park
is accomplished. This is expected behavior.

But when A calls B, and B parks A, this will be
current behavior:

After B parks A, B is hung up by the system, and
the 'h' (hangup) exten gets run, but the channel
mentioned will be a derivative of A's...

Thus, if A is DAHDI/1, and B is DAHDI/2,
the h-extension will be run on channel
Parked/DAHDI/1-1<ZOMBIE>, and the 
start/answer/end info will be those 
relating to Channel A.

And, in the case where A is reconnected to
B after the park time expires, when both parties
hang up after the joyful reunion, no h-exten
will be run at all.

In the case where C picks up A from the 
parking lot, when either A or C hang up,
the h-exten will be run for the C channel.

CDR's are a separate issue, and not addressed
here.

As to WHY this strange behavior occurs, 
the answer lies in the procedure followed
to accomplish handing over the channel
to the parking manager thread. This procedure
is called masquerading. In the process,
a duplicate copy of the channel is created,
and most of the active data is given to the
new copy. The original channel gets its name
changed to XXX<ZOMBIE> and keeps the PBX
information for the sake of the original
thread (preserving its role as a call 
originator, if it had this role to begin
with), while the new channel is without
this info and becomes a call target (a
"peer").

In this case, the parking lot manager
thread is handed the new (masqueraded)
channel. It will not run an h-exten
on the channel if it hangs up while
in the parking lot. The h exten will
be run on the original channel instead,
in the original thread, after the bridge
completes.

See bug 13820 for our intentions as
to how to clean up the h exten behavior.

Review: http://reviewboard.digium.com/r/29/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 22:30:32 +00:00
Joshua Colp
dfa5f7c4b4 Can we try not to assign an unsigned int to -1?
(closes issue #14074)
Reported by: wetwired


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 15:05:08 +00:00
Tilghman Lesher
d8ff8d169d Change the default calldurationlimit from the special value 0 to -1, so we
can better detect an exceptional case.  This follows on to the changes made
in revision 156386.  Related to issue #13851.
(closes issue #13974)
 Reported by: paradise
 Patches: 
       20081208__bug13974.diff.txt uploaded by Corydon76 (license 14)
 Tested by: file, blitzrage, ZX81


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 23:22:02 +00:00
Mark Michelson
3a1a981e2e Make sure to set the hangup cause on the calling channel in the case
that ast_call() fails. For incoming SIP channels, this was causing
us to send a 603 instead of a 486 when the call-limit was reached on
the destination channel.

(closes issue #13867)
Reported by: still_nsk
Patches:
      13867.diff uploaded by putnopvut (license 60)
Tested by: blitzrage



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 17:33:06 +00:00
Mark Michelson
3429c9de5e Fix a crash in the end_bridge_callback of app_dial and
app_followme which would occur at the end of an attended
transfer. The error occurred because we initially stored
a pointer to an ast_channel which then was hung up due
to a masquerade.

This commit adds a "fixup" callback to the bridge_config
structure to allow for end_bridge_callback_data to be
changed in the case that a new channel pointer is needed
for the end_bridge_callback.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 18:25:55 +00:00
Tilghman Lesher
382459fac8 When using call limits under 1 second, infinite call lengths are allowed,
instead.
(closes issue #13851)
 Reported by: ruddy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 21:18:57 +00:00
Mark Michelson
bd9001e16b When doing some tests, I was having a crash at the end of every call
if an attended transfer occurred during the call. I traced the cause to
the CDR on one of the channels being NULL. murf suggested a check in
the end bridge callback to be sure the CDR is non-NULL before proceeding,
so that's what I'm adding.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:38:33 +00:00
Sean Bright
f2ecc4c80e Use static functions here instead of nested ones. This requires a small
change to the ast_bridge_config struct as well.  To understand the reason
for this change, see the following post:

    http://gcc.gnu.org/ml/gcc-help/2008-11/msg00049.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-09 01:08:07 +00:00
Terry Wilson
6280e04736 Recent CDR fixes moved execution of the 'h' exten into the bridging code, so variables that were set after ast_bridge_call was called would not show up in the 'h' exten. Added a callback function to handle setting variables, etc. from w/in the bridging code. Calls back into a nested function within the function calling ast_bridge_call
(closes issue #13793)
Reported by: greenfieldtech


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 15:45:29 +00:00
Steve Murphy
fffb7722be A little documentation cross-ref between features and
dial and queue... I wasted some time (stupidly) trying
to get the one-touch parking stuff working, because it
didn't occur to me that I had to also have the corresponding
options in the dial command! Duh! (In all this time, I never
set this up before!)
So, to keep some poor fool from suffering the same fate,
I made the features.conf.sample file mention the corresponding
opts in dial/queue; and the docs for dial/app specifically
mention the corresponding decls in the feature.conf file.

I hope this doesn't spoil some vast, eternal plan...



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:19:04 +00:00
Steve Murphy
961bc7e758 The magic trick to avoid this crash is not to
try to find the channel by name in the list,
which is slow and resource consuming, but rather
to pay attention to the result codes from the
ast_bridge_call, to which I added the 
AST_PBX_NO_HANGUP_PEER_PARKED value, which
now are returned when a channel is parked.

If you get AST_PBX_KEEPALIVE,
then don't touch the channel pointer.

If you get AST_PBX_NO_HANGUP_PEER, or
AST_PBX_NO_HANGUP_PEER_PARKED, then don't
touch the peer pointer.

Updated the several places where the results
from a bridge were not being properly obeyed,
and fixed some code I had introduced so that
the results of the bridge were not overridden 
(in trunk).

All the places that previously tested for 
AST_PBX_NO_HANGUP_PEER now have to check for
both AST_PBX_NO_HANGUP_PEER and AST_PBX_NO_HANGUP_PEER_PARKED.

I tested this against the 4 common parking
scenarios:


1. A calls B; B answers; A parks B; B hangs up while A is getting the parking
slot announcement, immediately after being put on hold.

2. A calls B; B answers; A parks B; B hangs up after A has been hung up, but
before the park times out.

3. A calls B; B answers; B parks A; A hangs up while B is getting the parking slot announcement, immediately after being put on hold.

4. A calls B; B answers; B parks A; A hangs up after B has been hung up, but before the park times out.


No crash.

I also ran the scenarios above against valgrind, and accesses looked good.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 04:36:32 +00:00
Tilghman Lesher
785f27a29a Reset all DIAL variables back to blank, in case Dial is called multiple times
per call (which could otherwise lead to inconsistent status reports).
(closes issue #13216)
 Reported by: ruddy
 Patches: 
       20081014__bug13216.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ruddy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-28 17:04:56 +00:00
Steve Murphy
eccd14d7f0 Tested by: sergee, murf, chris-mac, andrew, KNK
This is a "second attempt" to restore the previous "endbeforeh" behavior
in 1.4 and up. In order to capture information concerning all the
legs of transfers in all their infinite combinations, I was forced
to this particular solution by a chain of logical necessities, the
first being that I was not allowed to rewrite the CDR mechanism from 
the ground up!

This change basically leaves the original machinery alone, which allows
IVR and local channel type situations to generate CDR's as normal, but
a channel flag can be set to suppress the normal running of the h exten.
That flag would be set by the code that runs the h exten from the
ast_bridge_call routine, to prevent the h exten from being run twice.
Also, a flag in the ast_bridge_config struct passed into ast_bridge_call
can be used to suppress the running of the h exten in that routine. This
would happen, for instance, if you use the 'g' option in the Dial app.

Running this routine 'early' allows not only the CDR() func to be used
in the h extension for reading CDR variables, but also allows them to
be modified before the CDR is posted to the backends.

While I dearly hope that this patch overcomes all problems, and 
introduces no new problems, reality suggests that surely someone
will have problems. In this case, please re-open 13251 (or 13289),
and we'll see if we can't fix any remaining issues.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 04:29:34 +00:00
Steve Murphy
ee8adb313e (closes issue #12982)
Reported by: bcnit
Tested by: murf

I discovered that also, in the previous bug fixes and changes,
the cdr.conf 'unanswered' option is not being obeyed, so
I fixed this.

And, yes, there are two 'answer' times involved in this
scenario, and I would agree with you, that the first 
answer time is the time that should appear in the CDR.
(the second 'answer' time is the time that the bridge
was begun).

I made the necessary adjustments, recording the first
answer time into the peer cdr, and then using that to
override the bridge cdr's value.

To get the 'unanswered' CDRs to appear, I purposely
output them, using the dial cmd to mark them as
DIALED (with a new flag), and outputting them if
they bear that flag, and you are in the right mode.

I also corrected one small mention of the Zap device
to equally consider the dahdi device.

I heavily tested 10-sec-wait macros in dial, and
without the macro call; I tested hangups while the
macro was running vs. letting the macro complete
and the bridge form. Looks OK. Removed all the
instrumentation and debug.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 23:13:20 +00:00
Mark Michelson
cb503c4cb4 Add a check to the CAN_EARLY_BRIDGE macro in app_dial to
be sure there are no audiohooks present on the channels
involved. This fixed a one-way audio situation I had in
my test setup. I couldn't find any open issues that suggested
one-way audio with regards to mixmonitor (or other audiohook)
usage, though.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 17:50:21 +00:00
Tilghman Lesher
e46bb5f5bc Cause SIP to return a 480 instead of a 404 when a sip peer exists, but is not
registered.
(closes issue #12885)
 Reported by: ibc
 Patches: 
       20080701__bug12885__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ibc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 20:27:47 +00:00
Terry Wilson
d432d18723 Remove extra option from previous solution attempt
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 17:45:55 +00:00
Terry Wilson
e128c2a314 This should fix the behavior of the 'T' dial feature being passed incorrectly to the transferee when builtin_atxfers are used.
Also, doing a builtin_atxfer to parking was broken and is fixed here as well.

(closes issue #11898)
	Reported by: sergee
	Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 16:29:07 +00:00
Terry Wilson
c340004d76 Backport fix for 11520--for some reason I didn't do this back in February when I patched for trunk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-11 23:47:23 +00:00
Russell Bryant
c6c26f7c34 Fix another typo in documentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 01:03:22 +00:00
Michiel van Baak
383a1ece6b small typo fix 'retires' => 'retries'
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-01 20:47:55 +00:00
Mark Michelson
f1683753b8 If the datastore has been moved to another channel due to a masquerade, then
freeing the datastore here causes an eventual double free when the new channel
hangs up. We should only free the datastore if we were able to successfully remove
it from the channel we are referencing (i.e. the datastore was not moved).

(closes issue #12359)
Reported by: pguido



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 16:24:22 +00:00
Joshua Colp
2bf8f9fca3 Move where unanswered CDRs are dropped to the CDR core, not everything uses app_dial.
(closes issue #11516)
Reported by: ys
Patches:
      branch_1.4_cdr.diff uploaded by ys (license 281)
Tested by: anest, jcapp, dartvader


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 14:33:02 +00:00
Joshua Colp
cd703523db Add a control frame to indicate the source of media has changed. Depending on the underlying technology it may need to change some things.
(closes issue #12148)
Reported by: jcomellas


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 22:32:10 +00:00
Olle Johansson
3d434f14c3 Add dependency on chan_local to app_dial.
Dial still runs without chan_local, but will be missing forwarding functionality.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 17:31:17 +00:00
Russell Bryant
3e913c706f * Add channel locking around datastore operations that expect the channel
to be locked.
* Document why we don't record Local channels in the dialed interfaces list.
* Remove the dialed variable as it isn't needed.
* Restructure some code for clarity and coding guidelines stuff


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 16:38:48 +00:00
Russell Bryant
c13539cb13 Don't unlock the dialed_interfaces list until we're done messing with the iterator.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 02:51:22 +00:00
Russell Bryant
85e0e1919d Allow dialing local channels from Queue() and Dial() again. There was a slight
flaw in the code to prevent call forwards from looping that caused this problem.
(related to issue #11486)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 02:38:40 +00:00
Mark Michelson
a1a592f3f0 The 'G' option for Dial() did not properly handle the case where only a label was
provided. This was due to the fact that the answering channel did not have an extension
set, so ast_parseable_goto would fail. This fix eliminates the call to ast_parseable_goto
on the answering channel since it is a wasteful call. The answering channel and the calling
channel are both directed to the same extension and context, just different priorities, so
we can just copy the values from the calling channel to the answering channel and increment
the answering channel's priority.

(closes issue #11382, reported by jon, patch by me with correction by jon)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 22:35:52 +00:00
Joshua Colp
335d271dda Fix build issue on the build cluster.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 05:29:33 +00:00
Mark Michelson
7b052b78e1 A big one...
This is the merge of the forward-loop branch. The main change here is that call-forwards can no longer loop.
This is accomplished by creating a datastore on the calling channel which has a linked list of all devices
dialed. If a forward happens, then the local channel which is created inherits the datastore. If, through this
progression of forwards and datastore inheritance, a device is attempted to be dialed a second time, it will simply
be skipped and a warning message will be printed to the CLI. After the dialing has been completed, the datastore
is detached from the channel and destroyed.

This change also introduces some side effects to the code which I shall enumerate here:

1. Datastore inheritance has been backported from trunk into 1.4
2. A large chunk of code has been removed from app_dial. This chunk is the section of code
   which handles the call forward case after the channel has been requested but before it has
   been called. This was removed because call-forwarding still works fine without it, it makes the
   code less error-prone should it need changing, and it made this set of changes much less painful
   to just have the forwarding handled in one place in each module.
3. Two new files, global_datastores.h and .c have been added. These are necessary since the datastore
   which is attached to the channel may be created and attached in either app_dial or app_queue, so they
   need a common place to find the datastore info. This approach was taken in case similar datastores are
   needed in the future, there will be a common place to add them.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 23:12:17 +00:00
Steve Murphy
1975b6e753 closes issue #11379; OK, this is an attempt to make both sides happy. To the cdr.conf file, I added the option 'unanswered', which defaults to 'no'. In this mode, you will see a cdr for a call, whether it was answered or not. The disposition will be NO ANSWER or ANSWERED, as appropriate. The src is as you'd expect, the destination channel will be one of the channels from the Dial() call, usually the last in the list if more than one chan was specified. With unanswered set to 'yes', you will still see this cdr entry in both cases. But in the case where the dial timed out, you will also see a cdr for each line attempted, marked NO ANSWER, with no destination channel name. The new option defaults to 'no', so you don't see the pesky extra cdr's by default, and you will not see the irritating 'not posted' messages.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 06:24:02 +00:00
Russell Bryant
db1ab4db58 Simplify the CAN_EARLY_BRIDGE macro a bit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 14:24:49 +00:00
Joshua Colp
e7f6101587 Only attempt early bridging if the options given to Dial() permit it.
(closes issue #10861)
Reported by: peekyb


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 13:49:36 +00:00
Jason Parker
86c32ff0ef Re-order dial options to be in line with the existing alpha order.
Issue 10621, initial patch by junky


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 18:44:44 +00:00
Mark Michelson
e4cc4ef183 Fixing an error I made earlier. ast_fileexists can return -1 on failure, so I need to be sure that we only enter the if
statement if it is successful.

Related to my fix to issue #10186



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:03:48 +00:00
Mark Michelson
402820c9e3 Restoring functionality from 1.2 wherein Retrydial will not exit if there is no announce file specified.
This change makes it so that if there is no announce file specified, the application will continue until finished (or caller hangs up).
If a bogus announce file is specified, then a warning message will be printed saying that the file could not be found, but execution will
still continue. 

(closes issue #10186, reported by jon, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 18:16:15 +00:00
Tilghman Lesher
3a215d6a50 Merged revisions 73052 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73052 | tilghman | 2007-07-03 07:34:14 -0500 (Tue, 03 Jul 2007) | 2 lines

RetryDial should accept a 0 argument, but it does not, because atoi does not distinguish between 0 and error (closes issue #10106)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-03 12:38:53 +00:00
Tilghman Lesher
badad4a542 Merged revisions 70444 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70444 | tilghman | 2007-06-20 14:25:54 -0500 (Wed, 20 Jun 2007) | 2 lines

Issue 9997 - Timelimit times out the wrong channel

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 19:29:23 +00:00
Joshua Colp
f07dfca43a Merged revisions 68070 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68070 | file | 2007-06-07 10:19:40 -0400 (Thu, 07 Jun 2007) | 2 lines

Allow the 'g' option to work if used with the 'S' option. (issue #9888 reported by gasparz)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 14:21:59 +00:00
Joshua Colp
1317920054 Initialize cidname variable to nothing since it may be used without having been touched. (issue #9661 reported by dimas)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 17:59:14 +00:00
Steve Murphy
dfee354cfa Merged revisions 65172 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65172 | murf | 2007-05-18 14:56:20 -0600 (Fri, 18 May 2007) | 1 line

This update will fix the situation that occurs as described by 9717, where when several targets are specified for a dial, if any one them reports FAIL, the whole call gets FAIL, even though others were ringing OK. I rearranged the priorities, so that a new disposition, NULL, is at the lowest level, and the disposition get init'd to NULL. Then, next up is FAIL, and next up is BUSY, then NOANSWER, then ANSWERED. All the related set routines will only do so if the disposition value to be set to is greater than what's already there. This gives the intended effect. So, if all the targets are busy, you'd get BUSY for the call disposition. If all get BUSY, but one, and that one rings is not answered, you get NOANSWER. If by some freak of nature, the NULL value doesn't get overridden, then the disp2str routine will report NOANSWER as before.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 22:06:27 +00:00
Russell Bryant
78989c792f Increase the size of a buffer to support longer dial strings for channels.
(issue #9291, reported and fix suggested by meni)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 16:47:29 +00:00
Joshua Colp
03eb572457 Merged revisions 61655 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61655 | file | 2007-04-13 15:15:12 -0400 (Fri, 13 Apr 2007) | 2 lines

Add OUTBOUND_GROUP_ONCE variable to app_dial. This behaves the same as OUTBOUND_GROUP except it will get unset after use so it won't get accidentally inherited. (issue #BE-140)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 19:17:08 +00:00
Joshua Colp
88e5a094b6 Merged revisions 60797 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60797 | file | 2007-04-08 20:59:29 -0400 (Sun, 08 Apr 2007) | 2 lines

When calling a device that then forwards us elsewhere... we have to make our channels compatible if it is the only channel being dialed. (issue #9445 reported by marcelbarbulescu)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 01:03:14 +00:00