Summary:ASTERISK-03309: [patch] RetryDial fix
Reporter:Anthony Minessale (anthm)Labels:
Date Opened:2005-01-19 14:38:01.000-0600Date Closed:2008-01-15 15:22:39.000-0600
Versions:Frequency of
Environment:Attachments:( 0) retryfix_rev0.diff
Description:The patch I added had some modifications made that broke it a little.  This patch corrects the issue.

Without this patch, the application will never let you dial an exit extension as advertised.  You can now disable the ability to exit to a 1 digit extension by setting EXITCONTEXT=disabled this will take precedence over the d flag in app_dial as well.


Disclaimer on file.
Comments:By: Mark Spencer (markster) 2005-01-19 21:33:04.000-0600

Why does there need to be a "disabled" setting???  Doesn't not putting the "d" flag disable it?

By: Anthony Minessale (anthm) 2005-01-20 08:58:32.000-0600


RetryDial by itself originally was meant to always let you dial an exit extension.  You suggested i make it possible to do the same in app_dial so I added that too with d.  But by design even if d is taken away from the app_dial portion of the args the retrydial would still let you cancel between attempts, The mod you made when you added the patch attempts to check peerflags in retrydial_exec that is guarenteed to be 0 because it is never touched in order for retrydial_exec to enforce d in the app_dial args, it would have to fully parse all the app_dial args and weed out all the X() A() etc to finally decide if it should enforce d or not.  So the way it is now in CVS, retrydual_exec tests for DIAL_HALT_ON_DTMF to decide if it will let you dial an exit extension between attempts yet this value is guarenteed to be 0 because the flags are not even tocuhed so the else always comes true, furthermore, the else does not contain code to activate the moh while you are waiting which is fixed in this patch too....

By design retrydial_exec does not molest the args intended for dial_exec it just seperates and hands them off I'd appriciate if we can get this fixed though because as it stands in CVS it's broken.

The code to bring up a call is duplicated in 100 places and different every time so I'll mention again down the road I think the features in app_dial may want to be extracted so app_dial has less responsibility in favor of some high level api call like:

I know some people will pounce on the chance to criticize my example so beware this example took me 3 min to come up with and I would not give it a second more of my time unless I got some indication it was the right direction.

ast_app_call_destination(struct ast_channel *chan, struct ast_call_config *call_config);

struct ast_call_config {
struct ast_flags flags;
struct bridge_config *bridge_config;
char chan_list[80][25]; // or whatever limit simo chans


In these 2 scenereos, music plays betweeen retries and ringing plays
during attempts to call the channel.

call Zap/1 for 20 sec at a time waiting 10 sec between tries allowing
an exit exten to be dialed at any time.

call Zap/1 for 20 sec at a time waiting 10 sec between tries allowing
an exit exten to be dialed only when the music is playing

This scenereo plays music throughout due to 'm' in the dial args

call Zap/1 for 20 sec at a time waiting 10 sec between tries allowing
an exit exten to be dialed at any time.

By: Mark Spencer (markster) 2005-01-20 16:57:08.000-0600

Fixed in CVS properly as per phone conference with anthm

By: Digium Subversion (svnbot) 2008-01-15 15:22:39.000-0600

Repository: asterisk
Revision: 4855

U   trunk/apps/app_dial.c

r4855 | markster | 2008-01-15 15:22:38 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix typos (bug ASTERISK-3309)