Zeeshan Zakaria
2009-Jul-13 06:56 UTC
[asterisk-users] How to Change size of CDR(accountcode) variable?
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? -- Zeeshan A Zakaria -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090713/ea9189e6/attachment.htm
Alex Balashov
2009-Jul-13 07:58 UTC
[asterisk-users] How to Change size of CDR(accountcode) variable?
Zeeshan Zakaria wrote:> 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?You will have to go in the source code and change it. Go into asterisk-x.y.zz.?/include/asterisk/cdr.h: #define AST_MAX_ACCOUNT_CODE 20 Then recompile the entire source tree. If you didn't install from source, you're out of luck. If you don't want to modify the source, you're out of luck. -- Alex -- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671
Benny Amorsen
2009-Jul-13 22:01 UTC
[asterisk-users] How to Change size of CDR(accountcode) variable?
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