⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 theapplication.java

📁 中兴公司在parlayx开发方面的培训文档
💻 JAVA
字号:
package samples.mpccs.createcall;


import samples.fw.*;
import org.csapi.*;
//import org.csapi.ui.*;
import org.csapi.cc.*;
import org.csapi.cc.mpccs.*;

/**
 * This application creates multiparty call and bridges two parties 4860034 and 4860037.
 */
 
public class TheApplication
{
    static Object lock = new Object();
    
    static  TpAddress targetAddress = new TpAddress(
			TpAddressPlan.P_ADDRESS_PLAN_E164,
            "4860034",""
			TpAddressPresentation.P_ADDRESS_PRESENTATION_UNDEFINED,
       		      TpAddressScreening.P_ADDRESS_SCREENING_USER_NOT_VERIFIED,
			"A");
    static TpAddress origAddress = new TpAddress(
			TpAddressPlan.P_ADDRESS_PLAN_E164,
            "4860037","",
			TpAddressPresentation.P_ADDRESS_PRESENTATION_UNDEFINED,
       		      TpAddressScreening.P_ADDRESS_SCREENING_USER_NOT_VERIFIED,
			"A");

	static IpMuiltpartyCall ipMPCall;
	static IpMuiltpartyCallControlManager ipMPCallCtlMgr;
	static IpAppMuiltpartyCallControlManager ipAppMPCallCtlMgr;
	static int callSessionID;
	
    public static void main(String[] argv) throws Exception
    {
		AppFWImpl.initiate("localhost", "12345", "FwInitial");
		AppFWImpl.getAuthenticated("MPCCSApplication1");
		
		IpInterface mgrIfc = AppFWImpl.getService("P_MULTIPARTY_CALL_CONTROL");
		
		ipMPCallCtlMgr = org.csapi.cc.mpccs.IpMuiltpartyCallControlManagerHelper.narrow(
                                  mgrIfc);
		ipAppMPCallCtlMgr = IpAppMuiltpartyCallControlManagerHelper.narrow(
                AppFWImpl.poa.servant_to_reference(
                           new AppMPCallControlManagerImpl()));
    	
    	TpMultiPartyCallIdentifier retCall =
    			ipMPCallCtlMgr.createCall(ipAppMPCallCtlMgr);
		ipMPCall = retCall.CallReference;
		callSessionID = retCall.CallSessionID;

		org.csapi.cc.TpCallEventRequest[] eventReqs =
          new org.csapi.cc.TpCallEventRequest[0];
          /*
        org.csapi.cc.TpAdditionalCallEventCriteria addyCretieria =
            new  org.csapi.cc.TpAdditionalCallEventCriteria();
        addyCretieria.Dummy((short) 0);
        eventReqs[0] = new org.csapi.cc.TpCallEventRequest(
          org.csapi.cc.TpCallEventType.P_CALL_EVENT_ANSWER ,
          addyCretieria,
          org.csapi.cc.TpCallMonitorMode.from_int(0));
         */
        org.csapi.cc.TpCallAppInfo[] appInfo = new org.csapi.cc.TpCallAppInfo[0];

        System.out.println("Start to route to 4860034");
        org.csapi.cc.mpccs.TpCallLegIdentifier leg1 = 
        	ipMPCall.createAndRouteCallLegReq(callSessionID, eventReqs, 
        		targetAddress, origAddress, appInfo);
        System.out.println("Done route to 4860034");

        System.out.println("Start to route to 4860036");
        org.csapi.cc.mpccs.TpCallLegIdentifier leg2 = 
        	ipMPCall.createAndRouteCallLegReq(callSessionID, eventReqs, 
        		origAddress, targetAddress, appInfo);
        System.out.println("Done route to 4860036");
        synchronized(lock) {
          try {
            lock.wait();
          }
          catch(Exception e) {}
          System.out.println("TheApplication finished");
        }
    }

    static public void callEnded(int SessionID, org.csapi.cc.gccs.TpCallEndedReport report)
    {
      try {
      	ipMPCall.release(callSessionID,org.csapi.cc.TpReleaseCause.from_int(0));
      }
      catch(Exception e){}
      synchronized(lock) {
        try {
          lock.notify();
        }
        catch(Exception e) {}
      }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -