Skip to content

Commit

Permalink
Fix computing the cseq for a branch.
Browse files Browse the repository at this point in the history
Instead of assuming a +1 increment (to the cseq from request), better copy the cseq from the received reply.
Thanks to @razvancrainea for the brainstorming.

(cherry picked from commit b7b22d6)
  • Loading branch information
bogdan-iancu committed Feb 18, 2020
1 parent 48d6f6c commit 18612de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/dialog/dlg_handlers.c
Expand Up @@ -391,11 +391,10 @@ static inline void push_reply_in_dialog(struct sip_msg *rpl, struct cell* t,

if (dlg->flags & DLG_FLAG_CSEQ_ENFORCE) {
/* increase all future requests going to this leg */
if (str2int(&(((struct cseq_body *)t->uas.request->cseq->parsed)->number),&cseq_no) < 0) {
if (str2int( &(get_cseq(rpl)->number), &cseq_no) < 0) {
LM_ERR("Failed to convert cseq to integer \n");
} else {
/* XXX - fix this */
dlg->legs[dlg->legs_no[DLG_LEG_200OK]].last_gen_cseq = cseq_no + 1;
dlg->legs[dlg->legs_no[DLG_LEG_200OK]].last_gen_cseq = cseq_no;
}
}

Expand Down

0 comments on commit 18612de

Please sign in to comment.