Author Message
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
I am trying to do a simple makeCall through Telephony Webservice. I am using eclipse 3.1 on Windows 2000 Server.My code is as following:
package com.avaya.aes.telephonyPortal;
import java.net.URL;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPHeaderElement;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyService;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceService;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceServiceLocator;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub;
public class Telsvc {
   private TelephonyService port = null;
   private TelephonyServiceService service = null;
   private TelephonyServiceSoapBindingStub telSvcSoap = null;
   private static final String serviceName="http://xml.avaya.com/ws/TelephonyService/2005/04/04";
   private static final String sessionNameSpace ="http://xml.avaya.com/ws/session";
   private static final String sessionKey = "sessionID";
   /**
    * @param args
    */
   public Telsvc(String serviceIP, String username, String password,String switchName, boolean useSSL) {
    URL serviceURL=null;
    service = new TelephonyServiceServiceLocator();
   try {
   if (useSSL) {
    serviceURL = new URL("https://" + serviceIP +":8443/axis/services/TelephonyService");
    }
   else {
   serviceURL = new URL("http://" + serviceIP+":8080/axis/services/TelephonyService");} }
   catch(Exception e)
   {System.out.println("Error accessing URL");}
   if(serviceURL==null)
   {try
    {
    port = service.getTelephonyService();
    telSvcSoap = (TelephonyServiceSoapBindingStub)port;
    System.out.println("Service URL is NULL");
    } catch(Exception e)
    {
    System.out.println("Error binding to Telephony Service");
    e.printStackTrace();
    return;
    }
   }
   else {
   try {
    port = service.getTelephonyService(serviceURL);
    telSvcSoap = (TelephonyServiceSoapBindingStub)port;
    } catch(Exception e)
    {
    System.out.println("Error binding to Telephony Service");
    e.printStackTrace();
    return;
    }
    }
   try {
   setHTTPHeader(username, password, switchName);
   }
   catch (Exception e)
   {
   System.out.println("Received exception when setting header " + e);
   e.printStackTrace();
   }
   }
   public void attach() throws Exception
   {
      port.attach();
    setSessionID();
   }
   public void release() throws Exception
   {
      port.release();
   }
   public void makeCall(String ext1, String ext2)
   {
   System.out.println("Starting to make a call");
   try {
      port.makeCall(ext1, ext2);
   } catch(Exception e){
   System.out.println("Error invoking makecall to the Telephony Web service " + e);
   e.printStackTrace();
   return;
   }
   setSessionID();
   }
   public void disconnectCall(String ext1) {
   System.out.println("Disconnecting call");
   try {port.disconnectActiveCall(ext1);}
   catch(Exception e)
   {System.out.println("Error invoking disconnect to the Telephony Web service " + e);
   e.printStackTrace();
   return;
   }
   setSessionID();
   }
   public void answerCall(String ext1)
   {
   System.out.println("Answering call");
   try {
   port.answerAlertingCall(ext1);}
   catch(Exception e){System.out.println("Error invoking answer to the Telephony Web service " + e); e.printStackTrace();
   return;
   }
   setSessionID();
   }
   public void conferenceCall(String ext1, String ext2)
   {System.out.println("Conferencing call");
   try {
   port.singleStepConferenceCall(ext1, ext2);
   } catch(Exception e){
   System.out.println("Error invoking conference to the Telephony Web service " + e);
   e.printStackTrace();
   return;}
   setSessionID();
   }
   public void transferCall(String ext1, String ext2)
   {
   System.out.println("Transfering call");
   try {
   port.singleStepTransferCall(ext1, ext2);
   } catch(Exception e)
   {System.out.println("Error invoking transfer to the Telephony Web service " + e);
   e.printStackTrace();
   return;}
   setSessionID();
   }
   private String getSessionID() {
   String sessionID = "0";
   Call lastCall = null;
   SOAPEnvelope returnEnv;
   SOAPHeaderElement hdr;
   try {
   lastCall = ((Service)service).getCall();
   }
   catch (ServiceException e)
   {
   System.out.println("Error getting call object" + e);
   }try
   {
   returnEnv = lastCall.getResponseMessage().getSOAPEnvelope();
   hdr = returnEnv.getHeaderByName(sessionNameSpace, sessionKey);
   sessionID = (String)hdr.getValueAsType(Constants.XSD_STRING);
   } catch (AxisFault e)
   {
   System.out.println("Could not get session header" + e);
   }
   catch (Exception e)
   {
   System.out.println("Could not get session header" + e);
   }
   return sessionID;
   }
   private void setSessionID() {
   String sessionID = getSessionID();
   telSvcSoap.setHeader(sessionNameSpace, sessionKey, sessionID);
   System.out.println("setHeader(): sessionID="+sessionID);
   }
   private void setHTTPHeader(String userName, String password,String switchName) throws Exception, ServiceException, RemoteException
   {
   telSvcSoap.clearHeaders();// Set credentials in the HTTP header
   String userAtSwitch = userName+"@"+switchName;
   telSvcSoap.setUsername(userAtSwitch);
   telSvcSoap.setPassword(password);
   System.out.println("setHTTPHeader: username="+userAtSwitch+" password=*****");
   }
   

