protected void Page_Load(object sender, EventArgs e) { string ret = null; CCPRestSDK.CCPRestSDK api = new CCPRestSDK.CCPRestSDK(); //ip格式如下,不带https:// bool isInit = api.init("sandboxapp.cloopen.com", "8883"); api.setSubAccount(子帐号, 子帐号令牌, VoIP帐号, VoIP密码); try { if (isInit) { Dictionary<string, object> retData = api.CallBack(主叫号码, 被叫号码, 被叫侧显示号码, 主叫侧显示号码, 第三方自定义提示音); ret = getDictionaryData(retData); } else { ret = "初始化失败"; } } catch (Exception exc) { ret = exc.Message; } finally { Response.Write(ret); } }
static void testcallback() { CCPRestSDK.CCPRestSDK api = new CCPRestSDK.CCPRestSDK(); //ip格式如下,不带https:// bool isInit = api.init(RESTADDRESS, RESTPORT); //api.setAccount(ACCOUNTSID, ACCOUNTTOKEN); api.setSubAccount(ACCOUNTSID, ACCOUNTTOKEN, "80000300592148", "eRuJZAO8"); api.setAppId(APPID); Dictionary<string, object> tmp = api.CallBack("18701416082", "15701282815", "18701416082", "15701282815", ""); Console.Read(); }