0

Aterisk 13. Customized diplane. Calls are working, CDR is written.

But I need to add my own title to the CDR during the call.

Example extensions.conf:

exten => _1XX, n, SIPAddHeader (Test-header: 123) exten => _4XX, n, Set (CDR (Test column) = $ {SIP_HEADER (Test-header)})

Console output:

  • Executing [6001 @ test: 2] SIPAddHeader ("SIP / 100-00000000", "Test-header: 123") in new stack - Executing [6001 @ test: 2] Set ("SIP / 100-00000000" CDR (Test-header) = ") in new stack

Why is the value of the header not transmitted? And is it possible to do this at all? P.S. The column Test-header in the database is

zero323
  • 322,348
  • 103
  • 959
  • 935

2 Answers2

1

The userfield solution should work, but if you need more than one column, the CDR MySQL backend supports custom columns. In cdr_mysql.conf, create this section:

[columns]
alias testcolumn => testcolumn

And in your dialplan:

Set(CDR(testcolumn)=${SIP_HEADER(Test-header)})

Asterisk will not create this column in the CDR table, you have to ALTER it:

ALTER TABLE cdr ADD COLUMN testcolumn VARCHAR(255) DEFAULT NULL;
viktike
  • 717
  • 4
  • 7
0

You have CDR(userfield) value

Custom cdr field work only on some drivers(seams like only in res_mysql) and only if column present in db at asterisk start.

arheops
  • 15,544
  • 1
  • 21
  • 27