;###########################################################################
;# Handle Hangup
;# This macro attempts to go through and do something intelligent
;# with the HANGUPCAUSE and DIALSTATUS
;###########################################################################
macro handle-hangup() {
NoOp(HANGUPCAUSE is ${HANGUPCAUSE} and DIALSTATUS is ${DIALSTATUS});
if(${HANGUPCAUSE} = 0) {
switch(${DIALSTATUS}) {
case ANSWER:
NoOp(${HANGUPCAUSE} - Normal Clearing);
Hangup;
break;
case BUSY:
NoOp(${HANGUPCAUSE} - User Busy);
Busy;
break;
case NOANSWER:
NoOp(${HANGUPCAUSE} - No Answer);
Hangup;
break;
case CONGESTION:
NoOp(${HANGUPCAUSE} - Switch Congestion);
Congestion;
break;
case CHANUNAVAIL:
NoOp(${HANGUPCAUSE} - Requested Channel Unavailable);
Congestion;
break;
default:
NoOp(${HANGUPCAUSE} - Not Defined);
Congestion;
break;
};
} else
//-- do the hangup causes
};