Repeated PUBLISH request

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

 



I resolved this issue temporary before 1.5 released:
in publishc.c:
static void pubc_refresh_timer_cb(pj_timer_heap_t *timer_heap,
struct pj_timer_entry *entry)
{
pjsip_publishc *pubc = (pjsip_publishc*) entry->user_data;
pjsip_tx_data *tdata;
pj_status_t status;
PJ_UNUSED_ARG(timer_heap);
entry->id = 0;
#ifndef __SYMBIAN32__ 
status = pjsip_publishc_publish(pubc, 1, &tdata);
#else 
status = pjsip_publishc_publish(pubc, 0, &tdata);
#endif 
if (status != PJ_SUCCESS)
{
char errmsg[PJ_ERR_MSG_SIZE];
pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg));
call_callback(pubc, status, 400, &reason, NULL, -1);
return;
}

status = pjsip_publishc_send(pubc, tdata);
/* No need to call callback as it should have been called */
}

in pjsua_pres.c:
/*
 * Client presence publication callback.
 */
static void publish_cb(struct pjsip_publishc_cbparam *param)
{
pjsua_acc *acc = (pjsua_acc*) param->token;
if (param->code / 100 != 2 || param->status != PJ_SUCCESS)
{
pjsip_publishc_destroy(param->pubc);
acc->publish_sess = NULL;
if (param->status != PJ_SUCCESS)
{
char errmsg[PJ_ERR_MSG_SIZE];
pj_strerror(param->status, errmsg, sizeof(errmsg));
PJ_LOG(1,(THIS_FILE,
"Client publication (PUBLISH) failed, status=%d, msg=%s",
param->status, errmsg));
}
else if (param->code == 412)
{
/* 412 (Conditional Request Failed)
 * The PUBLISH refresh has failed, retry with new one.
 */
pjsua_pres_init_publish_acc(acc->index);
}
else
{
PJ_LOG(1,(THIS_FILE,
"Client publication (PUBLISH) failed (%d/%.*s)",
param->code, (int)param->reason.slen,
param->reason.ptr));
}
}
else
{
#ifndef __SYMBIAN32__ 
if (param->expiration == -1)
{
/* Could happen if server "forgot" to include Expires header
 * in the response. We will not renew, so destroy the pubc.
 */
pjsip_publishc_destroy(param->pubc);
acc->publish_sess = NULL;
}
#endif 
}
}

pool method,but it worked.Hope it help.

Regards

2009-10-14 



mylen 

hi,
I have tried the new version with:
http://trac.pjsip.org/repos/ticket/411
but it seems that this issue still doesn't resolved.
the pjsua keep sends publish every 1 sec and does stops..
any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20091014/a1bfeda9/attachment.html>


[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