   public static void main(String[] args) {
      // TODO Auto-generated method stub
Telsvc obj=new Telsvc("192.168.210.17","ctiuser","agclpsouser123","2010",false);
   try {
      obj.attach();
   } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
   }
   obj.makeCall("2010","2200");
   }

}
The errors are as following:
setHTTPHeader: username=ctiuser@2010 password=*****
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTrace: java.lang.NullPointerException
   at java.util.Hashtable.put(Unknown Source)
   at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:246)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.attach(TelephonyServiceSoapBindingStub.java:440)
   at com.avaya.aes.telephonyPortal.Telsvc.attach(Telsvc.java:71)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:176)


java.lang.NullPointerException
   at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
   at org.apache.axis.client.Call.invoke(Call.java:2251)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.attach(TelephonyServiceSoapBindingStub.java:440)
   at com.avaya.aes.telephonyPortal.Telsvc.attach(Telsvc.java:71)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:176)
Caused by: java.lang.NullPointerException
   at java.util.Hashtable.put(Unknown Source)
   at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:246)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   ... 5 more
Starting to make a call
Error invoking makecall to the Telephony Web service java.lang.NullPointerException
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTrace: java.lang.NullPointerException
   at java.util.Hashtable.put(Unknown Source)
   at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:246)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.makeCall(TelephonyServiceSoapBindingStub.java:461)
   at com.avaya.aes.telephonyPortal.Telsvc.makeCall(Telsvc.java:82)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:181)


java.lang.NullPointerException
   at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
   at org.apache.axis.client.Call.invoke(Call.java:2251)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.makeCall(TelephonyServiceSoapBindingStub.java:461)
   at com.avaya.aes.telephonyPortal.Telsvc.makeCall(Telsvc.java:82)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:181)
Caused by: java.lang.NullPointerException
   at java.util.Hashtable.put(Unknown Source)
   at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:246)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   ... 5 more
I am unable to understand the real problem.Please help me out in it.
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
I have tried to code this application in another way.Now my code is:
package com.avaya.aes.telephonyPortal;
import java.net.URL;
import java.net.MalformedURLException;
import java.rmi.RemoteException;
//import javax.xml.rpc.ServiceException;
import org.apache.axis.Constants;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPHeaderElement;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceService;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceServiceLocator;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub;
public class TelephonyS {

   /**
    * @param args
    */
   
    public static final String AXIS_SESSION_NAMESPACE = "http://xml.avaya.com/ws/session";
    public static final String AXIS_SESSIONID_HEADERNAME = "sessionID";
    public TelephonyServiceSoapBindingStub telephonyStub = null;
    public TelephonyService port=null;
    public TelephonyServiceService service = null;
    public String sessionID;
    public String remoteSessionID;
    String userName="ctiuser";//to be added
    String password="agclpso123";//to be added
    String switchName="2010";// to be added
    URL serviceURL=null;
    public TelephonyS()
    {
    remoteSessionID="0";
    }
    public void initiate()
    {
    service = new TelephonyServiceServiceLocator();
    try{
    serviceURL = new URL("http://192.168.210.17:8080/axis/services/TelephonyService"); //can be 8443
    }catch(MalformedURLException e){System.out.println("Exceptioninfirst"+e);}
    try{
   telephonyStub = (TelephonyServiceSoapBindingStub) service.getTelephonyService(serviceURL );
    //System.out.println(telephonyStub);
    }catch(Exception e){System.out.println("Exception1:"+e);}
   String userAtSwitch = userName + "@" + switchName;
    try{
       telephonyStub.clearHeaders();
       telephonyStub.setUsername( userAtSwitch );
       telephonyStub.setPassword( password );
    setRemoteSessionID( "0" );
    ((TelephonyServiceSoapBindingStub)telephonyStub).attach();
    setRemoteSessionID( getRemoteSessionID() );
    }catch(Exception e)
    { telephonyStub.clearHeaders();
    telephonyStub.setUsername( null );
    telephonyStub.setPassword( null );
    setRemoteSessionID( "0" );
    System.out.println("Exception2:"+e);}
   }
   
