2016-04-20 19 views

回答

1

我發現LinphoneCore的方法可以發送subscribe command

subscribe(LinphoneAddress resource, java.lang.String event, int expires, LinphoneContent content) 

發送傳出認購與給定的情況下,保質期,以及內容的資源。

我們可以指定事件,它是對話框在這種情況下。

這裏是代碼片段:

String account = "sip:[email protected]_DOMAIN:PORT"; 
LinphoneAddress address = LinphoneCoreFactory.instance().createLinphoneAddress(account); 
LinphoneEvent dialog = core.createSubscribe(address, "dialog", 300); 
dialog.addCustomHeader("Accept", "application/dialog-info+xml"); 
dialog.sendSubscribe(null); 

注:接受頭是可選的,但在某些服務器,您需要這個頭,以避免489壞事件錯誤