Package org.mobicents.mscontrol

Examples of org.mobicents.mscontrol.MsSignalGenerator


    if (getSameUser()) {

      log.debug("same user, lets play the voice mail");
      System.out.println("same user, lets play the voice mail");

      MsSignalGenerator generator = msProvider
          .getSignalGenerator(endpointName);

      try {
        ActivityContextInterface generatorActivity = msActivityFactory
            .getActivityContextInterface(generator);
        generatorActivity.attach(this.getSbbLocalObject());

        URL audioFileURL = getClass().getResource(waitingDTMF);

        generator.apply(Announcement.PLAY, new String[] { audioFileURL
            .toString() });

        this.initDtmfDetector(evt.getConnection(), endpointName);

      } catch (UnrecognizedActivityException e) {
        e.printStackTrace();
      }

    } else {
      log.debug("not the same user, start recording after announcement");
      System.out
          .println("not the same user, start recording after announcement");

      URL audioFileURL = getClass().getResource(recordAfterTone);

      ToHeader toHeader = (ToHeader) request.getHeader(ToHeader.NAME);
      String fileName = ((SipURI) toHeader.getAddress().getURI())
          .getUser()
          + WAV_EXT;
      String route = null;
      String recordFilePath = null;

      try {
        Context initCtx = new InitialContext();
        Context myEnv = (Context) initCtx.lookup("java:comp/env");

        route = (String) myEnv.lookup("filesRoute");
      } catch (NamingException nEx) {
        log.warn("Lookup of filesRoute env Variable failed", nEx);
      }

      if (route != null) {
        recordFilePath = route + fileName;
      } else {
        recordFilePath = fileName;
      }

      String[] params = new String[2];
      params[0] = audioFileURL.toString();
      params[1] = recordFilePath;

      MsSignalGenerator signalGenerator = msProvider
          .getSignalGenerator(endpointName);

      try {
        ActivityContextInterface dtmfAci = msActivityFactory
            .getActivityContextInterface(signalGenerator);
        dtmfAci.attach(this.getSbbLocalObject());
        signalGenerator.apply(AU.PLAY_RECORD, params);
      } catch (UnrecognizedActivityException e) {
        log.error(e.getMessage(), e);
      }
    }
View Full Code Here


    } else {
      audioFileURL = getClass().getResource(tryAgain);
    }

    MsSignalGenerator generator = msProvider.getSignalGenerator(this
        .getUserEndpoint());

    try {
      ActivityContextInterface generatorActivity = msActivityFactory
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      generator.apply(Announcement.PLAY, new String[] { audioFileURL
          .toString() });

      // this.initDtmfDetector(getConnection(), this.getEndpointName());
    } catch (UnrecognizedActivityException e) {
      e.printStackTrace();
View Full Code Here

        }
    }

    public void playNext() {
        String url = (String) this.getSequence().get(this.getIndex());
        MsSignalGenerator generator = msProvider.getSignalGenerator(getAnnouncementEndpoint());
        try {
            ActivityContextInterface generatorActivity = mediaAcif.getActivityContextInterface(generator);
            generatorActivity.attach(sbbContext.getSbbLocalObject());
            generator.apply(Announcement.PLAY, new String[]{url});
            this.setIndex(getIndex() + 1);
        } catch (UnrecognizedActivityException e) {
        }
    }
View Full Code Here

      break;
    }
    this.setSendBye(successful);

    MsSignalGenerator generator = msProvider.getSignalGenerator(this
        .getAnnouncementEndpointName());

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      generator.apply(Announcement.PLAY, new String[] { audioFile });

      // this.initDtmfDetector(getConnection(), this.getEndpointName());
    } catch (UnrecognizedActivityException e) {
      e.printStackTrace();
    }
View Full Code Here

    endpointName = this.getEndpointName();

    logger.info("endpoint name: " + endpointName);
    logger.info("Announcement endpoint: " + announcementEndpoint);

    MsSignalGenerator generator = msProvider
        .getSignalGenerator(announcementEndpoint);

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      String announcementFile = "file:" + audioFilePath;
      generator.apply(Announcement.PLAY,
          new String[] { announcementFile });

      this.initDtmfDetector(getConnection(), endpointName);

    } catch (UnrecognizedActivityException e) {
View Full Code Here

      this.setAudioFile(reConfirm);
      break;
    }
    this.setSendBye(successful);

    MsSignalGenerator generator = msProvider.getSignalGenerator(this
        .getAnnouncementEndpointName());

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      String announcementFile = "file:" + this.getAudioFile();
      generator.apply(Announcement.PLAY,
          new String[] { announcementFile });

      // this.initDtmfDetector(getConnection(), this.getEndpointName());
    } catch (UnrecognizedActivityException e) {
      e.printStackTrace();
View Full Code Here

    endpointName = this.getEndpointName();

    logger.info("endpoint name: " + endpointName);
    logger.info("Announcement endpoint: " + announcementEndpoint);

    MsSignalGenerator generator = msProvider
        .getSignalGenerator(announcementEndpoint);

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      String announcementFile = "file:" + this.getAudioFile();
      generator.apply(Announcement.PLAY,
          new String[] { announcementFile });

      this.initDtmfDetector(getConnection(), endpointName);

    } catch (UnrecognizedActivityException e) {
View Full Code Here

    String endpointName = link.getEndpoints()[0];
    logger.info("endpoint name: " + endpointName);
    logger.info("Announcement endpoint: " + announcementEndpoint);

    MsSignalGenerator generator = msProvider
        .getSignalGenerator(announcementEndpoint);

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      String announcementFile = "file:" + audioFilePath;
      generator.apply(Announcement.PLAY,
          new String[] { announcementFile });

    } catch (UnrecognizedActivityException e) {
      e.printStackTrace();
    }
View Full Code Here

    endpointName = this.getEndpointName();

    logger.info("endpoint name: " + endpointName);
    logger.info("Announcement endpoint: " + announcementEndpoint);

    MsSignalGenerator generator = msProvider
        .getSignalGenerator(announcementEndpoint);

    try {
      ActivityContextInterface generatorActivity = mediaAcif
          .getActivityContextInterface(generator);
      generatorActivity.attach(getSbbContext().getSbbLocalObject());

      String announcementFile = pathToAudioDirectory
          + "OrderDeliveryDate.wav";
      generator.apply(Announcement.PLAY,
          new String[] { announcementFile });

      //this.initDtmfDetector(getConnection(), endpointName);

    } catch (UnrecognizedActivityException e) {
View Full Code Here

      mgr.flush();
      mgr.close();

      ttsSession.textToAudioFile(stringBuffer.toString());

      MsSignalGenerator generator = msProvider.getSignalGenerator(this
          .getAnnouncementEndpointName());

      try {
        ActivityContextInterface generatorActivity = mediaAcif
            .getActivityContextInterface(generator);
        generatorActivity.attach(getSbbContext().getSbbLocalObject());

        String announcementFile = "file:" + audioFilePath;
        generator.apply(Announcement.PLAY,
            new String[] { announcementFile });

        //this.initDtmfDetector(getConnection(), this.getEndpointName());
      } catch (UnrecognizedActivityException e) {
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.mobicents.mscontrol.MsSignalGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.