   public String getRemoteSessionID()
      {
         
       try{
       Call previousCall = ( (Service) service ).getCall();
    SOAPEnvelope response = previousCall.getResponseMessage().getSOAPEnvelope();
    SOAPHeaderElement header = response.getHeaderByName( AXIS_SESSION_NAMESPACE, AXIS_SESSIONID_HEADERNAME );
            return (String) header.getValueAsType( Constants.XSD_STRING );
         }
         catch ( Exception e )
         {
            return "0";
         }
      }
   public void setRemoteSessionID( String id )
      {
         TelephonyServiceSoapBindingStub stub = (TelephonyServiceSoapBindingStub) telephonyStub;

         // Set SOAP session header
         stub.clearHeaders();
         stub.setHeader( AXIS_SESSION_NAMESPACE, AXIS_SESSIONID_HEADERNAME, id );
         remoteSessionID = id;

      }
    public void makeCall( String ext1, String ext2 ) throws RemoteException
      {
        System.out.println("Starting to make a call");
        ((TelephonyServiceSoapBindingStub)telephonyStub).makeCall( ext1, ext2 );
         setRemoteSessionID( getRemoteSessionID() );
      }
    public static void main(String[] args) {
      // TODO Auto-generated method stub
       TelephonyS ts=new TelephonyS();
       ((TelephonyS)ts).initiate();
      
       try{
          ts.makeCall("2010","2200");
       }catch(Exception e)
       {
       System.out.println("Exception3:"+e);
       }
   }

}
and the errors are as following:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:

   at com.avaya.aes.telephonyPortal.TelephonyS.main(TelephonyS.java:91)
Please try to resolve my problem.
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
I was using jdk1.5 with AES3.1 that's why it was throwing that null pointer exception.Now I have changed to jdk1.4 now its throwing switchnotreachable exception.This is the stack trace:
setHTTPHeader: username=ctiuser@2010 password=*****
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: com.avaya.api.basictelephony.SwitchNotReachableException
Sub-Error code = 0
Got SwitchNotReachableException
faultActor:
faultNode:
faultDetail:
   {}com.avaya.api.basictelephony.SwitchNotReachableException:
<subErrorCode xsi:type="xsd:int">0</subErrorCode>


com.avaya.api.basictelephony.SwitchNotReachableException
Sub-Error code = 0
Got SwitchNotReachableException
   at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
   at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
   at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
   at org.apache.crimson.parser.Parser2.parse(Unknown Source)
   at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
   at javax.xml.parsers.SAXParser.parse(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.attach(TelephonyServiceSoapBindingStub.java:440)
   at com.avaya.aes.telephonyPortal.Telsvc.attach(Telsvc.java:71)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:176)
Starting to make a call
Error invoking makecall to the Telephony Web service com.avaya.api.basictelephony.SwitchNotReachableException
Sub-Error code = 0
Got SwitchNotReachableException
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: com.avaya.api.basictelephony.SwitchNotReachableException
Sub-Error code = 0
Got SwitchNotReachableException
faultActor:
faultNode:
faultDetail:
   {}com.avaya.api.basictelephony.SwitchNotReachableException:
<subErrorCode xsi:type="xsd:int">0</subErrorCode>


com.avaya.api.basictelephony.SwitchNotReachableException
Sub-Error code = 0
Got SwitchNotReachableException
   at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
   at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
   at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
   at org.apache.crimson.parser.Parser2.parse(Unknown Source)
   at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
   at javax.xml.parsers.SAXParser.parse(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.makeCall(TelephonyServiceSoapBindingStub.java:461)
   at com.avaya.aes.telephonyPortal.Telsvc.makeCall(Telsvc.java:82)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:181)
Please help me out in it so that I can run this Telephony service as soon as possible.My 2nd program is right(one having a big stack trace).1st is wrong.
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Hi Sonal,

It would appear that your compilation problem is due to the fact that you did not import the TelephonyService class. If you look at the sampleapps.telSvcClient.TelSvcWrapper.java class, you'll see that there is an import statement as follows:

import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyService;

