美文网首页
PJSip学习笔记

PJSip学习笔记

作者: 一笔春秋 | 来源:发表于2018-02-09 11:42 被阅读97次

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学习笔记

      本文链接:https://www.haomeiwen.com/subject/oqeftftx.html