Skip to content

Commit

Permalink
PT-1: fix documentation conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
denodaeus committed Jul 16, 2013
2 parents 596fda3 + 726621c commit caabedf
Show file tree
Hide file tree
Showing 31 changed files with 187 additions and 115 deletions.
2 changes: 1 addition & 1 deletion Makefile.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#db_perlvdb= Provides a virtualization framework for OpenSIPS's database access. | Perl library development files, tipically libperl-dev
#db_postgres= Provides Postgres connectivity for OpenSIPS | PostgreSQL library and development library - tipically libpq5 and libpq-dev
#db_unixodbc= Allows to use the unixodbc package with OpenSIPS | ODBC library and ODBC development library
#dialplan= Implements generic string translations based on matching and replacement rules | PCRE development library, tipically libpre-dev
#dialplan= Implements generic string translations based on matching and replacement rules | PCRE development library, tipically libpcre-dev
#event_rabbitmq= Provides the implementation of a RabbitMQ client for the Event Interface | RabbitMQ development library, librabbitmq-dev
#h350= Enables access to SIP account data stored in an LDAP [RFC4510] directory containing H.350 commObjects | OpenLDAP library & development files, tipically libldap and libldap-dev
#regex= Offers matching operations against regular expressions using the powerful PCRE library. | Development library for PCRE, tipically libpcre-dev
Expand Down
2 changes: 1 addition & 1 deletion doc/entities.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!ENTITY osipssol "<ulink url='http://www.opensips-solutions.com/'>www.opensips-solutions.com</ulink>">

<!ENTITY osipshome "http://www.opensips.org/">
<!ENTITY osipsbugs "http://sourceforge.net/tracker/?group_id=232389">
<!ENTITY osipsbugs "https://github.com/OpenSIPS/opensips/issues">
<!ENTITY osipshelp "http://lists.opensips.org/cgi-bin/mailman/listinfo/users">
<!ENTITY osipsusers "http://lists.opensips.org/cgi-bin/mailman/listinfo/users">
<!ENTITY osipsdev "http://lists.opensips.org/cgi-bin/mailman/listinfo/devel">
Expand Down
5 changes: 2 additions & 3 deletions modules/acc/README
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Irina-Maria Stanescu

Copyright © 2009-2013 OpenSIPS Solutions>
Revision History
Revision $Revision$ $Date: 2012-02-22 19:29:43 +0200
(Wed, 22 Feb 2012) $
Revision $Revision: 8740 $ $Date$
__________________________________________________________

Table of Contents
Expand Down Expand Up @@ -1202,4 +1201,4 @@ Chapter 2. Frequently Asked Questions
How can I report a bug?

Please follow the guidelines provided at:
http://sourceforge.net/tracker/?group_id=232389.
https://github.com/OpenSIPS/opensips/issues.
2 changes: 1 addition & 1 deletion modules/alias_db/README
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ Chapter 2. Frequently Asked Questions
How can I report a bug?