Eclipse should have immediately flagged this error for you in your file. You didn't see any red marks indicating a compilation error?

On your original problem, I see that you did not pass any arguments to attach. Our latest SDK requires a null argument be passed to attach because of changes to our WSDL necessary to interoperate with .NET. Please download the latest 3.1.X or 4.0 Telephony Service SDK (Depending on the version of AES that your are running on) and work with this latest version.

Joel
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Hi Joel,
I am using AES3.1 and telsvc-sdk3.1 and jdk1.4 .Everything is written as in Telsvcwrapper.java.I am just trying to use makeCall method.Please go thru my code.Its still throwing switchnotreachable exception.I have imported the above class as you said as well and the reason you know why.But the problem remains.The rpm installed on AES 3.1 are jdk1.5,tomcat5.0,and axis1.1-13
hope this might help you in sorting out the problem.
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Did you see in the documentation where we have a list of exceptions and their probable causes? This can be found by going to http://support.avaya.com and searching for "aes web service". Open the 3.1 Web Services Programmers guide. Here's what it has for SwitchNotReachable:

Switch Not Reachable Exception This occurs if either the TSAPI service is not
accessible or if there is not an active Switch
Connection to the specified switch.
Verify that the Switch Connection to the given
switch is operational, and that the given switch
name matches the Switch Connection name
exactly.

We noticed that your switch name is "2010";// to be added. As stated in the documentation, this switch name must correspond to a switch administered on the OAM pages on AES.

Do you have a switch connection and / or CTI link administered? Please see the AES administrators guide for details on how to set this link up. You can also find this document on support.avaya.com by searching for "AES administration"
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Thanks Joel,
My application is up and running now.You pointed out correctly that my switchname was psocm not 2010.There were also some problems with the ACM at the backend that was also the reason for the non-working of my application.
But now everything is fine.I am very happy now.My both applications are working perfectly fine.
Hats off to you for your support!!!
Thanks a lot once again...
Mr.Sonal Sharma
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Hi Joel,
Now I am trying to run Telephony webservice portal as a whole and when I try to run build.xml, I get the following errors:

Buildfile: C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\conf\build.xml
all:
clean:
[delete] Deleting directory C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\build
telephonyPortal:
stage:
[mkdir] Created dir: C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\build
[mkdir] Created dir: C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\build\telephonyPortal
[mkdir] Created dir: C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\build\telephonyPortal\WEB-INF
[mkdir] Created dir: C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\build\telephonyPortal\WEB-INF\classes
[mkdir] Created dir: C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\build\telephonyPortal\WEB-INF\lib
[javac] Compiling 9 source files to C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\build\telephonyPortal\WEB-INF\classes
[javac] javac: invalid flag: -Xlint:unchecked
[javac] Usage: javac <options> <source files>
[javac] where possible options include:
[javac] -g Generate all debugging info
[javac] -g:none Generate no debugging info
[javac] -g:{lines,vars,source} Generate only some debugging info
[javac] -nowarn Generate no warnings
[javac] -verbose Output messages about what the compiler is doing
[javac] -deprecation Output source locations where deprecated APIs are used
[javac] -classpath <path> Specify where to find user class files
[javac] -sourcepath <path> Specify where to find input source files
[javac] -bootclasspath <path> Override location of bootstrap class files
[javac] -extdirs <dirs> Override location of installed extensions
[javac] -d <directory> Specify where to place generated class files
[javac] -encoding <encoding> Specify character encoding used by source files
[javac] -source <release> Provide source compatibility with specified release
[javac] -target <release> Generate class files for specific VM version
[javac] -help Print a synopsis of standard options

BUILD FAILED
C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\conf\build.xml:57: The following error occurred while executing this line:
C:\TelephonyServiceWebPortal\TelephonyServiceWebPortal\conf\build.xml:35: Compile failed; see the compiler error output for details.

Total time: 2 seconds
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Hi Joel,
Do we need to make a change in the web.xml file in the ipaddress of the ldap on the AES server.I don't know the ipaddress of the ldap on AES server.It should be the same as that of the AES server.Please throw some light on it.

Thanks and regards
Sonal
MuraliTupuri
Joined: Apr 11, 2006
Messages: 0
Offline
Sonal,

1) You dont need to configure ldap related in web.xml. From ldap application gets the telephone number of the login user. You can leave it as it is. In that case after logging into the application you dont see any phoe number attached to your user name. The authentication is done against AES user management SDB. Make sure you got a user name and password set in SDB

