--- func_cdr.bak 2012-05-10 11:57:26.000000000 -0400 +++ func_cdr.c 2013-05-23 01:11:03.292741727 -0400 @@ -135,8 +135,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi All of the CDR field names are read-only, except for accountcode, - userfield, and amaflags. You may, however, supply - a name not on the above list, and create your own variable, whose value can be changed + peeraccpimt, userfield, amaflags, + and dstchannel if it is currently empty. + You may, however, supply a name not on the above list, and create your own variable, whose value can be changed with this function, and this variable will be stored on the cdr. For setting CDR values, the l flag does not apply to setting the accountcode, userfield, or @@ -302,6 +303,8 @@ static int cdr_write(struct ast_channel ast_cdr_setuserfield(chan, value); else if (!strcasecmp(args.variable, "amaflags")) ast_cdr_setamaflags(chan, value); + else if (!strcasecmp(args.variable, "dstchannel") && ast_strlen_zero(cdr->dstchannel)) + ast_cdr_setdestchan(cdr, value); else ast_cdr_setvar(cdr, args.variable, value, ast_test_flag(&flags, OPT_RECURSIVE)); /* No need to worry about the u flag, as all fields for which setting