diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-11-09 08:51:34 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-11-09 08:51:34 +0000 |
commit | d74a1707948d51e98826aa4507ff1dd1a6c02601 (patch) | |
tree | 6f9d6d852f0ad80e27ca3d2fde00befbf8c28b32 /pjsip-apps | |
parent | 23363ea696574b1f6e40c3e8c800cb12e2c5ff57 (diff) |
Ticket #950 and #957:
- added QoS options on PJLIB/PJLIB SSL/TLS socket/transport
- added demo in Symbian ua.cpp
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2998 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/src/pjsua/pjsua_app.c | 5 | ||||
-rw-r--r-- | pjsip-apps/src/symbian_ua/ua.cpp | 36 |
2 files changed, 40 insertions, 1 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index afca3914..c703fa5c 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -4600,6 +4600,11 @@ pj_status_t app_init(int argc, char *argv[]) pjsua_acc_id acc_id; + /* Copy the QoS settings */ + tcp_cfg.tls_setting.qos_type = tcp_cfg.qos_type; + pj_memcpy(&tcp_cfg.tls_setting.qos_params, &tcp_cfg.qos_params, + sizeof(tcp_cfg.qos_params)); + /* Set TLS port as TCP port+1 */ tcp_cfg.port++; status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, diff --git a/pjsip-apps/src/symbian_ua/ua.cpp b/pjsip-apps/src/symbian_ua/ua.cpp index d4a5c3ec..706a41d2 100644 --- a/pjsip-apps/src/symbian_ua/ua.cpp +++ b/pjsip-apps/src/symbian_ua/ua.cpp @@ -92,6 +92,16 @@ #define USE_SRTP PJSUA_DEFAULT_USE_SRTP // +// Set QoS on transports? Yes! +// As an example, we set SIP transports DSCP value to CS3 (DSCP +// value 24 or 0x18), for no reason, and tag RTP/RTCP packets +// with VOICE type. +// +#define SIP_QOS_DSCP 0x18 +#define RTP_QOS_TYPE PJ_QOS_TYPE_VOICE + + +// // Globals // static pjsua_acc_id g_acc_id = PJSUA_INVALID_ID; @@ -384,6 +394,10 @@ static pj_status_t app_startup() /* Add UDP transport. */ pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + } status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error creating UDP transport", status); @@ -396,6 +410,10 @@ static pj_status_t app_startup() /* Add TCP transport */ pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + } status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, &tcfg, &tid); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error creating TCP transport", status); @@ -408,6 +426,11 @@ static pj_status_t app_startup() /* Add TLS transport */ pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT + 1; + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + tcfg.tls_setting.qos_params = tcfg.qos_params; + } status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, &tcfg, &tid); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error creating TLS transport", status); @@ -419,7 +442,18 @@ static pj_status_t app_startup() /* Add account for the transport */ pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); - + /* Create media transports */ + pjsua_transport_config mtcfg; + pjsua_transport_config_default(&mtcfg); + mtcfg.port = 4000; + mtcfg.qos_type = RTP_QOS_TYPE; + status = pjsua_media_transports_create(&mtcfg); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating media transports", status); + pjsua_destroy(); + return status; + } + /* Initialization is done, now start pjsua */ status = pjsua_start(); if (status != PJ_SUCCESS) { |