1 – We need to include a column in table cdr to asterisk include the number of line that answer the call.
2 – Before asterisk send the log to table cdr, asterisk must check if the user can access the system on this weekday at this time. If the user is not allowed to access the system at that time, it is because he should type a password and if the password is correct, asterisk send the log to table cdr.