All pastes #22425 Raw Edit

Mine

public text v1 · immutable
#22425 ·published 2005-09-09 01:56 UTC
rendered paste body
;###########################################################################
;# 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

};