On 3/18/08, Anshuman S. Rawat <arawat at 3clogic.com> wrote: > > I don't think I've ever heard any reports similar to this, and I just > > tried with simulating REGISTER timeout with pjsua, the freeze didn't > > happen either. So for now I tend to think it must have something to do > > with your code. What if you remove your timer, does it still freeze? > > > I will show you what I did. This is what I added in function tsx_callback() > in sip_reg.c > > if(tsx->status_code/200 == 2) > { > //do something > } > else > { > rdata = (event->body.tsx_state.type==PJSIP_EVENT_RX_MSG) ? > event->body.tsx_state.src.rdata : NULL; > > //added - Start > pj_time_val delay = { DEFAULT_RETRY_TIME, 0 }; > regc->timer.cb = ®c_refresh_timer_cb; > regc->timer.id = REFRESH_TIMER; > regc->timer.user_data = regc; > if (pjsip_endpt_schedule_timer( regc->endpt, ®c->timer, &delay) != > PJ_SUCCESS) > { > PJ_LOG(5,(THIS_FILE, "pjsip_endpt_schedule_timer FAILED!!")); > } > pj_gettimeofday(®c->last_reg); > regc->next_reg = regc->last_reg; > regc->next_reg.sec += delay.sec; > //added - End > } > > >From what I have seen, with this code pjsip freezes when I get a 404 for > REGISTER (at the 2nd retry). Frankly I disagree with your approach to implement the retry method. IMO, it's best to implement it in the application code rather than modifying pjsip. You just need to check for the appropriate condition in regc callback, schedule the timer, and when the timer elapses perform a fresh registration again. cheers, -benny > Hope you can reproduce it. > > Thanks, > > Anshuman > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >