kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
August 2013
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
29 participants
148 discussions
Start a n
N
ew thread
git:4.0: db_flatstore: free id pointer if no more space for table name
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: d2f62dd1855faef35bea8eff932d250557868ae5 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d2f62dd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Aug 1 15:58:59 2013 +0200 db_flatstore: free id pointer if no more space for table name - related to previus commit on this module - keep table name null terminated (cherry picked from commit 6a981d3d922c914054d4c8dc7e672bb6a4ddb5f5) --- modules/db_flatstore/km_flat_id.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/modules/db_flatstore/km_flat_id.c b/modules/db_flatstore/km_flat_id.c index 11f9fbe..99f5a8b 100644 --- a/modules/db_flatstore/km_flat_id.c +++ b/modules/db_flatstore/km_flat_id.c @@ -52,9 +52,10 @@ struct flat_id* new_flat_id(char* dir, char* table) /* alloc memory for the table name */ t_len = strlen(table); - t = (char*)pkg_malloc(t_len); + t = (char*)pkg_malloc(t_len+1); if (!t) { LM_ERR("no pkg memory left\n"); + pkg_free(ptr); return 0; } memset(t, 0, t_len); @@ -62,6 +63,7 @@ struct flat_id* new_flat_id(char* dir, char* table) ptr->dir.s = dir; ptr->dir.len = strlen(dir); memcpy(t, table, t_len); + t[t_len] = '\0'; ptr->table.s = t; ptr->table.len = t_len;
11 years, 3 months
1
0
0
0
git:4.0: uac_redirect: fixup for using acc table parameter
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: 76b82480f74006d830afc9c9ae81ada25dbc7730 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=76b8248…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Fri Jul 26 14:52:21 2013 +0200 uac_redirect: fixup for using acc table parameter - set reason parameter for acc function - based on a patch by Federico Cabiddu, FS#327 (cherry picked from commit 3d33733f299dda595704108aef73a2912dc3069f) --- modules/uac_redirect/rd_funcs.c | 4 +++ modules/uac_redirect/redirect.c | 40 +++++++++++++++++++++++--------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/modules/uac_redirect/rd_funcs.c b/modules/uac_redirect/rd_funcs.c index 69e6f31..19b4dad 100644 --- a/modules/uac_redirect/rd_funcs.c +++ b/modules/uac_redirect/rd_funcs.c @@ -57,6 +57,7 @@ int get_redirect( struct sip_msg *msg , int maxt, int maxb, int n; int i; int first_branch; + char code_buf[INT2STR_MAX_LEN]; /* get transaction */ t = rd_tmb.t_gett(); @@ -95,6 +96,9 @@ int get_redirect( struct sip_msg *msg , int maxt, int maxb, } if (max==0) continue; + /* put the response code into the acc_param reason struct */ + reason->code = t->uac[i].last_received; + reason->code_s.s = int2bstr((unsigned long)reason->code, code_buf, &reason->code_s.len); /* get the contact from it */ n = shmcontact2dset( msg, t->uac[i].reply, max, reason, bflags); if ( n<0 ) { diff --git a/modules/uac_redirect/redirect.c b/modules/uac_redirect/redirect.c index b4e55d1..48dec84 100644 --- a/modules/uac_redirect/redirect.c +++ b/modules/uac_redirect/redirect.c @@ -164,25 +164,24 @@ static int get_redirect_fixup(void** param, int param_no) pkg_free(*param); *param=(void*)(long)( (((unsigned short)maxt)<<8) | maxb); - } else if (param_no==2) { /* acc function loaded? */ - if (rd_acc_fct!=0) - return 0; - /* must import the acc stuff */ - if (acc_fct_s==0 || acc_fct_s[0]==0) { - LM_ERR("acc support enabled, but no acc function defined\n"); - return E_UNSPEC; - } - fct = find_export(acc_fct_s, 2, REQUEST_ROUTE); - if ( fct==0 ) - fct = find_export(acc_fct_s, 1, REQUEST_ROUTE); - if ( fct==0 ) { - LM_ERR("cannot import %s function; is acc loaded and proper " - "compiled?\n", acc_fct_s); - return E_UNSPEC; + if (rd_acc_fct==0) { + /* must import the acc stuff */ + if (acc_fct_s==0 || acc_fct_s[0]==0) { + LM_ERR("acc support enabled, but no acc function defined\n"); + return E_UNSPEC; + } + fct = find_export(acc_fct_s, 2, REQUEST_ROUTE); + if ( fct==0 ) + fct = find_export(acc_fct_s, 1, REQUEST_ROUTE); + if ( fct==0 ) { + LM_ERR("cannot import %s function; is acc loaded and proper " + "compiled?\n", acc_fct_s); + return E_UNSPEC; + } + rd_acc_fct = fct; } - rd_acc_fct = fct; /* set the reason str */ accp = (struct acc_param*)pkg_malloc(sizeof(struct acc_param)); if (accp==0) { @@ -264,6 +263,7 @@ static int regexp_compile(char *re_s, regex_t **re) static int redirect_init(void) { regex_t *filter; + void *p; /* load the TM API */ if (load_tm_api(&rd_tmb)!=0) { @@ -271,6 +271,14 @@ static int redirect_init(void) goto error; } + p = (void*)acc_db_table; + /* fixup table name */ + if(fixup_var_pve_str_12(&p, 1)<0) { + LM_ERR("failed to fixup acc db table\n"); + goto error; + } + acc_db_table = p; + /* init filter */ init_filters();
11 years, 3 months
1
0
0
0
git:4.0: acc: safety check for accounted values not to be NULL
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: ea266beb3d678b36efeb82feeba6087df90d9f19 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ea266be…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Fri Jul 26 14:55:38 2013 +0200 acc: safety check for accounted values not to be NULL - based on a patch by Federico Cabiddu, FS#327 (cherry picked from commit fb3a5f7022ebd20fc516b5b8303a0274bda18258) --- modules/acc/acc.c | 16 ++++++++++------ modules/acc/acc_logic.c | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/acc/acc.c b/modules/acc/acc.c index d4fd89c..0a563d6 100644 --- a/modules/acc/acc.c +++ b/modules/acc/acc.c @@ -241,13 +241,15 @@ int acc_log_request( struct sip_msg *rq) memcpy(p, log_attrs[i].s, log_attrs[i].len); p += log_attrs[i].len; *(p++) = A_EQ_CHR; - memcpy(p, val_arr[i].s, val_arr[i].len); - p += val_arr[i].len; + if (val_arr[i].s != NULL) { + memcpy(p, val_arr[i].s, val_arr[i].len); + p += val_arr[i].len; + } } /* get per leg attributes */ if ( leg_info ) { - n = legs2strar(leg_info,rq,val_arr+m,int_arr+m,type_arr+m, 1); + n = legs2strar(leg_info,rq,val_arr+m,int_arr+m,type_arr+m, 1); do { for (i=m; i<m+n; i++) { if (p+1+log_attrs[i].len+1+val_arr[i].len >= log_msg_end) { @@ -259,10 +261,12 @@ int acc_log_request( struct sip_msg *rq) memcpy(p, log_attrs[i].s, log_attrs[i].len); p += log_attrs[i].len; *(p++) = A_EQ_CHR; - memcpy(p, val_arr[i].s, val_arr[i].len); - p += val_arr[i].len; + if (val_arr[i].s != NULL) { + memcpy(p, val_arr[i].s, val_arr[i].len); + p += val_arr[i].len; + } } - }while (p!=log_msg_end && (n=legs2strar(leg_info,rq,val_arr+m, + } while (p!=log_msg_end && (n=legs2strar(leg_info,rq,val_arr+m, int_arr+m,type_arr+m, 0))!=0); } diff --git a/modules/acc/acc_logic.c b/modules/acc/acc_logic.c index f2efaa7..55b4196 100644 --- a/modules/acc/acc_logic.c +++ b/modules/acc/acc_logic.c @@ -220,7 +220,7 @@ int w_acc_db_request(struct sip_msg *rq, char *comment, char *table) if(acc_db_set_table_name(rq, (void*)table, NULL)<0) { LM_ERR("cannot set table name\n"); return -1; - } + } env_set_to( rq->to ); env_set_comment((struct acc_param*)comment); return acc_db_request(rq);
11 years, 3 months
1
0
0
0
git:4.0: acc: acc_db_set_table_name fixup
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: ece14d42fda4baefc4f0e8465faad17b678a6a4b URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ece14d4…
Author: Federico Cabiddu <fcabiddu(a)orange-vallee.net> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Mon Jul 29 07:59:13 2013 +0200 acc: acc_db_set_table_name fixup - add termination char to db_table_name_buf (cherry picked from commit 7ba6cbfcaf70cb546ea3a9f148a0f0b0bc38c16d) --- modules/acc/acc_logic.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules/acc/acc_logic.c b/modules/acc/acc_logic.c index 55b4196..c9bdd20 100644 --- a/modules/acc/acc_logic.c +++ b/modules/acc/acc_logic.c @@ -197,6 +197,8 @@ int acc_db_set_table_name(struct sip_msg *msg, void *param, str *table) return -1; } strncpy(db_table_name_buf, dbtable.s, dbtable.len); + /* FS#327: since the buffer is static terminate the table name */ + db_table_name_buf[dbtable.len] = '\0'; env_set_text(db_table_name_buf, dbtable.len); } else { if(table==NULL) {
11 years, 3 months
1
0
0
0
git:4.0: db_flatstore: fixup for new_flat_id function
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: c50d559b4da94238a430c059dd02d74e63dd96fe URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c50d559…
Author: Federico Cabiddu <fcabiddu(a)orange-vallee.net> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Mon Jul 29 07:59:34 2013 +0200 db_flatstore: fixup for new_flat_id function - locally copy table's name (cherry picked from commit 8fb0f711aaa611eac8b2776c7e5ae3c5e19243ac) --- modules/db_flatstore/km_flat_id.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/db_flatstore/km_flat_id.c b/modules/db_flatstore/km_flat_id.c index 3294528..11f9fbe 100644 --- a/modules/db_flatstore/km_flat_id.c +++ b/modules/db_flatstore/km_flat_id.c @@ -35,6 +35,8 @@ struct flat_id* new_flat_id(char* dir, char* table) { struct flat_id* ptr; + char* t; + int t_len; if (!dir || !table) { LM_ERR("invalid parameter(s)\n"); @@ -48,10 +50,20 @@ struct flat_id* new_flat_id(char* dir, char* table) } memset(ptr, 0, sizeof(struct flat_id)); + /* alloc memory for the table name */ + t_len = strlen(table); + t = (char*)pkg_malloc(t_len); + if (!t) { + LM_ERR("no pkg memory left\n"); + return 0; + } + memset(t, 0, t_len); + ptr->dir.s = dir; ptr->dir.len = strlen(dir); - ptr->table.s = table; - ptr->table.len = strlen(table); + memcpy(t, table, t_len); + ptr->table.s = t; + ptr->table.len = t_len; return ptr; } @@ -78,5 +90,7 @@ unsigned char cmp_flat_id(struct flat_id* id1, struct flat_id* id2) void free_flat_id(struct flat_id* id) { if (!id) return; + if (id->table.s) + pkg_free(id->table.s); pkg_free(id); }
11 years, 3 months
1
0
0
0
git:4.0: dialog: detect if no trasaction is created after config execution for new dialogs
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: 9f0a42dd31d765541c02d2b818dd52643589f59d URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9f0a42d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Tue Jul 2 23:32:37 2013 +0200 dialog: detect if no trasaction is created after config execution for new dialogs - release the dialog to avoid endless storage in state 1 (cherry picked from commit fa0339b1906690f009786fc9ed92c73a8c9e6520) --- modules/dialog/dlg_handlers.c | 10 +++++++++- modules/dialog/dlg_var.c | 14 +++++++++++++- modules/dialog/dlg_var.h | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c index ec55a13..9393d7f 100644 --- a/modules/dialog/dlg_handlers.c +++ b/modules/dialog/dlg_handlers.c @@ -721,11 +721,14 @@ void dlg_onreq(struct cell* t, int type, struct tmcb_params *param) if (dlg==NULL) { if((req->flags&dlg_flag)!=dlg_flag) return; + LM_DBG("dialog creation on config flag\n"); dlg_new_dialog(req, t, 1); dlg = dlg_get_ctx_dialog(); } if (dlg!=NULL) { + LM_DBG("dialog added to tm callbacks\n"); dlg_set_tm_callbacks(t, req, dlg, spiral_detected); + _dlg_ctx.t = 1; dlg_release(dlg); } } @@ -1515,8 +1518,13 @@ int dlg_manage(sip_msg_t *msg) dlg = dlg_get_ctx_dialog(); if(dlg==NULL) return -1; - if(t!=NULL) + if(t!=NULL) { dlg_set_tm_callbacks(t, msg, dlg, spiral_detected); + _dlg_ctx.t = 1; + LM_DBG("dialog created on existing transaction\n"); + } else { + LM_DBG("dialog created before transaction\n"); + } dlg_release(dlg); } return 1; diff --git a/modules/dialog/dlg_var.c b/modules/dialog/dlg_var.c index 108af0f..0d8a1c7 100644 --- a/modules/dialog/dlg_var.c +++ b/modules/dialog/dlg_var.c @@ -22,6 +22,7 @@ */ #include "../../route.h" +#include "../../script_cb.h" #include "../../pvapi.h" #include "dlg_var.h" @@ -38,8 +39,19 @@ struct dlg_var * var_table = 0; /*! ID of the current message */ int msg_id; -int dlg_cfg_cb(struct sip_msg *foo, unsigned int flags, void *bar) +int dlg_cfg_cb(sip_msg_t *msg, unsigned int flags, void *cbp) { + dlg_cell_t *dlg; + if(flags&POST_SCRIPT_CB) { + dlg = dlg_get_ctx_dialog(); + if(dlg!=NULL) { + if(_dlg_ctx.t==0 && dlg->state==DLG_STATE_UNCONFIRMED) { + LM_DBG("new dialog with no trasaction after config execution\n"); + dlg_release(dlg); + } + dlg_release(dlg); + } + } memset(&_dlg_ctx, 0, sizeof(dlg_ctx_t)); return 1; diff --git a/modules/dialog/dlg_var.h b/modules/dialog/dlg_var.h index 9648ab2..ec2c9c7 100644 --- a/modules/dialog/dlg_var.h +++ b/modules/dialog/dlg_var.h @@ -41,6 +41,7 @@ typedef struct _dlg_ctx { dlg_iuid_t iuid; int set; unsigned int dir; + int t; } dlg_ctx_t; /* A dialog-variable */
11 years, 3 months
1
0
0
0
git:4.0: dialog: increment cseq in early stage for PRACK and UPDATE
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: 369164c689950595b7e35c36a810ecd41aaa7a0a URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=369164c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Mon Jul 1 15:22:33 2013 +0200 dialog: increment cseq in early stage for PRACK and UPDATE - rework from a patch by Halina Nowak (cherry picked from commit 6cf3ab0ca6f38d1d2e60dbc644bb4d2fb563919a) --- modules/dialog/dlg_handlers.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c index 338dc44..ec55a13 100644 --- a/modules/dialog/dlg_handlers.c +++ b/modules/dialog/dlg_handlers.c @@ -1249,21 +1249,28 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param) } if ( (event==DLG_EVENT_REQ || event==DLG_EVENT_REQACK) - && new_state==DLG_STATE_CONFIRMED) { + && (new_state==DLG_STATE_CONFIRMED || new_state==DLG_STATE_EARLY)) { timeout = get_dlg_timeout(req); if (timeout!=default_timeout) { dlg->lifetime = timeout; } - if (update_dlg_timer( &dlg->tl, dlg->lifetime )==-1) { - LM_ERR("failed to update dialog lifetime\n"); + if (new_state!=DLG_STATE_EARLY) { + if (update_dlg_timer( &dlg->tl, dlg->lifetime )==-1) { + LM_ERR("failed to update dialog lifetime\n"); + } else { + dlg->dflags |= DLG_FLAG_CHANGED; + } } - if (update_cseqs(dlg, req, dir)!=0) { - LM_ERR("cseqs update failed\n"); - } else { - dlg->dflags |= DLG_FLAG_CHANGED; - if ( dlg_db_mode==DB_MODE_REALTIME ) - update_dialog_dbinfo(dlg); + if(event != DLG_EVENT_REQACK) { + if(update_cseqs(dlg, req, dir)!=0) { + LM_ERR("cseqs update failed\n"); + } else { + dlg->dflags |= DLG_FLAG_CHANGED; + } + } + if(dlg_db_mode==DB_MODE_REALTIME && (dlg->dflags&DLG_FLAG_CHANGED)) { + update_dialog_dbinfo(dlg); } if (old_state==DLG_STATE_CONFIRMED_NA) {
11 years, 3 months
1
0
0
0
git:4.0: dialog: fixed callee cseq reference
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: 573096ad14c34364dad160bffd7e7ed5d007f5f6 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=573096a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Mon Jul 1 14:44:45 2013 +0200 dialog: fixed callee cseq reference - part of patch by Halina Nowak (cherry picked from commit ed6dbb0ca11206049bee9ab515ce071eb70e7b63) --- modules/dialog/dlg_handlers.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c index f98f36b..338dc44 100644 --- a/modules/dialog/dlg_handlers.c +++ b/modules/dialog/dlg_handlers.c @@ -220,7 +220,7 @@ int populate_leg_info( struct dlg_cell *dlg, struct sip_msg *msg, cseq = (get_cseq(msg))->number; } else { /* use the same as in request */ - cseq = dlg->cseq[DLG_CALLER_LEG]; + cseq = dlg->cseq[DLG_CALLEE_LEG]; } /* extract the contact address */
11 years, 3 months
1
0
0
0
git:4.0: dialog: avoid realloc of memory for cseq when setting leg info
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: 91f64af86eebde4a179a4d9cb6837994a587a967 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=91f64af…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Mon Jul 1 14:51:03 2013 +0200 dialog: avoid realloc of memory for cseq when setting leg info - free already allocated structs when needed - has part of a patch by Halina Nowak (cherry picked from commit 71d7dc6bc750406d510e0571e05da3966911cfea) --- modules/dialog/dlg_hash.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c index c669290..bba619a 100644 --- a/modules/dialog/dlg_hash.c +++ b/modules/dialog/dlg_hash.c @@ -485,8 +485,19 @@ int dlg_set_leg_info(struct dlg_cell *dlg, str* tag, str *rr, str *contact, { char *p; + if(dlg->tag[leg].s) + shm_free(dlg->tag[leg].s); dlg->tag[leg].s = (char*)shm_malloc( tag->len + rr->len + contact->len ); - dlg->cseq[leg].s = (char*)shm_malloc( cseq->len ); + + if(dlg->cseq[leg].s) { + if (dlg->cseq[leg].len < cseq->len) { + shm_free(dlg->cseq[leg].s); + dlg->cseq[leg].s = (char*)shm_malloc(cseq->len); + } + } else { + dlg->cseq[leg].s = (char*)shm_malloc( cseq->len ); + } + if ( dlg->tag[leg].s==NULL || dlg->cseq[leg].s==NULL) { LM_ERR("no more shm mem\n"); if (dlg->tag[leg].s)
11 years, 3 months
1
0
0
0
git:master: imc: wrap bit shift defines in parenthesis
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: e6e0419a46c3e5127d07c95390931d10b2a01c3b URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e6e0419…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sun Aug 4 14:22:41 2013 +0200 imc: wrap bit shift defines in parenthesis - avoid priority conflicts when using the defines - reported by Shankar --- modules/imc/imc_mng.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/imc/imc_mng.h b/modules/imc/imc_mng.h index ead106f..f707343 100644 --- a/modules/imc/imc_mng.h +++ b/modules/imc/imc_mng.h @@ -37,11 +37,11 @@ #include "../../str.h" #include "../../parser/parse_from.h" -#define IMC_MEMBER_OWNER 1<<0 -#define IMC_MEMBER_ADMIN 1<<1 -#define IMC_MEMBER_INVITED 1<<2 -#define IMC_MEMBER_DELETED 1<<3 -#define IMC_MEMBER_SKIP 1<<4 +#define IMC_MEMBER_OWNER (1<<0) +#define IMC_MEMBER_ADMIN (1<<1) +#define IMC_MEMBER_INVITED (1<<2) +#define IMC_MEMBER_DELETED (1<<3) +#define IMC_MEMBER_SKIP (1<<4) typedef struct _imc_member { @@ -54,8 +54,8 @@ typedef struct _imc_member struct _imc_member * prev; } imc_member_t, *imc_member_p; -#define IMC_ROOM_PRIV 1<<0 -#define IMC_ROOM_DELETED 1<<1 +#define IMC_ROOM_PRIV (1<<0) +#define IMC_ROOM_DELETED (1<<1) typedef struct del_member { str room_name;
11 years, 3 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Results per page:
10
25
50
100
200