public boolean SendBinaryMessage(String text,String SMSC){
  String SMSCPhoneNumber;
  String dstPhoneNumber;
  String dstSipUri=super.getToUri();
  if ((SMSCPhoneNumber=NgnUriUtils.getValidPhoneNumber(SMSC)) != null && (dstPhoneNumber=NgnUriUtils.getValidPhoneNumber(dstSipUri)) != null) {
    super.setToUri(SMSC);
    super.addHeader("Content-Type",NgnContentType.SMS_3GPP);
    super.addHeader("Content-Transfer-Encoding","binary");
    super.addCaps("+g.3gpp.smsip");
    RPMessage rpMessage;
    rpMessage=SMSEncoder.encodeSubmit(++NgnMessagingSession.SMS_MR,SMSCPhoneNumber,dstPhoneNumber,text);
    long rpMessageLen=rpMessage.getPayloadLength();
    ByteBuffer payload=ByteBuffer.allocateDirect((int)rpMessageLen);
    long payloadLength=rpMessage.getPayload(payload,(long)payload.capacity());
    boolean ret=mSession.send(payload,payloadLength);
    rpMessage.delete();
    if (NgnMessagingSession.SMS_MR >= 255) {
      NgnMessagingSession.SMS_MR=0;
    }
    return ret;
  }
 else {
    Log.e(TAG,String.format("SMSC=%s or RemoteUri=%s is invalid",SMSC,dstSipUri));
    return sendTextMessage(text);
  }
}

public boolean SendBinaryMessage ( String text , String SMSC ) { String SMSCPhoneNumber ; String dstPhoneNumber ; String dstSipUri = super . getToUri ( ) ; if ( ( SMSCPhoneNumber = NgnUriUtils . getValidPhoneNumber ( SMSC ) ) != null && ( dstPhoneNumber = NgnUriUtils . getValidPhoneNumber ( dstSipUri ) ) != null ) { super . setToUri ( SMSC ) ; super . addHeader ( "Content-Type" , NgnContentType . SMS_3GPP ) ; super . addHeader ( "Content-Transfer-Encoding" , "binary" ) ; super . addCaps ( "+g.3gpp.smsip" ) ; RPMessage rpMessage ; rpMessage = SMSEncoder . encodeSubmit ( ++ NgnMessagingSession . SMS_MR , SMSCPhoneNumber , dstPhoneNumber , text ) ; long rpMessageLen = rpMessage . getPayloadLength ( ) ; ByteBuffer payload = ByteBuffer . allocateDirect ( ( int ) rpMessageLen ) ; long payloadLength = rpMessage . getPayload ( payload , ( long ) payload . capacity ( ) ) ; boolean ret = mSession . send ( payload , payloadLength ) ; rpMessage . delete ( ) ; if ( NgnMessagingSession . SMS_MR >= 255 ) { NgnMessagingSession . SMS_MR = 0 ; } return ret ; } else { Log . e ( TAG , String . format ( "SMSC=%s or RemoteUri=%s is invalid" , SMSC , dstSipUri ) ) ; return sendTextMessage ( text ) ; } }
sends binary sms ( 3gpp ) using sip message request