2)The build errors could be the JDK you are using to compile the source. Lert me know what version of JDK you are using? Follow the instructions listed in the app notes pdf file(which is part of the source zip file)

Murali
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Hi Murali,
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Hi Murali,
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Hi Murali,
I got your point.Actually I am using jdk1.4.2_02 which is not jdk1.5 as given in pdf guide.Actually when I use jdk1.5 then it conflicts with the Apache axis 1.1-13 installed on AES 3.1 and I get null pointer exception.So,instead I am using jdk1.4 but there is one more problem please help me out in this my application is working fine when I makeCall and disconnectCall but when I try to transferCall and conferenceCall then it throws missingResourceException.How can I overcome this problem.Please do help me out in this because I believe my application is alright from programming point of view.
Here is my application's code:
package com.avaya.aes.telephonyPortal;
import java.net.URL;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPHeaderElement;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyService;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceService;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceServiceLocator;
import com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub;
public class Telsvc {
   private TelephonyService port = null;
   private TelephonyServiceService service = null;
   private TelephonyServiceSoapBindingStub telSvcSoap = null;
   private static final String serviceName="http://xml.avaya.com/ws/TelephonyService/2005/04/04";
   private static final String sessionNameSpace ="http://xml.avaya.com/ws/session";
   private static final String sessionKey = "sessionID";
   /**
    * @param args
    */
   public Telsvc(String serviceIP, String username, String password,String switchName, boolean useSSL) {
    URL serviceURL=null;
    service = new TelephonyServiceServiceLocator();
   try {
   if (useSSL) {
    serviceURL = new URL("https://" + serviceIP +":8443/axis/services/TelephonyService");
    }
   else {
   serviceURL = new URL("http://" + serviceIP+":8080/axis/services/TelephonyService");} }
   catch(Exception e)
   {System.out.println("Error accessing URL");}
   if(serviceURL==null)
   {try
    {
    port = service.getTelephonyService();
    telSvcSoap = (TelephonyServiceSoapBindingStub)port;
    System.out.println("Service URL is NULL");
    } catch(Exception e)
    {
    System.out.println("Error binding to Telephony Service");
    e.printStackTrace();
    return;
    }
   }
   else {
   try {
    port = service.getTelephonyService(serviceURL);
    telSvcSoap = (TelephonyServiceSoapBindingStub)port;
    } catch(Exception e)
    {
    System.out.println("Error binding to Telephony Service");
    e.printStackTrace();
    return;
    }
    }
   try {
   setHTTPHeader(username, password, switchName);
   }
   catch (Exception e)
   {
   System.out.println("Received exception when setting header " + e);
   e.printStackTrace();
   }
   }
   public void attach() throws Exception
   {
      port.attach();
    setSessionID();
   }
   public void release() throws Exception
   {
      port.release();
   }
   public void makeCall(String ext1, String ext2)
   {
   System.out.println("Starting to make a call");
   try {
      port.makeCall(ext1, ext2);
   } catch(Exception e){
   System.out.println("Error invoking makecall to the Telephony Web service " + e);
   e.printStackTrace();
   return;
   }
   setSessionID();
   }
   public void disconnectCall(String ext1) {
   System.out.println("Disconnecting call");
   try {port.disconnectActiveCall(ext1);}
   catch(Exception e)
   {System.out.println("Error invoking disconnect to the Telephony Web service " + e);
   e.printStackTrace();
   return;
   }
   setSessionID();
   }
   public void answerCall(String ext1)
   {
   System.out.println("Answering call");
   try {
   port.answerAlertingCall(ext1);}
   catch(Exception e){System.out.println("Error invoking answer to the Telephony Web service " + e); e.printStackTrace();
   return;
   }
   setSessionID();
   }
   public void conferenceCall(String ext1, String ext2)
   {System.out.println("Conferencing call");
   try {
   port.singleStepConferenceCall(ext1, ext2);
   } catch(Exception e){
   System.out.println("Error invoking conference to the Telephony Web service " + e);
   e.printStackTrace();
   return;}
   setSessionID();
   }
   public void transferCall(String ext1, String ext2)
   {
   System.out.println("Transfering call");
   try {
   port.singleStepTransferCall(ext1, ext2);
   } catch(Exception e)
   {System.out.println("Error invoking transfer to the Telephony Web service " + e);
   e.printStackTrace();
   return;}
   setSessionID();
   }
   private String getSessionID() {
   String sessionID = "0";
   Call lastCall = null;
   SOAPEnvelope returnEnv;
   SOAPHeaderElement hdr;
   try {
   lastCall = ((Service)service).getCall();
   }
   catch (ServiceException e)
   {
   System.out.println("Error getting call object" + e);
   }try
   {
   returnEnv = lastCall.getResponseMessage().getSOAPEnvelope();
   hdr = returnEnv.getHeaderByName(sessionNameSpace, sessionKey);
   sessionID = (String)hdr.getValueAsType(Constants.XSD_STRING);
   } catch (AxisFault e)
   {
   System.out.println("Could not get session header" + e);
   }
   catch (Exception e)
   {
   System.out.println("Could not get session header" + e);
   }
   return sessionID;
   }
   private void setSessionID() {
   String sessionID = getSessionID();
   telSvcSoap.setHeader(sessionNameSpace, sessionKey, sessionID);
   System.out.println("setHeader(): sessionID="+sessionID);
   }
   private void setHTTPHeader(String userName, String password,String switchName) throws Exception, ServiceException, RemoteException
   {
   telSvcSoap.clearHeaders();// Set credentials in the HTTP header
   String userAtSwitch = userName+"@"+switchName;
   telSvcSoap.setUsername(userAtSwitch);
   telSvcSoap.setPassword(password);
   System.out.println("setHTTPHeader: username="+userAtSwitch+" password=*****");
   }
   

