Buggy code:
} if ( ( ( isNullOrEmpty ( addressMap ) ) && ( isNullOrEmpty ( addressCcMap ) ) ) && ( isNullOrEmpty ( addressBccMap ) ) ) { resultSessionMap . put ( "Error" , "No<seq2seq4repair_space>addresses<seq2seq4repair_space>given<seq2seq4repair_space>to<seq2seq4repair_space>communicate" ) ; return resultSessionMap ; } DialogAgent . log . info ( String . format ( "accountId:<seq2seq4repair_space>%s<seq2seq4repair_space>bearer<seq2seq4repair_space>%s<seq2seq4repair_space>adapterType<seq2seq4repair_space>%s" , accountId , bearerToken , adapterType ) ) ; if ( ( Settings . KEYSERVER ) != null ) { if ( ! ( KeyServerLib . checkAccount ( accountId , bearerToken ) ) ) { throw new JSONRPCException ( CODE . INVALID_REQUEST , "Invalid<seq2seq4repair_space>token<seq2seq4repair_space>given" ) ; } } DialogAgent . log . info ( "KeyServer<seq2seq4repair_space>says<seq2seq4repair_space>ok!" ) ; DialogAgent . log . info ( "Trying<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>config" ) ; AdapterConfig config = null ; if ( adapterID != null ) { config = AdapterConfig . getAdapterConfig ( adapterID ) ; } else { adapterType = ( ( adapterType != null ) && ( ( AdapterType . getByValue ( adapterType ) ) != null ) ) ? AdapterType . getByValue ( adapterType ) . getName ( ) : adapterType ; final List < AdapterConfig > adapterConfigs = AdapterConfig . findAdapters ( adapterType , null , null ) ; for ( AdapterConfig cfg : adapterConfigs ) { if ( ( AdapterConfig . checkIfAdapterMatchesForAccountId ( Arrays . asList ( accountId ) , cfg , false ) ) != null ) { config = cfg ; break ; } } } if ( config != null ) { if ( ( AdapterConfig . checkIfAdapterMatchesForAccountId ( Arrays . asList ( accountId ) , config , false ) ) == null ) { throw new JSONRPCException ( "You<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>this<seq2seq4repair_space>adapter!" ) ; } DialogAgent . log . info ( String . format ( "Config<seq2seq4repair_space>found:<seq2seq4repair_space>%s<seq2seq4repair_space>of<seq2seq4repair_space>Type:<seq2seq4repair_space>%s<seq2seq4repair_space>with<seq2seq4repair_space>address:<seq2seq4repair_space>%s" , config . getConfigId ( ) , config . getAdapterType ( ) , config . getMyAddress ( ) ) ) ; adapterType = config . getAdapterType ( ) ; try { DialogAgent . log . info ( String . format ( "recepients<seq2seq4repair_space>of<seq2seq4repair_space>question<seq2seq4repair_space>at:<seq2seq4repair_space>%s<seq2seq4repair_space>are:<seq2seq4repair_space>%s" , url , ServerUtils . serialize ( addressMap ) ) ) ; DialogAgent . log . info ( String . format ( "cc<seq2seq4repair_space>recepients<seq2seq4repair_space>are:<seq2seq4repair_space>%s" , ServerUtils . serialize ( addressCcMap ) ) ) ; DialogAgent . log . info ( String . format ( "bcc<seq2seq4repair_space>recepients<seq2seq4repair_space>are:<seq2seq4repair_space>%s" , ServerUtils . serialize ( addressBccMap ) ) ) ; if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_XMPP ) ) { resultSessionMap = new XMPPServlet ( ) . startDialog ( addressMap , addressCcMap , addressBccMap , url , senderName , subject , config , accountId ) ; } else if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_BROADSOFT ) ) { if ( ! ( addressMap . keySet ( ) . isEmpty ( ) ) ) { resultSessionMap = VoiceXMLRESTProxy . dial ( addressMap , url , config , accountId ) ; } else { throw new Exception ( "Address<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>empty<seq2seq4repair_space>to<seq2seq4repair_space>setup<seq2seq4repair_space>a<seq2seq4repair_space>call" ) ; } } else if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_TWILIO ) ) { if ( ( ! ( addressMap . keySet ( ) . isEmpty ( ) ) ) && ( ( getApplicationId ( ) ) != null ) ) { resultSessionMap = TwilioAdapter . dial ( addressMap , url , config , accountId , getApplicationId ( ) ) ; } else { throw new Exception ( "Address<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>empty<seq2seq4repair_space>to<seq2seq4repair_space>setup<seq2seq4repair_space>a<seq2seq4repair_space>call" ) ; } } else if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_EMAIL ) ) { resultSessionMap = new MailServlet ( ) . startDialog ( addressMap , addressCcMap , addressBccMap , url , senderName , subject , config , accountId ) ; } else if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_SMS ) ) { resultSessionMap = new MBSmsServlet ( ) . startDialog ( addressMap , null , null , url , senderName , subject , config , accountId ) ; } else if ( adapterType . equalsIgnoreCase ( "CM" ) ) { resultSessionMap = new CMSmsServlet ( ) . startDialog ( addressMap , null , null , url , senderName , subject , config , accountId ) ; } else <START_BUG> if ( adapterType . equalsIgnoreCase ( "RouteSMS" ) ) { <END_BUG> resultSessionMap = new RouteSmsServlet ( ) . startDialog ( addressMap , null , null , url , senderName , subject , config , accountId ) ; } else if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_USSD ) ) { resultSessionMap = new CLXUSSDServlet ( ) . startDialog ( addressMap , null , null , url , senderName , subject , config , accountId ) ; } else if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_PUSH ) ) { resultSessionMap = new NotificareServlet ( ) . startDialog ( addressMap , null , null , url , senderName , subject , config , accountId ) ; } else if ( adapterType . equalsIgnoreCase ( ADAPTER_TYPE_TWITTER ) ) { HashMap < String , String > formattedTwitterAddresses = new HashMap < String , String > ( addressMap . size ( ) ) ; for ( String address : addressMap . keySet ( ) ) { String formattedTwitterAddress = ( address . startsWith ( "@" ) ) ? address : "@" + address ; formattedTwitterAddresses . put ( formattedTwitterAddress , addressMap . get ( address ) ) ; } resultSessionMap = new TwitterServlet ( ) . startDialog ( formattedTwitterAddresses , null , null , url , senderName , subject , config , accountId ) ; } else { throw new Exception ( ( "Unknown<seq2seq4repair_space>type<seq2seq4repair_space>given:<seq2seq4repair_space>either<seq2seq4repair_space>broadsoft<seq2seq4repair_space>or<seq2seq4repair_space>phone<seq2seq4repair_space>or<seq2seq4repair_space>mail:" + ( adapterType . toUpperCase ( ) ) ) ) ; } } catch ( Exception e ) { JSONRPCException jse = new JSONRPCException ( CODE . REMOTE_EXCEPTION , "Failed<seq2seq4repair_space>to<seq2seq4repair_space>call<seq2seq4repair_space>out!" , e ) ; DialogAgent . log . log ( Level . WARNING , "OutboundCallWithMap,<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>call<seq2seq4repair_space>out!" , e ) ; throw jse ; } } else { throw new JSONRPCException ( ( "Invalid<seq2seq4repair_space>adapter.<seq2seq4repair_space>We<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>adapter<seq2seq4repair_space>of<seq2seq4repair_space>" + ( adapterID != null ? "adapterId:<seq2seq4repair_space>" + adapterID : "type:<seq2seq4repair_space>" + adapterType ) ) ) ; } return resultSessionMap ;

Fix:
if ( ROUTE_SMS . equals ( AdapterType . getByValue ( adapterType ) ) ) {