From 48a492ee742bc593bc332cd5176d0c33b1a13604 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 29 Apr 2006 12:38:25 +0000 Subject: Fixed bug in event subscription when it is challenged/authenticated git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@424 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/config.c | 2 +- pjmedia/src/pjmedia/endpoint.c | 12 ++++++++---- pjsip/src/pjsip-simple/evsub.c | 8 ++++---- pjsip/src/pjsua-lib/pjsua_core.c | 14 ++------------ pjsip/src/pjsua-lib/pjsua_pres.c | 3 +++ 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/pjlib/src/pj/config.c b/pjlib/src/pj/config.c index 3d1ea612..3e8480eb 100644 --- a/pjlib/src/pj/config.c +++ b/pjlib/src/pj/config.c @@ -21,7 +21,7 @@ #include static const char *id = "config.c"; -const char *PJ_VERSION = "0.5.5"; +const char *PJ_VERSION = "0.5.5.1"; PJ_DEF(void) pj_dump_config(void) { diff --git a/pjmedia/src/pjmedia/endpoint.c b/pjmedia/src/pjmedia/endpoint.c index 0685c3d9..e403178d 100644 --- a/pjmedia/src/pjmedia/endpoint.c +++ b/pjmedia/src/pjmedia/endpoint.c @@ -432,12 +432,13 @@ PJ_DEF(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt) #if PJ_LOG_MAX_LEVEL >= 3 unsigned i, count; pjmedia_codec_info codec_info[32]; + unsigned prio[32]; PJ_LOG(3,(THIS_FILE, "Dumping PJMEDIA capabilities:")); count = PJ_ARRAY_SIZE(codec_info); if (pjmedia_codec_mgr_enum_codecs(&endpt->codec_mgr, - &count, codec_info, NULL) != PJ_SUCCESS) + &count, codec_info, prio) != PJ_SUCCESS) { PJ_LOG(3,(THIS_FILE, " -error: failed to enum codecs")); return PJ_SUCCESS; @@ -466,7 +467,7 @@ PJ_DEF(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt) } PJ_LOG(3,(THIS_FILE, - " %s codec #%2d: pt=%d (%.*s @%dKHz/%d, %sbps, ptime=%d ms, vad=%d, cng=%d)", + " %s codec #%2d: pt=%d (%.*s @%dKHz/%d, %sbps, %dms%s%s%s%s%s)", type, i, codec_info[i].pt, (int)codec_info[i].encoding_name.slen, codec_info[i].encoding_name.ptr, @@ -474,8 +475,11 @@ PJ_DEF(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt) codec_info[i].channel_cnt, good_number(bps, param.avg_bps), param.ptime, - param.vad, - param.cng)); + (param.vad ? " vad" : ""), + (param.cng ? " cng" : ""), + (param.concl ? " plc" : ""), + (param.penh ? " penh" : ""), + (prio[i]==PJMEDIA_CODEC_PRIO_DISABLED?" disabled":""))); } #endif diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c index 9a9b852d..7b13d548 100644 --- a/pjsip/src/pjsip-simple/evsub.c +++ b/pjsip/src/pjsip-simple/evsub.c @@ -1355,10 +1355,6 @@ static pjsip_evsub *on_new_transaction( pjsip_transaction *tsx, sub->pending_sub = tsx; - } else if (tsx == sub->pending_sub && - tsx->state >= PJSIP_TSX_STATE_COMPLETED) - { - sub->pending_sub = NULL; } return sub; @@ -1468,6 +1464,10 @@ static void on_tsx_state_uac( pjsip_evsub *sub, pjsip_transaction *tsx, return; } + /* Clear pending subscription */ + if (tsx == sub->pending_sub) + sub->pending_sub = NULL; + /* Handle authentication. */ if (tsx->status_code==401 || tsx->status_code==407) { pjsip_tx_data *tdata; diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index 034262ab..35309323 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -683,19 +683,9 @@ static pj_status_t init_media(void) #endif /* PJMEDIA_HAS_L16_CODEC */ - /* If user specifies the exact codec to be used, then disable all codecs - * and only enable those specific codecs. + /* Enable those codecs that user put with "--add-codec", and move + * the priority to top */ - if (pjsua.codec_cnt != 0) { - codec_id = pj_str(""); - pjmedia_codec_mgr_set_codec_priority( - pjmedia_endpt_get_codec_mgr(pjsua.med_endpt), - &codec_id, - PJMEDIA_CODEC_PRIO_DISABLED); - } - - - for (i=0; iauth_sess, pjsua.cred_count, + pjsua.cred_info); + status = pjsip_pres_create_uac( dlg, &pres_callback, &pjsua.buddies[index].sub); if (status != PJ_SUCCESS) { -- cgit v1.2.3