   public static void main(String[] args) {
      // TODO Auto-generated method stub
Telsvc obj=new Telsvc("192.168.210.17","ctiuser","agclpso123","psocm",false);
   try {
      obj.attach();
   } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
   }
    //obj.makeCall("2011","2012");
    //obj.disconnectCall("2011");
    //obj.answerCall("2012");
    /*try {
         obj.release();
      } catch (Exception e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }*/
    //obj.transferCall("2011","2013");
    //obj.conferenceCall("2011","2013");
   }

}
When I try to transfer/conference the call I get the following stack trace as following:
setHTTPHeader: username=ctiuser@psocm password=*****
setHeader(): sessionID=-6105025754882041634
Transfering call
Error invoking transfer to the Telephony Web service java.util.MissingResourceException: Missing resource when connecting call
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.util.MissingResourceException: Missing resource when connecting call
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTrace: AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.util.MissingResourceException: Missing resource when connecting call
faultActor:
faultNode:
faultDetail:

java.util.MissingResourceException: Missing resource when connecting call
   at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
   at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
   at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
   at org.apache.crimson.parser.Parser2.parse(Unknown Source)
   at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
   at javax.xml.parsers.SAXParser.parse(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.singleStepTransferCall(TelephonyServiceSoapBindingStub.java:503)
   at com.avaya.aes.telephonyPortal.Telsvc.transferCall(Telsvc.java:124)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:190)


java.util.MissingResourceException: Missing resource when connecting call
   at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
   at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
   at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
   at org.apache.crimson.parser.Parser2.parse(Unknown Source)
   at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
   at javax.xml.parsers.SAXParser.parse(Unknown Source)
   at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
   at org.apache.axis.client.Call.invoke(Call.java:2553)
   at org.apache.axis.client.Call.invoke(Call.java:2248)
   at org.apache.axis.client.Call.invoke(Call.java:2171)
   at org.apache.axis.client.Call.invoke(Call.java:1691)
   at com.avaya.xml.ws.TelephonyService._2005._04._04.TelephonyServiceSoapBindingStub.singleStepTransferCall(TelephonyServiceSoapBindingStub.java:503)
   at com.avaya.aes.telephonyPortal.Telsvc.transferCall(Telsvc.java:124)
   at com.avaya.aes.telephonyPortal.Telsvc.main(Telsvc.java:190)

Please do help me out to sort out this problem.This happens whether I do transfer or conference.
SonalSharma
Joined: Apr 20, 2007
Messages: 0
Offline
Hi Murali,
I am through with transferCall and conferenceCall.Actually the problem was I wasn't calling answerCall before transfer and conference.That's why it was giving java.util.MissingResourceException.
Thanks Murali for your Cooperation.
Bye!!!
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Hi Sonal,

With regards to your JVM conflict, running applications co-resident on the AES is not a supported configuration. Please follow the application notes for the telephony portal, which direct you to set up Tomcat on another PC and deploy the portal there. You'll need to use JDK 5.0 on that machine.

Joel
Go to:   
Mobile view