opensips/opensips.patch.reg

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
parent 382
b972dc20871f
child 547
1c75a8bb0fec
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

michael@377 1 Index: modules/registrar/save.c
michael@377 2 diff -Nau modules/registrar/save.c.orig modules/registrar/save.c
michael@377 3 --- modules/registrar/save.c.orig 2008-08-03 15:53:57.000000000 +0200
michael@377 4 +++ modules/registrar/save.c 2009-03-24 21:44:46.182865192 +0100
michael@397 5 @@ -76,7 +76,7 @@
michael@377 6 struct save_ctx {
michael@377 7 unsigned int flags;
michael@377 8 str aor;
michael@377 9 - unsigned int max_contacts;
michael@377 10 + int max_contacts;
michael@377 11 };
michael@377 12
michael@377 13
michael@397 14 @@ -388,7 +388,7 @@
michael@377 15 if (e == 0)
michael@377 16 continue;
michael@377 17
michael@377 18 - if (_sctx->max_contacts && (num >= _sctx->max_contacts)) {
michael@377 19 + if (_sctx->max_contacts && (num >= abs(_sctx->max_contacts))) {
michael@377 20 if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
michael@377 21 /* we are overflowing the number of maximum contacts,
michael@377 22 so remove the first (oldest) one to prevent this */
michael@397 23 @@ -494,6 +494,7 @@
michael@377 24 contact_t* _c, struct save_ctx *_sctx)
michael@377 25 {
michael@377 26 ucontact_info_t *ci;
michael@377 27 + ucontact_t *ucon = 0;
michael@377 28 ucontact_t* c;
michael@377 29 int e;
michael@377 30 unsigned int cflags;
michael@397 31 @@ -554,7 +555,7 @@
michael@377 32 continue;
michael@377 33
michael@377 34 /* we need to add a new contact -> too many ?? */
michael@377 35 - if (_sctx->max_contacts && num>=_sctx->max_contacts) {
michael@377 36 + if (_sctx->max_contacts && num>=abs(_sctx->max_contacts)) {
michael@377 37 if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
michael@377 38 /* we are overflowing the number of maximum contacts,
michael@377 39 so remove the first (oldest) one to prevent this */
michael@397 40 @@ -581,6 +582,23 @@
michael@377 41 goto error;
michael@377 42 }
michael@377 43
michael@377 44 + /* remove matching contacts or matching Call-ID headers before */
michael@377 45 + /* inserting a new one if indicated by a negative max_contacts */
michael@377 46 + if (_sctx->max_contacts < 0) {
michael@377 47 + for (ucon = _r->contacts; ucon; ucon = ucon->next) {
michael@377 48 + if (((ci->callid->len == ucon->callid.len) && \
michael@377 49 + !memcmp(ci->callid->s, ucon->callid.s, ci->callid->len)) \
michael@377 50 + || \
michael@377 51 + ((_c->uri.len==ucon->c.len) && \
michael@377 52 + !memcmp(_c->uri.s, ucon->c.s, _c->len))) {
michael@377 53 + if (ul.delete_ucontact(_r, ucon) < 0) {
michael@377 54 + rerrno = R_UL_DEL_C;
michael@377 55 + LM_ERR("failed to delete contact\n");
michael@377 56 + goto error;
michael@377 57 + }
michael@377 58 + }
michael@377 59 + }
michael@377 60 + }
michael@377 61 if (ul.insert_ucontact( _r, &_c->uri, ci, &c) < 0) {
michael@377 62 rerrno = R_UL_INS_C;
michael@377 63 LM_ERR("failed to insert contact\n");
michael@377 64 Index: modules/registrar/sip_msg.c
michael@377 65 diff -Nau modules/registrar/sip_msg.c.orig modules/registrar/sip_msg.c
michael@377 66 --- modules/registrar/sip_msg.c.orig 2008-08-03 15:53:57.000000000 +0200
michael@377 67 +++ modules/registrar/sip_msg.c 2009-03-24 21:44:46.182865192 +0100
michael@377 68 @@ -137,7 +137,7 @@
michael@377 69 /* Message without contacts is OK */
michael@377 70 if (_m->contact == 0) return 0;
michael@377 71
michael@377 72 - if (((contact_body_t*)_m->contact->parsed)->star == 1) {
michael@377 73 + if (((contact_body_t*)_m->contact->parsed)->star == -1) {
michael@377 74 /* The first Contact HF is star */
michael@377 75 /* Expires must be zero */
michael@377 76 if (get_expires_hf(_m) > 0) {
michael@377 77 @@ -167,7 +167,7 @@
michael@377 78 p = _m->contact->next;
michael@377 79 while(p) {
michael@377 80 if (p->type == HDR_CONTACT_T) {
michael@377 81 - if (((contact_body_t*)p->parsed)->star == 1) {
michael@377 82 + if (((contact_body_t*)p->parsed)->star == -1) {
michael@377 83 rerrno = R_STAR_CONT;
michael@377 84 return 1;
michael@377 85 }

mercurial