2013-08-20 326 views
1

我在更改liblinphone服務器端口時出現問題。我需要改變'from'和'to'端口。我可以從端口更改,但不能更改「到」端口。目的端口。如何更改linphone-iphone服務器端口5060

這裏是方法,我使用 linphone_address_set_port_int

下面是從Linphone中的項目代碼執行:

static void update_primary_contact(LinphoneCore *lc){ 
char *guessed=NULL; 
char tmp[LINPHONE_IPADDR_SIZE]; 

LinphoneAddress *url; 
if (lc->sip_conf.guessed_contact!=NULL){ 
    ms_free(lc->sip_conf.guessed_contact); 
    lc->sip_conf.guessed_contact=NULL; 
} 
url=linphone_address_new(lc->sip_conf.contact); 
if (!url){ 
    ms_error("Could not parse identity contact !"); 
    url=linphone_address_new("sip:[email protected]"); 
} 
linphone_core_get_local_ip(lc, NULL, tmp); 
if (strcmp(tmp,"127.0.0.1")==0 || strcmp(tmp,"::1")==0){ 
    ms_warning("Local loopback network only !"); 
    lc->sip_conf.loopback_only=TRUE; 
}else lc->sip_conf.loopback_only=FALSE; 
linphone_address_set_domain(url,tmp); 
linphone_address_set_port_int(url,linphone_core_get_sip_port (lc)); 
guessed=linphone_address_as_string(url); 
lc->sip_conf.guessed_contact=guessed; 
linphone_address_destroy(url); 

}

但它不是爲我工作。

回答