[asterisk-users] How to overwrite CDR(dst) value in h priority?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Jan 19 11:18:43 CST 2009


On Monday 19 January 2009 09:34:43 am Zeeshan Zakaria wrote:
> The reason why I introduced h priority here is that I needed to get the
> variable CDR(duration) for DeadAGI script which I am also running in h
> priority. Without h priority, I was getting correct CDR(dst) value but not
> correct CDR(duration) value even if I tried to run DeadAGI after Hangup().
>
> Current situation is that I have to sacrifise either on CDR(duration) or on
> CDR(dst) for the same call. But I am sure there must be a way to get this
> information because afterall asterisk has this information and it writes it
> in the CDR after call completion. And I also need these two variables after
> a call is hungup so I can do something with them in my AGI acript.
>
> Any idea how can this be done?

If you're using the cdr_adaptive_odbc backport (for 1.4), you can work
around this limitation by using aliases:

cdr_adaptive_odbc.conf:
[first]
dsn=mysql1
alias dst => does_not_exist
alias realdst => dst

extensions.conf:
exten => _X.,1,Set(CDR(realdst)=${EXTEN})
...

If you're using 1.6, there isn't a problem, because CDR(duration) will never
return zero except during the first half second of a call.

-- 
Tilghman



More information about the asterisk-users mailing list