From 99b817f05dce76ff81548bd56548971cb2be29b9 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 8 Aug 2006 14:04:21 +0000 Subject: Fixed bugs in client registration (sip_regc.c): when re-registration failed to send the request, application callback is not called. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@663 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-ua/sip_reg.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'pjsip/src') diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c index 411b5783..b61fa469 100644 --- a/pjsip/src/pjsip-ua/sip_reg.c +++ b/pjsip/src/pjsip-ua/sip_reg.c @@ -469,8 +469,10 @@ static void regc_refresh_timer_cb( pj_timer_heap_t *timer_heap, entry->id = 0; status = pjsip_regc_register(regc, 1, &tdata); if (status == PJ_SUCCESS) { - pjsip_regc_send(regc, tdata); - } else { + status = pjsip_regc_send(regc, tdata); + } + + if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg)); call_callback(regc, status, 400, &reason, NULL, -1, 0, NULL); @@ -507,13 +509,17 @@ static void tsx_callback(void *token, pjsip_event *event) &tdata); if (status == PJ_SUCCESS) { - pjsip_regc_send(regc, tdata); - return; - } else { + status = pjsip_regc_send(regc, tdata); + } + + if (status != PJ_SUCCESS) { call_callback(regc, status, tsx->status_code, &rdata->msg_info.msg->line.status.reason, rdata, -1, 0, NULL); } + + return; + } else { int contact_cnt = 0; pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; -- cgit v1.2.3