public void onMessageEvent(javax.sip.RequestEvent event,
			ActivityContextInterface aci) {

		final Request request = event.getRequest();
		try {
			// message body should be *FIRST_TOKEN<timer value in
			// seconds>MIDDLE_TOKEN<msg to send back to UA>LAST_TOKEN*
			final String body = new String(request.getRawContent());
			final int firstTokenStart = body.indexOf(FIRST_TOKEN);
			final int timerDurationStart = firstTokenStart + FIRST_TOKEN_LENGTH;
			final int middleTokenStart = body.indexOf(MIDDLE_TOKEN,
					timerDurationStart);
			final int bodyMessageStart = middleTokenStart + MIDDLE_TOKEN_LENGTH;
			final int lastTokenStart = body.indexOf(LAST_TOKEN,
					bodyMessageStart);
			if (firstTokenStart > -1 && middleTokenStart > -1
					&& lastTokenStart > -1) {
				// extract the timer duration
				final int timerDuration = Integer.parseInt(body.substring(
						timerDurationStart, middleTokenStart));
				// create a null AC and attach the sbb local object
				final ActivityContextInterface timerACI = this.nullACIFactory
						.getActivityContextInterface(this.nullActivityFactory
								.createNullActivity());
				timerACI.attach(sbbContext.getSbbLocalObject());
				// set the timer on the null AC, because the one from this event
				// will end as soon as we send back the 200 ok
				this.timerFacility.setTimer(timerACI, null, System
						.currentTimeMillis()
						+ (timerDuration * 1000), new TimerOptions());
				// extract the body message
				final String bodyMessage = body.substring(bodyMessageStart,
						lastTokenStart);
				// store it in a cmp field
				setBody(bodyMessage);
				// do the same for the call id
				setCallId((CallIdHeader) request.getHeader(CallIdHeader.NAME));
				// also store the sender's address, so we can send the wake up
				// message
				final FromHeader fromHeader = (FromHeader) request
						.getHeader(FromHeader.NAME);
				if (tracer.isInfoEnabled()) {
					tracer.info("Received a valid message from "
							+ fromHeader.getAddress()
							+ " requesting a reply containing '" + bodyMessage
							+ "' after " + timerDuration + "s");
				}
				setSender(fromHeader.getAddress());
				// finally reply to the SIP message request
				sendResponse(event, Response.OK);
			} else {
				// parsing failed
				tracer.warning("Invalid msg '" + body + "' received");
				sendResponse(event, Response.BAD_REQUEST);
			}
		} catch (Throwable e) {
			// oh oh something wrong happened
			tracer.severe("Exception while processing MESSAGE", e);
			try {
				sendResponse(event, Response.SERVER_INTERNAL_ERROR);
			} catch (Exception f) {
				tracer.severe("Exception while sending SERVER INTERNAL ERROR",
						f);
			}
		}
	}
public void onMessageEvent ( javax . sip . RequestEvent event , ActivityContextInterface aci ) { final Request request = event . getRequest ( ) ; try { final String body = new String ( request . getRawContent ( ) ) ; final int firstTokenStart = body . indexOf ( FIRST_TOKEN ) ; final int timerDurationStart = firstTokenStart + FIRST_TOKEN_LENGTH ; final int middleTokenStart = body . indexOf ( MIDDLE_TOKEN , timerDurationStart ) ; final int bodyMessageStart = middleTokenStart + MIDDLE_TOKEN_LENGTH ; final int lastTokenStart = body . indexOf ( LAST_TOKEN , bodyMessageStart ) ; if ( firstTokenStart > - 1 && middleTokenStart > - 1 && lastTokenStart > - 1 ) { final int timerDuration = Integer . parseInt ( body . substring ( timerDurationStart , middleTokenStart ) ) ; final ActivityContextInterface timerACI = this . nullACIFactory . getActivityContextInterface ( this . nullActivityFactory . createNullActivity ( ) ) ; timerACI . attach ( sbbContext . getSbbLocalObject ( ) ) ; this . timerFacility . setTimer ( timerACI , null , System . currentTimeMillis ( ) + ( timerDuration * 1000 ) , new TimerOptions ( ) ) ; final String bodyMessage = body . substring ( bodyMessageStart , lastTokenStart ) ; setBody ( bodyMessage ) ; setCallId ( ( CallIdHeader ) request . getHeader ( CallIdHeader . NAME ) ) ; final FromHeader fromHeader = ( FromHeader ) request . getHeader ( FromHeader . NAME ) ; if ( tracer . isInfoEnabled ( ) ) { tracer . info ( "Received a valid message from " + fromHeader . getAddress ( ) + " requesting a reply containing '" + bodyMessage + "' after " + timerDuration + "s" ) ; } setSender ( fromHeader . getAddress ( ) ) ; sendResponse ( event , Response . OK ) ; } else { tracer . warning ( "Invalid msg '" + body + "' received" ) ; sendResponse ( event , Response . BAD_REQUEST ) ; } } catch ( Throwable e ) { tracer . severe ( "Exception while processing MESSAGE" , e ) ; try { sendResponse ( event , Response . SERVER_INTERNAL_ERROR ) ; } catch ( Exception f ) { tracer . severe ( "Exception while sending SERVER INTERNAL ERROR" , f ) ; } } }
Event handler for the SIP MESSAGE from the UA

@param event
@param aci