官方的例子是向服务器注册之后发起请求,改了一下就可以直接向voip网关发起请求了。
只要不设置这个字段就不会注册 // cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); 具体可以跟进去看官方源码
* and will look something like "sip:serviceprovider".
*
* This field should be specified if registration is desired. If the
* value is empty, no account registration will be performed.
*/
只要不设置这个字段就不会注册 // cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); 具体可以跟进去看官方源码
官方解释如下:
/**
* This is the URL to be put in the request URI for the registration,* and will look something like "sip:serviceprovider".
*
* This field should be specified if registration is desired. If the
* value is empty, no account registration will be performed.
*/
pj_str_t reg_uri;
main.c
#include <pjsua-lib/pjsua.h>
#define SIP_DOMAIN "192.168.4.101"
#define SIP_USER "110"
#define SIP_PASSWD "secret"
#define