Ejemplo n.º 1
0
 @Override
 public void setUrl(String url) {
   super.setUrl(url);
   // Make the URL the service name if not already set
   if (StringUtil.isEmpty(oaProvider.getServiceName())) {
     oaProvider.setServiceName(url);
   }
 }
Ejemplo n.º 2
0
 @PostConstruct
 public void init() {
   monitoringService = (ActorRef) context.getAttribute(MonitoringService.class.getName());
   configuration = (Configuration) context.getAttribute(Configuration.class.getName());
   configuration = configuration.subset("runtime-settings");
   daos = (DaoManager) context.getAttribute(DaoManager.class.getName());
   super.init(configuration);
   CallinfoConverter converter = new CallinfoConverter(configuration);
   MonitoringServiceConverter listConverter = new MonitoringServiceConverter(configuration);
   builder = new GsonBuilder();
   builder.registerTypeAdapter(CallInfo.class, converter);
   builder.registerTypeAdapter(MonitoringServiceResponse.class, listConverter);
   builder.setPrettyPrinting();
   gson = builder.create();
   xstream = new XStream();
   xstream.alias("RestcommResponse", RestCommResponse.class);
   xstream.registerConverter(converter);
   xstream.registerConverter(listConverter);
   xstream.registerConverter(new RestCommResponseConverter(configuration));
 }
Ejemplo n.º 3
0
 @Override
 public void checkValid() throws SBTException {
   super.checkValid();
   if (StringUtil.isEmpty(oaProvider.getConsumerKey())) {
     throw new SBTException(null, "The Endpoint consumer key is empty, class {0}", getClass());
   }
   if (StringUtil.isEmpty(oaProvider.getConsumerSecret())) {
     throw new SBTException(null, "The Endpoint consumer secret is empty, class {0}", getClass());
   }
   if (StringUtil.isEmpty(oaProvider.getAuthorizationURL())) {
     throw new SBTException(
         null, "The Endpoint authorization URL is empty, class {0}", getClass());
   }
   if (StringUtil.isEmpty(oaProvider.getRequestTokenURL())) {
     throw new SBTException(
         null, "The Endpoint request token URL is empty, class {0}", getClass());
   }
   if (StringUtil.isEmpty(oaProvider.getAccessTokenURL())) {
     throw new SBTException(null, "The Endpoint access token URL is empty, class {0}", getClass());
   }
 }
Ejemplo n.º 4
0
  @PostConstruct
  public void init() {
    configuration = (Configuration) context.getAttribute(Configuration.class.getName());
    configuration = configuration.subset("runtime-settings");
    callManager =
        (ActorRef) context.getAttribute("org.mobicents.servlet.restcomm.telephony.CallManager");
    daos = (DaoManager) context.getAttribute(DaoManager.class.getName());
    super.init(configuration);
    CallDetailRecordConverter converter = new CallDetailRecordConverter(configuration);
    listConverter = new CallDetailRecordListConverter(configuration);
    builder = new GsonBuilder();
    builder.registerTypeAdapter(CallDetailRecord.class, converter);
    builder.registerTypeAdapter(CallDetailRecordList.class, listConverter);
    builder.setPrettyPrinting();
    gson = builder.create();
    xstream = new XStream();
    xstream.alias("RestcommResponse", RestCommResponse.class);
    xstream.registerConverter(converter);
    xstream.registerConverter(new RestCommResponseConverter(configuration));
    xstream.registerConverter(listConverter);

    normalizePhoneNumbers = configuration.getBoolean("normalize-numbers-for-outbound-calls");
  }
 /**
  * Returns environment.
  *
  * @return the environment
  */
 protected CoreEnvironment env() {
   return endpoint.environment();
 }
 @Override
 public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
   LOGGER.debug(logIdent(ctx, endpoint) + "Channel Inactive.");
   endpoint.notifyChannelInactive();
   ctx.fireChannelInactive();
 }
 /**
  * Notify that decoding is finished. This needs to be called by the child handlers in order to
  * signal that operations are done.
  */
 protected void finishedDecoding() {
   this.currentDecodingState = DecodingState.FINISHED;
   if (isTransient) {
     endpoint.disconnect();
   }
 }