I dont know it will work or not but what i understand your problem.
if you are not available.
Code:
public class PhoneCallInterceptor extends AbstractPhoneListener {
public void callIncoming(final int callId) {
final PhoneCall call = Phone.getCall(callId);
final String number = call.getPhoneNumber();
//now you get the callers number just send sms to this number
}
and you have to and call through your code.
Code:
EventInjector.KeyCodeEvent pressEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_DOWN,( char)Keypad.KEY_END,0,100);
EventInjector.KeyCodeEvent releaseEndKey=new EventInjector.KeyCodeEvent(KeyCodeEvent.KEY_UP,(ch ar)Keypad.KEY_END,0,100);
Thread.sleep(1000);
EventInjector.invokeEvent(pressEndKey);
EventInjector.invokeEvent(releaseEndKey);