### Description
ACC module [cdr_extra modparam](http://kamailio.org/docs/modules/devel/modules/acc.html#acc.p.cdr_extra) allows saving additional custom values in cdr entries using dlg_vars.
When you define a new value to be saved:
`modparam("acc", "cdr_extra", "c1=$dlg_var(caller)")`
and you set a $dlg_var(c1) in the logic, everything works as expected.
But if you set it to $null or you don't even define it, it is saved as '' (empty string).
Would be nice that setting to $null would store the underlying null value (NULL in SQL database) and not defining it would lead to not even including it in the final INSERT?
### Troubleshooting
#### Reproduction
Define a new value to be saved:
`modparam("acc", "cdr_extra", "c1=$dlg_var(caller)")`
And in the kamailio.cfg logic:
- If you set $dlg_var(c1) to any string ('', 'foo', '2'), it is saved as expected ('', 'foo', '2').
- If you set $dlg_var(c1) to an integer different from 0 (1, 2, 3), it is saved as a string containing that number ('1', '2', '3'). This seems normal as dlg_vars can only store strings.
- If you set $dlg_var(c1) to 0, it is saved as an empty string (''). Seems normal too.
- If you set $dlg_var(c1) to $null, it is saved as an empty string ('').
- If you don't define $dlg_var(c1) at all, it is saved as an empty string ('').
#### Debugging Data
Both [_extra2strar_](https://github.com/kamailio/kamailio/blob/e101f21c37238862a474c50218d11a475d...) and [_extra2strar_dlg_only_](https://github.com/kamailio/kamailio/blob/e101f21c37238862a474c50218d11a475d...) functions defined in [_acc_extra.c_](https://github.com/kamailio/kamailio/blob/master/src/modules/acc/acc_extra.c) set _cdr_type_array_ entry to TYPE_NULL, but that array is not used in subsequent [for loop](https://github.com/kamailio/kamailio/blob/e101f21c37238862a474c50218d11a475d...).
### Possible Solutions
Modify the logic in the [for loop](https://github.com/kamailio/kamailio/blob/e101f21c37238862a474c50218d11a475d...) so that it invokes VAL_NULL macro for null values using _cdr_type_array_.
With this change both $null values and undefined values would use underlying NULL value. I could try to make further changes to avoid the key in the insert for undefined values instead of setting it to NULL.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
``` version: kamailio 4.4.6 (x86_64/linux) 0a8379-dirty flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: 0a8379 -dirty compiled on 12:23:36 Dec 20 2017 with gcc 6.3.0
```
* **Operating System**:
``` Linux 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux ```
Is there any reason I missed for not doing this change ([this comment](https://github.com/kamailio/kamailio/blob/e101f21c37238862a474c50218d11a475d...) makes me think so)? If not, I can try to provide a PR with these changes.
Regards,
The comment suggests that setting it to empty string was done on purpose, based on the needs/evaluation of the developer, could be due to similar approach on other parts of the acc module.
If you want to have it with null, you can make a pull request with this behaviour controlled via a modparam, allowing the old approach as well as what you need. In this way it is easier to accept it, knowing that people can choose based on what they need.
PR related to this was merged.
Closed #1378.