diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-08-08 14:04:21 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-08-08 14:04:21 +0000 |
commit | 99b817f05dce76ff81548bd56548971cb2be29b9 (patch) | |
tree | 4ebff22158205fbb495ed10690944f59669d9a1a /pjsip/src/pjsip-ua/sip_reg.c | |
parent | 8c415ec2d5b669f1596a746331b9b8ff6eb4ef91 (diff) |
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
Diffstat (limited to 'pjsip/src/pjsip-ua/sip_reg.c')
-rw-r--r-- | pjsip/src/pjsip-ua/sip_reg.c | 16 |
1 files changed, 11 insertions, 5 deletions
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]; |