[asterisk-users] How to Change size of CDR(accountcode) variable?

Benny Amorsen benny+usenet at amorsen.dk
Mon Jul 13 17:01:29 CDT 2009


Zeeshan Zakaria <zishanov at gmail.com> writes:

> I've just found out that CDR(accountcode) variable can only be 20
> characters long, doesn't matter what size the MySQL column has for it.
>
> I need to increase it to at least 30 characters. Any idea how this can be
> accomplished?

As others have said, that requires recompilation, which is a pain.

However, there is another way, in sip.conf:

[foo]
accountcode=foo
setvar=FANCYLONGACCOUNTCODE=foo

Then in the dialplan:

exten => _X!,1,Set(CDR(fancylongaccountcode)=${FANCYLONGACCOUNTCODE})

Now you just need to set up cdr_adaptive_odbc to map
CDR(fancylongaccountcode) to accountcode in the database, or
alternatively use a database view to accomplish that.

I haven't tested it, but it should work.

Even better would be:

[foo]
accountcode=foo
setvar=CDR(fancylongaccountcode)=foo

but I'm not sure whether that works.

Last concern: Does setvar work even for transfers, like accountcode
does?


/Benny




More information about the asterisk-users mailing list