#include <asterisk/module.h>
#include <asterisk/translate.h>
#include <asterisk/ulaw.h>
+#include <asterisk/utils.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
}
strncpy(chan->exten, exten, sizeof(chan->exten) - 1);
strncpy(chan->context, ourcontext, sizeof(chan->context) - 1);
- strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1);
+ if (!ast_strlen_zero(acctcode))
+ strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1);
chan->priority = 0;
ast_cdr_init(chan->cdr,chan);
LOCAL_USER_REMOVE(u);