PJSip学习笔记

1、Pjsip通信如何使用TCP协议

pjsua_acc_config config;

pjsua_acc_config_default(&config);

char *sipAccount;

//设置sip账号

NSString* sipAccountStr = [NSString stringWithFormat:@"sip:%@@%@;transport=tcp",accountsString,ipString];

sipAccount = malloc(sipAccountStr.length*sizeof(char));

strcpy(sipAccount, sipAccountStr.UTF8String);

config.id = pj_str(sipAccount);

//设置服务器格式: sip:服务器地址

char serviceId[50];

sprintf(serviceId, "sip:%s;transport=tcp",[ipString UTF8String]);

config.reg_uri = pj_str(serviceId);

你可能感兴趣的:(PJSip学习笔记)