Please follow the guidelines provided at:
http://sourceforge.net/tracker/?group_id=232389.
https://github.com/OpenSIPS/opensips/issues.
14 changes: 9 additions & 5 deletions modules/auth_db/authorize.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ static inline int get_ha1(struct username* _username, str* _domain,
db_val_t vals[2];
db_key_t *col;
str result;
static db_ps_t auth_ps = NULL;
static db_ps_t auth_ha1_ps = NULL;
static db_ps_t auth_ha1b_ps = NULL;

int n, nc;

Expand All @@ -75,8 +76,13 @@ static inline int get_ha1(struct username* _username, str* _domain,
keys[1] = &domain_column;

/* should we calculate the HA1, and is it calculated with domain? */
col[0] = (_username->domain.len && !calc_ha1) ?
(&pass_column_2) : (&pass_column);
if (_username->domain.len && !calc_ha1) {
col[0] = &pass_column_2 ;
CON_PS_REFERENCE(auth_db_handle) = &auth_ha1b_ps;
} else {
col[0] = &pass_column;
CON_PS_REFERENCE(auth_db_handle) = &auth_ha1_ps;
}

for (n = 0, cred=credentials; cred ; n++, cred=cred->next) {
col[1 + n] = &cred->attr_name;
Expand All @@ -100,8 +106,6 @@ static inline int get_ha1(struct username* _username, str* _domain,
return -1;
}

CON_PS_REFERENCE(auth_db_handle) = &auth_ps;

n = (use_domain ? 2 : 1);
nc = 1 + credentials_n;
if (auth_dbf.query(auth_db_handle, keys, 0, vals, col, n, nc, 0, res) < 0) {
Expand Down
3 changes: 2 additions & 1 deletion modules/cachedb_mongodb/README
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ Chapter 1. Admin Guide
http://oss.metaparadigm.com/json-c/
* mongo-c-driver
The mongo C driver can be downloaded from
https://github.com/mongodb/mongo-c-driver
https://github.com/mongodb/mongo-c-driver Note : Please use
the 0.6 version of the driver

1.5. Exported Parameters

Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_mongodb/doc/cachedb_mongodb_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@

<para>
The mongo C driver can be downloaded from https://github.com/mongodb/mongo-c-driver
Note : Please use the 0.6 version of the driver
</para>

</listitem>
Expand Down
5 changes: 4 additions & 1 deletion modules/cachedb_redis/README
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ Chapter 1. Admin Guide
The following libraries or applications must be installed
before running OpenSIPS with this module loaded:
* hiredis:
hiredis can be downloaded from:
On the latest Debian based distributions, hiredis can be
installed by running 'apt-get install libhiredis-dev'
Alternatively, if hiredis is not available on your OS
repos, hiredis can be downloaded from:
https://github.com/antirez/hiredis . Download the archive,
extract sources, run make,sudo make install.

Expand Down
4 changes: 4 additions & 0 deletions modules/cachedb_redis/doc/cachedb_redis_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
</para>

<para>
On the latest Debian based distributions, hiredis can be installed
by running 'apt-get install libhiredis-dev'

Alternatively, if hiredis is not available on your OS repos,
hiredis can be downloaded from: https://github.com/antirez/hiredis .
Download the archive, extract sources, run make,sudo make install.
</para>
Expand Down
20 changes: 18 additions & 2 deletions modules/db_oracle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,29 @@ ifeq ($(ORAPATH),)
echo $(SYSBASE)/lib64/oracle$(ORAVERDIR) )
endif
ifeq ($(ORAPATH),)
ORAPATH=$(shell [ -f $(SYSBASE)/lib/oracle$(ORAVERDIR)/libocci.so ] && \
echo $(SYSBASE)/lib/oracle$(ORAVERDIR) )
ORAPATH=$(shell [ -f $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/lib/libocci.so ] && \
echo $(LOCALBASE)/lib64/oracle$(ORAVERDIR)/lib )
endif
ifeq ($(ORAPATH),)
ORAPATH=$(shell [ -f $(SYSBASE)/lib64/oracle$(ORAVERDIR)/lib/libocci.so ] && \
echo $(SYSBASE)/lib64/oracle$(ORAVERDIR)/lib )
endif
ifeq ($(ORAPATH),)
ORAPATH=$(shell [ -f $(LOCALBASE)/lib/oracle$(ORAVERDIR)/libocci.so ] && \
echo $(LOCALBASE)/lib/oracle$(ORAVERDIR) )
endif
ifeq ($(ORAPATH),)
ORAPATH=$(shell [ -f $(SYSBASE)/lib/oracle$(ORAVERDIR)/libocci.so ] && \
echo $(SYSBASE)/lib/oracle$(ORAVERDIR) )
endif
ifeq ($(ORAPATH),)
ORAPATH=$(shell [ -f $(LOCALBASE)/lib/oracle$(ORAVERDIR)/lib/libocci.so ] && \
echo $(LOCALBASE)/lib/oracle$(ORAVERDIR)/lib )
endif
ifeq ($(ORAPATH),)
ORAPATH=$(shell [ -f $(SYSBASE)/lib/oracle$(ORAVERDIR)/lib/libocci.so ] && \
echo $(SYSBASE)/lib/oracle$(ORAVERDIR)/lib )
endif

ifneq ($(ORAPATH),)
LIBS +=-L$(ORAPATH)
Expand Down
5 changes: 2 additions & 3 deletions modules/dialog/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Vladut-Stefan Paiu

Copyright © 2006-2009 Voice Sistem SRL
Revision History
Revision $Revision$ $Date: 2012-03-08 11:33:05 +0200
(Thu, 08 Mar 2012) $
Revision $Revision: 8771 $ $Date$
__________________________________________________________

Table of Contents
Expand Down Expand Up @@ -1645,4 +1644,4 @@ Chapter 3. Frequently Asked Questions
How can I report a bug?

Please follow the guidelines provided at:
http://sourceforge.net/tracker/?group_id=232389.
https://github.com/OpenSIPS/opensips/issues.
53 changes: 43 additions & 10 deletions modules/dialog/dlg_db_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ static inline char* read_pair(char *b, char *end, str *name, str *val)
return (b==end)?NULL:b;
}


/* The function is always considered to be lock-less ( safe )
* it's either called when dialog is not linked yes, or is under the dialog lock */
static void read_dialog_vars(char *b, int l, struct dlg_cell *dlg)
{
str name, val;
Expand All @@ -379,7 +380,7 @@ static void read_dialog_vars(char *b, int l, struct dlg_cell *dlg)
LM_DBG("new var found <%.*s>=<%.*s>\n",name.len,name.s,val.len,val.s);

/* add the variable */
if (store_dlg_value( dlg, &name, &val)!=0)
if (store_dlg_value_unsafe( dlg, &name, &val)!=0)
LM_ERR("failed to add val, skipping...\n");
} while(p!=end);

Expand All @@ -390,10 +391,11 @@ static void read_dialog_profiles(char *b, int l, struct dlg_cell *dlg,int double
{
struct dlg_profile_table *profile;
struct dlg_profile_link *it;
str name, val;
str name, val,double_check_name;
char *end;
char *p;
char *p,*s,*e;
char bk;
int use_cached;

end = b + l;
p = b;
Expand All @@ -407,9 +409,29 @@ static void read_dialog_profiles(char *b, int l, struct dlg_cell *dlg,int double
LM_DBG("new profile found <%.*s>=<%.*s>\n",name.len,name.s,val.len,val.s);

if (double_check) {
LM_DBG("Double checking profile - if it exists we'll skip it \n");
use_cached = 0;

/* check if this is a shared profile, and remove /s for manual
* matching */
double_check_name = name;
s = memchr(name.s, '/', name.len);

if (s) {
e = double_check_name.s + double_check_name.len;
double_check_name.len = s - double_check_name.s;
trim_spaces_lr( double_check_name );
/* skip spaces after p */
for (++s; *s == ' ' && s < e; s++);
if ( s < e && *s == 's')
use_cached=1;
}

for (it=dlg->profile_links;it;it=it->next) {
if (it->profile->name.len == name.len &&
memcmp(it->profile->name.s,name.s,name.len) == 0) {
if (it->profile->use_cached == use_cached &&
it->profile->name.len == double_check_name.len &&
memcmp(it->profile->name.s,double_check_name.s,
double_check_name.len) == 0) {
LM_DBG("Profile is already linked into the dlg\n");
goto next;
}
Expand Down Expand Up @@ -1006,7 +1028,8 @@ int update_dialog_dbinfo(struct dlg_cell * cell)
}


static inline unsigned int write_pair( char *b, str *name, str *val)
static inline unsigned int write_pair( char *b, str *name, str *name_suffix,
str *val)
{
int i,j;

Expand All @@ -1015,6 +1038,10 @@ static inline unsigned int write_pair( char *b, str *name, str *val)
b[j++] = '\\';
b[j++] = name->s[i];
}
if (name_suffix) {
memcpy(b+j,name_suffix->s,name_suffix->len);
j+=name_suffix->len;
}
b[j++] = '#';
for( i=0 ; val && i<val->len ; i++) {
if (val->s[i]=='|' || val->s[i]=='#' || val->s[i]=='\\')
Expand Down Expand Up @@ -1059,7 +1086,7 @@ static str* write_dialog_vars( struct dlg_val *vars)
o.len = l;
p = o.s;
for ( v=vars ; v ; v=v->next) {
p += write_pair( p, &v->name, &v->val);
p += write_pair( p, &v->name,NULL, &v->val);
}
if (o.len!=p-o.s) {
LM_CRIT("BUG - buffer overflow allocated %d, written %d\n",
Expand All @@ -1074,7 +1101,7 @@ static str* write_dialog_vars( struct dlg_val *vars)

static str* write_dialog_profiles( struct dlg_profile_link *links)
{
static str o = {NULL,0};
static str o = {NULL,0},cached_marker={"/s",2};
static int o_l = 0;
struct dlg_profile_link *link;
unsigned int l,i;
Expand All @@ -1089,6 +1116,8 @@ static str* write_dialog_profiles( struct dlg_profile_link *links)
for( i=0 ; i<link->value.len ; i++ )
if (link->value.s[i]=='|' || link->value.s[i]=='#'
|| link->value.s[i]=='\\') l++;
if (link->profile->use_cached)
l+=cached_marker.len;
}

/* allocate the string to be stored */
Expand All @@ -1106,7 +1135,11 @@ static str* write_dialog_profiles( struct dlg_profile_link *links)
o.len = l;
p = o.s;
for ( link=links; link ; link=link->next) {
p += write_pair( p, &link->profile->name, &link->value);
if (link->profile->use_cached)
p += write_pair( p, &link->profile->name, &cached_marker,
&link->value);
else
p += write_pair( p, &link->profile->name, NULL, &link->value);
}
if (o.len!=p-o.s) {
LM_CRIT("BUG - buffer overflow allocated %d, written %d\n",
Expand Down
48 changes: 26 additions & 22 deletions modules/dialog/dlg_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,15 @@ static int dlg_fill_value(str *name, str *value)
LM_ERR("cannot realloc profile with value buffer\n");
return -1;
}

dlg_prof_val_buf.s = buf;
dlg_prof_val_buf.len = cdb_val_prefix.len;

DLG_COPY(dlg_prof_val_buf, name);
DLG_COPY(dlg_prof_val_buf, &dlg_prof_sep);
base64encode((unsigned char*)dlg_prof_val_buf.s + dlg_prof_val_buf.len,
(unsigned char *)value->s, value->len);

dlg_prof_val_buf.len += val_len;

return 0;
Expand Down Expand Up @@ -304,28 +306,7 @@ int init_cachedb(void)
LM_ERR("cannot connect to cachedb_url %.*s\n", cdb_url.len, cdb_url.s);
return -1;
}
dlg_prof_val_buf.s = pkg_malloc(cdb_val_prefix.len + 32);
if (!dlg_prof_val_buf.s) {
LM_ERR("no more memory to allocate buffer\n");
return -1;
}

dlg_prof_noval_buf.s = pkg_malloc(cdb_noval_prefix.len + 32);
if (!dlg_prof_noval_buf.s) {
LM_ERR("no more memory to allocate buffer\n");
return -1;
}

dlg_prof_size_buf.s = pkg_malloc(cdb_size_prefix.len + 32);
if (!dlg_prof_size_buf.s) {
LM_ERR("no more memory to allocate buffer\n");
return -1;
}

/* copy prefixes in buffer */
memcpy(dlg_prof_val_buf.s, cdb_val_prefix.s, cdb_val_prefix.len);
memcpy(dlg_prof_noval_buf.s, cdb_noval_prefix.s, cdb_noval_prefix.len);
memcpy(dlg_prof_size_buf.s, cdb_size_prefix.s, cdb_size_prefix.len);
LM_DBG("Inited cachedb \n");
return 0;
}

Expand Down Expand Up @@ -368,6 +349,29 @@ int init_cachedb_utils(void)
return -1;
}

dlg_prof_val_buf.s = pkg_malloc(cdb_val_prefix.len + 32);
if (!dlg_prof_val_buf.s) {
LM_ERR("no more memory to allocate buffer\n");
return -1;
}

dlg_prof_noval_buf.s = pkg_malloc(cdb_noval_prefix.len + 32);
if (!dlg_prof_noval_buf.s) {
LM_ERR("no more memory to allocate buffer\n");
return -1;
}

dlg_prof_size_buf.s = pkg_malloc(cdb_size_prefix.len + 32);
if (!dlg_prof_size_buf.s) {
LM_ERR("no more memory to allocate buffer\n");
return -1;
}

/* copy prefixes in buffer */
memcpy(dlg_prof_val_buf.s, cdb_val_prefix.s, cdb_val_prefix.len);
memcpy(dlg_prof_noval_buf.s, cdb_noval_prefix.s, cdb_noval_prefix.len);
memcpy(dlg_prof_size_buf.s, cdb_size_prefix.s, cdb_size_prefix.len);

return 0;
}

Expand Down
Loading

0 comments on commit caabedf

Please sign in to comment.