Module: kamailio Branch: master Commit: 8cb948cc07e2d577cdd14efdfe38f3e9bbf11d79 URL: https://github.com/kamailio/kamailio/commit/8cb948cc07e2d577cdd14efdfe38f3e9...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2022-08-30T13:34:38+02:00
dialog: fetch directly the int value for dlg variable used in dlg_cseq_update()
---
Modified: src/modules/dialog/dlg_cseq.c
---
Diff: https://github.com/kamailio/kamailio/commit/8cb948cc07e2d577cdd14efdfe38f3e9... Patch: https://github.com/kamailio/kamailio/commit/8cb948cc07e2d577cdd14efdfe38f3e9...
---
diff --git a/src/modules/dialog/dlg_cseq.c b/src/modules/dialog/dlg_cseq.c index c81cf904d4..e5555441fe 100644 --- a/src/modules/dialog/dlg_cseq.c +++ b/src/modules/dialog/dlg_cseq.c @@ -131,7 +131,6 @@ int dlg_cseq_update(sip_msg_t *msg) unsigned int ninc = 0; unsigned int vinc = 0; str nval; - str *pval; sr_cfgenv_t *cenv = NULL;
if(dlg_cseq_prepare_msg(msg)!=0) { @@ -164,16 +163,10 @@ int dlg_cseq_update(sip_msg_t *msg) /* take the increment value from dialog */ if((dlg->iflags&DLG_IFLAG_CSEQ_DIFF)==DLG_IFLAG_CSEQ_DIFF) { /* get dialog variable holding cseq diff */ - pval = get_dlg_variable(dlg, &_dlg_cseq_diff_var_name); - if(pval==NULL || pval->s==NULL || pval->len<=0) { + if(get_dlg_variable_uintval(dlg, &_dlg_cseq_diff_var_name, &vinc) < 0) { LM_DBG("dialog marked with cseq diff but no variable set yet\n"); goto done; } - if(str2int(pval, &vinc)<0) { - LM_ERR("invalid dlg cseq diff var value: %.*s\n", - pval->len, pval->s); - goto done; - } } vinc += ninc; if(vinc==0) {