Summary:ASTERISK-08557: [patch] performing a goto / gotoif / gotoiftime in the h extension changes the dst field of the cdr
Reporter:jmls (jmls)Labels:
Date Opened:2007-01-11 10:55:16.000-0600Date Closed:2007-05-02 16:00:49
Versions:Frequency of
Environment:Attachments:( 0) 20070416__bug8796.diff.txt
Description:Summary says it all really. If you perform a goto in the h extension, you lose the original called number


/* part 1 - this snippet keeps the original dst field */
exten => h,1,NoOp()
exten => h,n(end),NoOp()

/* part 2 - this snippet sets the dst field to 'h' */
exten => h,1,NoOp()
exten => h,n,Goto(end)
exten => h,n(end),NoOp()

/* part 3 - this snippet fixes the behaviour */
exten => h,1,NoOp()
exten => h,n,ResetCDR(w)
exten => h,n,NoCDR()
exten => h,n,Goto(end)
exten => h,n(end),NoOp()
Comments:By: jmls (jmls) 2007-01-11 10:57:55.000-0600

I think that the problem is that the ast_parseable_goto in pbx.c does a ast_cdr_update(chan), which updates the dst field. This is probably valid for normal goto extensions. However, I don't think that it's right for the "special" (h, s, i ,a , t etc) extensions ?

i.e. if it's a "special" extension then we should probably not update the cdr ?

By: jmls (jmls) 2007-02-14 13:32:29.000-0600

ping. any ideas on what's causing this ?

By: Olle Johansson (oej) 2007-02-15 11:05:52.000-0600

goto *always* change the destination of the call.

By: Steve Murphy (murf) 2007-02-23 14:43:57.000-0600

So... the real question becomes: do I really, really, want/need to modify the behavior of asterisk in this respect?  OR-- do I just mod the goto code to not update the CDR's; especially the "dest" field? Any more opinions on this, anyone?

By: Mark Dickey (cyon) 2007-04-16 13:20:40

I realize that there have been no comments on this in an extended period of time, which would indicate to me that there is a solution to the issue of wishing to retain the original "dst" as the called did.  I have been playing with some ugly gosubs returning after the call is over just to be able to execute a Goto back into a context labeled after the DID, but it's nasty.

Based on the fact that this will not be changed, is there the possibility of posting a workaround and or optimal dialplan to be able to avoid losing the called DID in the cdr?

By: Tilghman Lesher (tilghman) 2007-04-16 20:53:18

Here's a tiny patch to effect this.

By: Steve Murphy (murf) 2007-05-02 16:00:48

Put in code to prevent the dst field and the lastapp/lastdata fields from being updated while in a hung-up condition, see (1.2) 62737, (1.4) 62738, and (trunk) 62741.