Extending Simple PJSUA to use ICE w/TURN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Starting with the current Simple PJSUA demo:
http://www.pjsip.org/pjsip/docs/html/page__pjsip__sample__simple__pjsuaua__c.htm

I'd like to get it to use ICE and a TURN server. It looks like we would need to:
- define turn details:

#define TURN_SERVER "numb.viagenie.ca"
#define TURN_USER "user at domain.com"
#define TURN_PASSWD "secret"


- add the media configuration below the transport config:
{
pjsua_media_config media_cfg;

pjsua_media_config_default(&cfg);

media_cfg.enable_ice = PJ_TRUE;

media_cfg.enable_turn = PJ_TRUE;
media_cfg.turn_server = TURN_SERVER;
media_cfg.turn_conn_type = PJ_TURN_TP_TCP;

media_cfg.turn_auth_cred.type = PJ_STUN_AUTH_CRED_STATIC;
media_cfg.turn_auth_cred.data.static_cred.realm = pj_str("*");
media_cfg.turn_auth_cred.data.static_cred.username = TURN_USER;

media_cfg.turn_auth_cred.data.static_cred.data_type = PJ_STUN_PASSWD_PLAIN;
media_cfg.turn_auth_cred.data.static_cred.data = TURN_PASSWD;
}

- use the media config when calling pjsua_init
status = pjsua_init(&cfg, &log_cfg, &media_cfg);


Is that correct?

thanks in advance!



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux