Forward a line

This sourcecode shows you how to forward a line with the cisco callmanager.

If the source works fine for you, you will see the forward in the display of the phone, you forwarded.

  /**
   * forwards a line .. check the display of your phone
   @param num
   @param observedAddress
   */
  public void setLineForwardingjTapi(String num, String observedAddress) {
    try {
      Address adr= provider.getAddress(observedAddress);
      CallControlAddress address = (CallControlAddressadr;
      // if you want that the forwarding is disabled, you may do it 
      // that way
      if (num == null) {
        address.cancelForwarding();
        return;
      }
      // that is not the fine art 🙂 
      // you have to check if there is another forward activ right now
      // we do not have to, cause it is just an example
      CallControlForwarding[] cforwardIs = new CallControlForwarding[1];
      cforwardIs[0new CallControlForwarding(num);
      if (address != null) {
        address.setForwarding(cforwardIs);
      else {
        // if you are not allowed to forward, it will not work !
        // (you have to get rights threw the callmanager
        Logger.getLogger(this.getClass()).warn(“forwarding did not work, no rights maybe”);
      }
    catch (MethodNotSupportedException e) {
      Logger.getLogger(this.getClass()).error(e);
    catch (InvalidStateException e) {
      Logger.getLogger(this.getClass()).error(e);
    catch (InvalidArgumentException e) {
      Logger.getLogger(this.getClass()).error(e);
    }
  }

Leave a Reply

Your email address will not be published. Required fields are marked *