Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lb_is_destination only accepts pseudo variables as values 2.1 #808

Closed
telephone-man opened this issue Feb 25, 2016 · 3 comments
Closed

lb_is_destination only accepts pseudo variables as values 2.1 #808

telephone-man opened this issue Feb 25, 2016 · 3 comments
Assignees
Milestone

Comments

@telephone-man
Copy link

http://www.opensips.org/html/docs/modules/2.1.x/load_balancer.html#id293920 says, "A value 0 for the port means "any" - will match any port"

However, it would seem you can only put a pvar there?

test 1: Fail

if (lb_is_destination("$si", 0) ) {
                ...
        }

CRITICAL:core:yyerror: parse error in config file /usr/local/etc/opensips/opensips.cfg, line 130, column 28-29: numbers used as parameters - they should be quoted

test 2: Fail

if (lb_is_destination("$si", "0") ) {
                ...
        }

ERROR:core:fixup_pvar: parsing of pseudo variable 0 failed!

test 3: Fail

if (lb_is_destination("$si", '0') ) {
                ...
        }

ERROR:core:fixup_pvar: parsing of pseudo variable 0 failed!

test 4: Fail

if (lb_is_destination("$si") ) {
                ...
        }

CRITICAL:core:yyerror: parse error in config file /usr/local/etc/opensips/opensips.cfg, line 131, column 26-27: unknown command <lb_is_destination>, missing loadmodule?

Workaround below produces no error, and correctly matches with any port


$avp(lb_port) = "0";

if (lb_is_destination("$si", "$avp(lb_port)") ) {
                ...
        }

@telephone-man
Copy link
Author

Just to add to this, workaround doesn't work.. In routing it errors..

ERROR:load_balancer:lb_is_dst: PORT PV val is not integer

...when it parses the $avp(lb_port) in the work around

@telephone-man
Copy link
Author

..but it does work if you do...

$avp(lb_port) = 0;

if (lb_is_destination("$si", "$avp(lb_port)") ) {
                ...
        }

sorry for lots of updates :)

@telephone-man telephone-man changed the title lb_is_destination only accepts pseudo variables as values lb_is_destination only accepts pseudo variables as values 2.1 Mar 2, 2016
@bogdan-iancu bogdan-iancu self-assigned this Mar 20, 2016
@bogdan-iancu bogdan-iancu added this to the 2.1 milestone Mar 20, 2016
bogdan-iancu added a commit that referenced this issue Mar 20, 2016
It must accept integer values also, not only variables.
Reported by @telephone-man on GITHUB
Closes #808.
bogdan-iancu added a commit that referenced this issue Mar 20, 2016
It must accept integer values also, not only variables.
Reported by @telephone-man on GITHUB
Closes #808.

(cherry picked from commit 143328f)

Conflicts:
	modules/load_balancer/lb_data.c
	modules/load_balancer/lb_data.h
@bogdan-iancu
Copy link
Member

Hi @telephone-man , thank you for your report - the fix is available on gihub, please test and confirm.

jnewman02 added a commit to Vocalocity/opensips that referenced this issue Jul 30, 2016
* Fix usage of t_reply_with_body() with reply lumps.

Force pushing all reply lumps (headers added to the reply) when using t_reply_with_body() - the function takes the msg from the transaction, not the real msg; so we need to be sure that the msg in transaction was fully cloned.

Reported by Giuseppe Cardone on mailing list.

* Check if at least one DB URL is provided in avpops

Reported by David Sanders (@dsanders11).
Closes #644 .

* Dialplan module should honor db_default_url
(cherry picked from commit 566d4db2cc634bfb0bcbd578acb70d1b69153d48)

* Dispatcher module should honor db_default_url
(cherry picked from commit 684846dd11573161958c0276b582e798c77a18d9)

* memset all connection memory to 0 to avoid unwanted values

* on DB error: avoid double free;release only in destroy function

* fix compression module bugs

* proper error messages on compress
* correct buffer size aproximation on gzip compress(10% + 12)
* fix bug on decompression

* Updated to support CNAM diversion use case.

* ratelimit: avoid deadlock if counter is not updated

(cherry picked from commit ec25c07c2e8b2baf792bd49f0044adb4a8f52573)

* Fix `make menuconfig` compile warnings

(cherry picked from commit b9fe3c2cf1a2f74fbaa451edfbfd597496bec747)

* fix: some sh(busybox) do not support syntax of `$(< file)'

(cherry picked from commit ffb25541b6bf4ee841072787f2a09c06c4885ab1)

* Fixed ACKs CSEQ number when doing in-dialog pinging

The ACK CSEQ number does not depend on the number of pings or other in-dialog requests since the INVITE transaction, it must be the same as the INVITE
Closes issue #680

(cherry picked from commit 26a0a62621f6d1e4ea9fee90684a143fbfdc8494)

* exec: Clarify what not to do with exec().

See:
https://github.com/OpenSIPS/opensips/pull/375#discussion-diff-19524753

* fix context reusage if async is made

This affects timers and failure routes that are supposed to reuse a static context

* context: add destroy function for registered ctx vars

* Fix potential memory corruption on TCP write errors

This patch fixes a well-hidden TCP connection referencing bug which
would only reveal itself upon running into failed TCP send() operations
due to various reasons (e.g. full send buffer) in high-traffic environments.

Credits to Hieu Ta and Don Steul from Jibe Mobile for detailed reporting
and providing an adequate replication environment

(cherry picked from commit 3e1a1a719215814f983001eef199ad01a263244f)

* TCP aliases: Fix more race conditions (issue #589)

_tcpconn_find() returns a pointer which should never be used outside of
TCP lock. This patch completes commit 22f4c1a2e05 by fixing two
additional issues of the same type in tcpconn_add_alias()

(cherry picked from commit cb5eebe00ea735f290a213ea74f55b4afcc06236)

* Fix compiler warnings with NO_DEBUG, NO_LOG

Also add a handy macro for future usage

(cherry picked from commit 48b88bd9a3b054992a9260f4de227af9853c1dea)

Conflicts:
	modules/emergency/emergency_methods.c
	modules/emergency/subscriber_emergency.c
	modules/usrloc/udomain.c

* run destroy context when the message is sent

Credits go to 46Labs for discovering and providing test scenarios

(cherry picked from commit 28bcadf6d874e8e675a7d51ba5288438d463848e)

* properly handle async functions when reactor cannot fullfil the request

Credits go to 46labs for debugging this

(cherry picked from commit c18c8ea1f655a34e67eb94e4c7484da6d6965582)

* fix mem leak in permissions

* Fixed Post Script callbacks triggering in Async.

If the async engine in TM detects a SIP retransmission, break script and run the Post Script callbacks, othewise the transaction will stay ref'ed for ever.
Credits for spotting this problem go to Razvan Crainea.

* topo_hiding: replace LM_INFO with LM_DBG for debugging logs

(cherry picked from commit 3ae7e37172b5ce3142e8448972a84a49d0faa53a)

* async: store cancelled and e2eack transactions in async ctx

This fix prevents transactions from being unrefferenced when dangling
transaction pointers remain stored in static variables.

(cherry picked from commit 3f3b6fdc71fb7f86f84e02fdf5f084bf9360deba)

* tm: free async context when resuming

This commit fixes context_alloc memory leak

(cherry picked from commit d69d085b886c621cd54554e44643f0f7849c5f0f)

* dialog: increase ref when setting dialog

(cherry picked from commit 528655892df6da11cbaba32833d3521187d399ca)

* fix str2int and str2sint input params check

* if a void string was given to the function ("") 0 value was returned which was not correct
* input values should be checked for NULL

* check if startup_done var is allocated before trying to set it

* fix warnings reported by Ovidiu Sas

(cherry picked from commit 19edf6159bb5a3ac639bd1792c5d2484f165b960)

* acc:evi: if the request failed send a missed event

In case the acc_evi_request() function was used on a failed request
(code < 300), send a missed event rather than the normal one.

Reported by Trevor Francis from 46Labs

(cherry picked from commit 18f5da047e6b87434c97f0ddee8a70d5baae79d7)

* RPM spec: remove excess rest client package

* dialplan: enhance debug probe

(cherry picked from commit f0a75d9ec6040370736a7200ac7c4659e1a052c8)

* dialplan: after inserting a new partition, set the pointer to the next record to NULL

(cherry picked from commit fb3923d7d578a9a9d3a2c0c3427df3c1c9ee1f44)

* dialplan: memset to 0 newly alocated memory for dp partition
 - suggested by Liviu Chircu

(cherry picked from commit 1cf5dd8e89a6f05a09a1964c2d53f6aee8ce6131)

* dialplan: allocate the right amount of memory when creating a partition

(cherry picked from commit bd35916e2e8d09d362f0e298e5e19469f7a53a8f)

* dialplan: check if memory is properly allocated when updateing partition records

(cherry picked from commit 889f353cecc7a9825867773eb57b0f9d6c21bc35)

* fix dangling db conns bug

* database are now started in child_init
* avoid opening db conns in mod_init and leaving them in the db pool because
when fork() shall be done all the processes will use the same db
structure therefore the same tcp connection

(cherry picked from commit 47b5dc900efd29f14397807e1947c99540159e26)

* Fix bug in populating the PIDs

(cherry picked from commit eccbf8d5d30bea765f19ab2b9816a57386091692)

* Fix proper reporting for the statistics types.

This fixes the charting of SHMEM related stats in Control Panel

(cherry picked from commit 52d5ef5bdf03aacb245420bc0193069a7b38322a)

* Reduce the amount of "useless" DBG's

(cherry picked from commit 0dca32bddce736ef9fcde5ccdb4674017f9fdf08)

* RPM spec: increase max files limit and add dependencies

* RPM spec: move ulimit to init-script

* properly handle epoll events

* b2b_logic: parameters cannot be lower than 1

(cherry picked from commit 152f22e63cc3f045492367b18ed5357cf5a89f2b)

* Return <null> value for missing AVPS.

Maintain database result integrity by supporting null column values.
Closes #693 and #677

* Merge pull request #681 from shiningstarj/dialoginfo-memory-leak

Presence_dialoginfo: Fix memory leaks in notify_body.c
(cherry picked from commit ab5cd613df4ef9831a33923ba5e51bf572203c8c)

* Fix DB key when updating the destination state.

Beside SIP URI, use the SET ID too when performing FB updates to set the destination state.
(a SIP URI may be present in multiple SET IDs)
Closes  #711 , reported by @mishehu

* b2b_logic: set late SDP negociation flag

For the entity that initiates a call, late SDP negociation is used, because
the SDP of the first entity is not known. This patch sets the late_sdp flag
for that entity, to flag the b2b logic to send the ACK with SDP.

This bug was reported on the mailing list by Sebastian Sastre.

(cherry picked from commit 20df8362455a60aaded86daa9a79d189b73a1880)

* Usrloc: modify invalid contacts behaviour

* stop inserting a contact even though received is OK
(call parse_uri() for each contact)
* at startup, if a bogus contact is found continue processing,
letting the user know that he has to remove that contact from
the database

* comparse_uris: unescape all characters in user field

* Manula cherry-pick of ef2232

* strip_body(): check if content-type exists

* avpops: start without db_url if no func is using DB

Conflicts:
	modules/avpops/avpops.c

* Merge pull request #746 from lemenkov/remove_has_sdp

rtpproxy: patch: has_sdp() does not exist
(cherry picked from commit 2e59ba930001593fcd8b60cf446979f69594bedf)

* cachedb_mongodb: Fix crash when losing DB connection

Tested with mongo-c-driver v0.6. It turns out that the driver's
mongo_cmd_get_last_error() does not always return an iterable bson
structure. This patch adds a safety check, so that iteration is skipped.

Reported by Sasmita Panda
Closes issue #747

(cherry picked from commit 2e5160e5e1d895a5694ba4297058e1ca587e787a)

* regex: Fix implicit declaration of 'isspace'

(cherry picked from commit 36072086f7996af4f1e4f4446017561d706250b3)

* Fix several print formatting bugs

%*.s is a format specifier for string width
%.*s is a format specifier for string length

99% of the time, we want the latter one and _not_ the former.

(cherry picked from commit e0c0a54ca599c0de9fa84ab6482a5698bf199e3b)

Conflicts:
	modules/event_flatstore/event_flatstore.c
	modules/proto_tls/tls_params.c
	modules/usrloc/dlist.c

* redis: add timeout for connect and query

This prevents OpenSIPS from blocking waiting for a connection to be
established.

Fixes #753 reported by Nick Altmann

(cherry picked from commit 76034ad60dfd991232ac3053c07f7a72de234e43)

* Fix pinging partitioning from nat_traversal.

Do not use the static counter as the timer routine gets executed in various processes now - better use a shm counter.
See all the details in #751
Based on the PR #751
Closing / outdating #751
Credits for finding the fix and comming up with a solutoin go to @aerringer.

* Fix race condition between retransmission and wait timer in TM.

Overlapping of retransmission timer and wait timer may lead to inconsistent timer list -> various crashes around TM timer lists.
Related to #749, #732, #723.
Many thanks for Trevor Francis ( @46labs )  for helping with the troubleshooting.

IMPORTANT NOTE: this is a temporary fix as it simply avoid the collision between the two timer routines - normally the routines themselves should be safe to run in parallel (more digging is required here).

(cherry picked from commit ea6e1fa7fed29efed6057894a8cc4054308160b3)

* Allow retransmissions and wait for reply/timeout on canceled branches.

Do not do anything about branches with no received reply; better continue the retransmission hoping to get something back; if still not, we will generate the 408 Timeout based on FR timer; this helps with better coping with missed/lated provisional replies in the context of cancelling the transaction

Many thanks to Maxim Sobolev for bringing this under discussion.
More to be read:
http://lists.opensips.org/pipermail/devel/2015-November/018623.html
http://lists.opensips.org/pipermail/devel/2015-December/018810.html

(cherry picked from commit 0dfb46df96d594c9b592d64913a44ab1cccd80e3)

* [snmpstats]more hints for setting up in the docs

(cherry-picked from 6e7535207d5531e0fc2562d05b874acd30488368)

* [sipcapture]mi_cmds were registered twice

(cherry picked from commit e36453ee6c687975382c3125b1dad9a382be041a)

* [sipcapture]completely remove mod_init mi_cmds registration

(cherry picked from commit 02defafe421fa1ff4ab0f05f63cc490fa1717ff3)

* ws: release TCP connection if not static

This should fix a memory leak (reported in #743 by Eric Tamme)

(cherry picked from commit 29190f3898e33c410745a9acce2f5ae8df650da1)

* tm: remove unused variables

(cherry picked from commit 666cf8316d3105a2920b68df8d600be02c8943bb)

* proto_ws: fix common variable used

* fixing coverity found defects - invalid memory access / memory corruptions

(cherry picked from commit c537cb8151e9436d88a9410e02ef11a093008ff0)

Conflicts:
	modules/dialog/dlg_tophiding.c

* fixing coverity found defects - resource leakage

(cherry picked from commit e09f09ae89aff31393b04e40b4f82632fd4f50ff)

* fixing coverity found defects - null dereference, break missing

(cherry picked from commit c004967f7c272e5b9043f5f3e330827f0682a009)

Conflicts:
	db/db.c

* fixing coverity found defects - processing initialized variables, control flow, invalid expressions

(cherry picked from commit b22844e0a1d4d54d0f8f836837f8447154799011)

Conflicts:
	modules/drouting/drouting.c

* fixing coverity found defects - logical fix in ul callback check type, null dereference

(cherry picked from commit aeedb7d94439b774d35009899b04d2c6060437d0)

Conflicts:
	modules/dispatcher/dispatcher.c

* fixing coverity found defects - null dereference, invalid e164 number check

(cherry picked from commit b8e2318ba58e56484294913e21a74a7cd79adf40)

* fixing coverity found defects - copying into fixed size buffer

(cherry picked from commit 92a7361eda2c6cd6e9ad637dab187cf87fefa987)

* fixing coverity found defects - copying into fixed size buffer without check, db_http

(cherry picked from commit d471234733de299c88f1036ba17a2406b8ae7a89)

* fixing coverity found defects - null dereference

(cherry picked from commit b578dda307f24e56f456e5b02c0c7591ed6746a4)

* fixing coverity found defects - null dereference

(cherry picked from commit 906bb9172b4ce0ab0e7bf4eca7da58211aa8ac5b)

Conflicts:
	cachedb/cachedb_id.c

* fixing coverity found defects - null dereference & broken logic

(cherry picked from commit 81aeba42ca04df7b3fc42ab2498717cc31227967)

* fixing coverity found defects - memory corruption, null dereference

(cherry picked from commit fd57609f5411e622dca593b729e1826269243c5b)

* Coverity PR: Fix bad conflict merge

* 2.1.2: update changelog and minor version

* RPM spec: update version to 2.1.2

* [avpops]check if asyn funcs used in separate loop(on acmds struct)

(cherry picked from commit 939b3433f3fe4c0887b818e856ff6e857c9e60d0)

* function search: properly search through switch st

(cherry picked from commit 446dd5876b633c95000e7b80a0ef8a3058c018a1)

* [avpops]fix acmds instead of cmds

(cherry picked from commit 9bd4c77ade737108aa45a755bb4e1055b4adca36)

* [siptrace]fix proto issues

leave IPPROTO_* format in hep header(which is returned by
pipport2su() function) and after setting it use OpenSIPS
format for sending(PROTO_UDP)

* RPM spec: prepare for new build system
- remove obsolete triggers
- change tarball name and url

* uac_registrant: update timer handling
 - closes #758 - uac_registrant wrong hash sequence

(cherry picked from commit be371dab7fa9b6fa495b99e69e623fed73500a74)

* fix calls per minute for fraud_detection module

Now the calls per minute parameter is build as consisting of an initial
time(t0) and a 60 seconds window(as was before). Each window slot holds the
calls received in that second(as before). The difference is that now
these parameters are updated based on three conditions:
* we receive the call between [t0; t0 + WINDOW_SIZE(60s)] - we only update
the number of calls for that slot(t0 + current time) and the calls per minute
parameter
* we receive the call in the interval of [t0+WINDOW_SIZE; t0+2*WINDOW_SIZE] -
we do the following: move t0 in current call time - WINDOW_SIZE, invalidate
all the calls we knew of from t0 to current t0 (current call time - WINDOW_SIZE)
* we receive a call after 2 * WINDOW_SIZE(60 seconds) + t0 - this invalidates
all the calls we knew of since the window is not does not contains calls newer
than the last 60 seconds;

(cherry picked from commit dd25c63adb8832d59861cf98b6fba1a2ad89a307)

* update ChangeLog with all commits in 2.1.2

* uri: fix e164_check overflow checking

Reported by @ferrored on github
Closes #762

(cherry picked from commit 70e5a656c3cd4aa14757245dd710d3869575d3ca)

* db in string or int pvar for avp_db_query()

(cherry picked from commit 8a512731df99621025744aaa25b17931759b91d4)

Conflicts:
	modules/avpops/avpops.c

* Fix restoring leg route set.

Reported by Søren Andersen.

* Merge pull request #664 from wdoekes/wjd-allow_unset_dlg_in_req_route

dialog: Document that unset_dlg_profile can be used from request_route.
(cherry picked from commit 8d23d9bd7e55ede0f68c042204096fe1b4087dae)

* Coverity PR: minor refactorings

(cherry picked from commit 975024142e724b315203dd14c58056a77f3d3959)

Conflicts:
	modules/ldap/iniparser.c
	modules/usrloc/dlist.c

Credits to Ognjen Seslija for the bug report

* Missing module "emergency" in extra list.

This was braking the creation of extra tables (at least in postgres is did).
Reported by Nathaniel L. Keeling III on mailing.

* increase versioning to 2.1.2

* Fix double free in case of errors when running MI command

(cherry picked from commit ce6e8444afeb887f30d38cf90b0176ae9960fb72)

* Fix STANDARD and EXTRA list of tables.

Permissions (in postgres) were not granted for the missing tables.
Reported by Nathaniel L. Keeling III on mailing list

* Removed double listing of "address" into EXTRA_TABLES.

* Fix bugs in modules-readm target.

(cherry picked from commit 0042b940dbffe057d06217845f399f758051c7fb)

* README files regenerated

* Fix codec handling functions when faulty streams are defined.

Bogus test on the return code of stream_process() (using bitwise OR for -1, 0 and 1 values :O ), leads to a generic failure to find any codec in any stream if there is an invalid stream in the SDP.
For example, if a video stream is defined but with no codecs, stream_process() will return -1 for it (as it is a bogus stream). While iterating through all the stream (including the valid audio stream), the -1 ret code will discard any 1 future ret code due the bogus bitwise OR.

(cherry picked from commit ef82ca2368462c41f7115202e90f73d8ab16fd1f)

Conflicts:
	modules/sipmsgops/codecs.c

* Fixed wrong warning on memory leak.

Set the auth_hdr buffer to NULL after moving the buffer into the lump.
Reported by Colin Martin on mailing list

* Fix the sizing of the Async Reactors.

Adjust the size of the reactor accroding the limit of opens files.
Closing #765.

(cherry picked from commit 2efdbf8c45a35c57754ac14e64a356b9bb74fd5f)

* Fix calculation of timer set on 32b

A bogus bitwise operation broke the calculation of the timer set on 32bits arch.
Reported by @mshary (Muhammad Shahzad Shafi)
Closes #732.

* Fixed autodetection of the reactor size (open files)

If we auto-detect the size of the reactor(via rulimit), be sure we have enough pkg memory (and do the necessary correction).
If the open files limit is given, warn if the reactor will use too much memory.
Thanks to MAxim Sobolev for reporting it via mailing list and to @cepehutu
Closes #778

(cherry picked from commit 6dd88abca4cf6f6ec484e7616a584c92d7ff874e)

* fix async: context shall be destroyed only at the last async call

(cherry picked from commit 672cb13084891afffba881d2129fdb2037b3dba6)

* Fix freeing processing context after a second async jump.

If thw processing ctx was stored back into transaction (due a new async call), do not free the current ctx (as it became NULL).
Reported by Minh PHAN (@qmphan).
Closes #780 .

(cherry picked from commit 031304af8be6f683fc4706fb9091fd2b12705f6d)

* Fixed improper setting of Missed column's type.

Credits go to Pete Kelly (@petekelly).
Closes #703 .

* Fix IPv6 insertion in fix_nated_contact()

Add the [ ]  around IPv6 in the newly built contact URI.
Reported by Jonathan Hunter on the mailing list

(cherry picked from commit ce89e291e0616d80d555f1e386edde5bbd3922e9)

* proper compile on gcc 4.8

(cherry picked from commit 421e3e3b50808f47129dbbb9f987145c8226c0f6)

* Fix proper callig in local cancels with TH.

Extend the coverage of the preocessing context and TM context over the cancel_branch() function (in the timeout handler) so the TH callbacks can reach back the dialog and do the TH related changes.
Reported by Julian Santer on mailing list.

* Don't push throug RTPProxy streams with port 0 in SDP

(cherry picked from commit 5dec43a750c7af714dfec9ac9ef43cc0c33e2280)

* arm: unforce thumb mode

(cherry picked from commit c24b587316306da0e5d58130d8712f314de8cd7a)

* Improve qvalue parsing

* accept qvalues with no decimal digits (e.g. "1." and "0.")
  (this removes E_Q_DEC_MISSING from error.h)
* improve bad qvalue error reporting

(cherry picked from commit ed60363d9d66bf230872c535e3fc0cf7f117b2c7)

* Fix contact DB delete in CONTACT_ONLY macthing.

Do not use the callid as part of the key during the DB delete as it may changed (can be updated) in the meanwhile.
Reported by @ferrored.
Closing #764
Many thanks to @ferrored for his support in troubleshooting this issue.

(cherry picked from commit 23155e5acb415a68a81aa070b3c0bf272a47544c)

* SIP forking engine: Fix async-related issues

Previously (on OpenSIPS...), doing _any_ async operation at script level
after a destination set had been built (by lookup(), append_branch(), etc)
would have lead to unpredictable results.

This patch addresses the problem by moving the destination set storage
into the current processing context (from static mem to pkg mem).

Impact on memory usage at worst (12 branches for each request) is
an extra 30 MB of PKG memory per every 1000 cps.

(cherry picked from commit a7b287f5f566b87017a5bc7b3e68ac2fdef5b024)

Conflicts:
	main.c

* Blacklisting logic: Fix async-related issues

Similar issue to the one behind commit a7b287f5f. Static memory
holders are no longer compatible with async operations and need
to be moved into dynamic mem (pkg in our case) so that data can
be properly restored before resuming the script.

(cherry picked from commit 2e7588bb43547152d1a594c0ea40b416b1959233)

Conflicts:
	blacklists.c

* Order target dependencies to avoid FTBFS in parallel builds.

* SIP forking logic: Add extra NULL checks

This prevents a crash when no branches are pushed yet, but a branch
management function is called (e.g. t_replicate() or a write to
$(branch(uri)[0]) is done)

Issue reported by Trevor Francis

(cherry picked from commit 5e3f06800eb7a4d9367c1dce87f43ab8420bad5d)

* sync with latest debian package

* Makefile: dash cannot use variables that contain -

* build: change variables for other OSes

(cherry picked from commit cec0c7244e3eb53c5c08144e17d5e0c5441e5eec)

* destination sets: Add yet another NULL check

Reported by Ovidiu Sas
Fixes #806

(cherry picked from commit 5718e24ea3c1d231365202c22893403dc58785bd)

* debian: fix packaging config target

* update changelog and add berkeley deb

* support reproducible builds

* update spelling checks

* other spellchecks

(cherry picked from commit a547af5b71ca2e9b951c164de82d292e464d35c4)

* tls: update install path

* Updated to support STIR.

* loop: declare fd_map for devpoll

Reported by Nathaniel L. Keeling III

(cherry picked from commit fe785bfa6e5b2ec5cf06c1850cca860f08989820)

* Deprecate 'use UNIVERSAL'

(cherry picked from commit e5f0b55da6fd24b6e661801d26d4dd53b1793fd3)

* rename s_addr to avoid overlapping with Solaris structs

Discovered by Nathaniel L. Keeling

(cherry picked from commit 6c990040da2fd472993015f787b84a10768e1f6c)

* packaging: add back the memcache for lua building

* tcp: prevent invalid mem access

Reported by Saúl Ibarra Corretgé

(cherry picked from commit a607aa846f659f9edf5e08bdb13831e633cdde33)

* Allow setting branch flags when no branches are yet appended

Commit 5e3f06800e was too restrictive, since flags for "branch 0"
(a special branch, stored in current struct sip_msg) may be set regardless of
the number of append_branch() operations done previously!

Reported by Dragomir Haralambiev

(cherry picked from commit 6d1704c6c936921c504c8261ef5de1d710ed3d22)

* tm: Refactor some hardcoded static string lengths

This also fixes a couple of chopped MI error strings in "t_uac_dlg"

(cherry picked from commit 60d4d4bc1edc493aaedcee40976347d3fbe9094e)

* Merge pull request #814 from sippy/master_rtpp_ip6_fix

Fix an issue with IPv6 in the rtpproxy module
(cherry picked from commit f906d931a0908bee05b04843d397fa848158311e)

* Fixed leak due wrong return code handling.

Based on a patch provided by Jarrod Baumann (@jarrodb)
Closes #822

(cherry picked from commit 3b37b827746459a538fb86507414d4a26481a946)

* t_newtran() automatically sends a 100 Tryting for INVITE.

TO have a consistent behavior between:
	t_newtran();
	t_relay();
and
	t_relay();

(where in the first case a 100 Trying will not be auto generated), we do not sent the 100 Trying on r_relay (when transaction is built) but on t_newtan().
Reported by MAxim Sobolev.

(cherry picked from commit 0db77896288e7ef093352fc0a08f4035c1191bf4)

* dialog: Lower log level of state change errors

Out-of-order SIP requests are a frequent occurence in high-traffic
environments. The dialog module should not consider these events as
being critical, but rather as warnings, so they can be easily
filtered out from the logs.

(cherry picked from commit e403a2bc150b7f9c79a011f4acbcf68e4ce9f77d)

* Merge pull request #823 from jarrodb/db_postgres

Add JSONOID to pg_type.h for supporting JSON return types as DB_STRING
(cherry picked from commit e6bb7acb66cdc8cc1869ba1f8b7ce3ce123d7b39)

* Fixed memory leak on checking disposition hdr.

Free the parsed disposition body all the time (on success and failure) as it is not attached to any structure, so it will leak if not explicitly be freed.
Credits for reporting this go to Jarrod Baumann.
Based on an original fix from Jarrod Baumann
Closes PR #825

(cherry picked from commit 4601e5653be202912a3732f08cdafc63d64afe7f)

* Fixed async jump for end2end ACKs.

As end2end ACKs do not create a sip transaction, force sync for all async operations (as we cannot suspend and resume).
Closes #819

* Fix crash when using $si in non SIP routes.

If using $si in event, timer or startup routes, return a NULL value.
Use a dummy AF_INET from src and dst IPs.
Prevent crashing while evaluating $si by checking return code of ip_addr2a()
Closes #817
Outdates #828

(cherry picked from commit 2d0cebc0be2491984ce357afd89d41212866bc06)

* Fixed $TH_callee_callid to reflect '=' being an invalid character in callids
Closes #800

* topology_hiding: prefent crash at shutdown

(cherry picked from commit 00632a0b5a93f84531bb391bda2939b2ba351013)

* Reset to 0 the whole branch if failed.

If we do not reset, on trying to add the next branch (on the same position), we will end up with dangling pointers.

(cherry picked from commit d5c3bd1eed5f40f7425562f8bb65fe2f5c9fc678)

* Fix extracting TO hdr.

Do not add '@' if username is not present.
Reported by @DMOsipov on GITHUB.
Closes #818

* Fixed usage of Prep Statement on failed CDRs.

The number of inserted columns is variable (n+m or n+m+2), so we need different statements for each.
Reported by @apsaras (on GITHUB)
Closes #821

* Fixed port param for lb_is_destination().

It must accept integer values also, not only variables.
Reported by @telephone-man on GITHUB
Closes #808.

* Accept XMLRPC requests without params node.

If there are no parameters, the params XML node is not required.
Repored by Nick Altmann
Closes #826

(cherry picked from commit d20b3d05409fc5f712c75b86223fe955e57ec5c4)

* Prevent async in local route.

The way local route is implemented (triggered and terminated in TM module) does not allow async resumes, so, for the moment, we simply force all the async triggers to be executed in a sync way in local route.

* scripts/opensipsctl: complete support for optional database port

(cherry picked from commit 04d8a84f00e375a0ecf7d41a6b4f421d64018930)

* Fixed 491 Pending scenario in B2B.

Generate 491 Pending reply to the correct transaction (the new incoming one) and drop the requests (do not forward it).
Credits for debugging, reporting and fixing go to @DMOsipov .
Closes #679

(cherry picked from commit ec7b4e54bf7f09fb6ff56e8f8497563cf13719e8)

* Proper handling of isolated EPOLLHUP events.

capture and handle EPOLLHUP or EPOLLERR events even if they are not in conjunction with EPOLLIN or EPOLLOUT.
Many thanks to @santhosh-kumar for reporting and helping with troubleshooting.

Closes #829

* Improve robustness of core URI copying functions

Namely set_ruri(), set_dst_uri(), set_path_vector().

This patch corrects the behaviour of the above functions when they are
fed strange/corrupt strings, such as {NULL, 5} or {0x7fb..., 0}.

There are still plenty of pieces of OpenSIPS code which assume such
strings should be correctly processed, e.g. next_branches(), which may
lead to a whole world of problems ranging from segfaults, double free
operations and dangling pointers all the way up to intermixed shm/pkg
memory pointers.

The best way of addressing this issue is to simply accept such input and
zeroize (and free) the concerned sip_msg attributes.

Many thanks to Ovidiu Sas <osas@voipembedded.com> for in-depth error
reporting and assistance in fixing this issue

(cherry picked from commit 2787308f68e6ee878dcf710cd7b36992af62aab9)

* drouting api: Fix a double free bug

Crashes / memory corruptions could ensue after running "fraud_reload" MI
commands or during OpenSIPS shutdown, if fraud_detection had some data
to work with.

(cherry picked from commit 2380bbdaeb0af4efdb293b42ee1ad09f40e3e67c)

* TLS: Fix misleading error logs on accept() failures

OpenSIPS would always log SSL_accept() failures as being "rejected by
client". This is entirely not the case, as the errors may as very well be
server-side, due to cipher mismatches, failed peer verifications, etc.

Reported by Nabeel Shikder on the "users" mailing list

* Fix bogus log

* cachedb_redis: Prevent crash when re-connect keeps failing

(cherry picked from commit b501df74a231a987babe6eeadb3c676d8823619c)

* pi_http: return "200 OK" instead of "0 Unknown"

(cherry picked from commit 73f8117f2f5f01560b6698ad845cce0b485df203)

* Fixed bogus pkg_free on pointer in data segment

Reported by @dzhou121
Closes #854

* MI library: Add comments regarding a known issue

Currently, MI arrays cannot contain objects with non-identical
"name" attributes.

This patch also quickfixes this issue in mi_list_all_profiles() by dropping
the array idea altogether, in favour of a top-most object.

(cherry picked from commit 6c105015c3a0a02c6f65822f5ce52e12bd0ae108)

* [tls_mgm] properly handle SSL_ERROR_SYSCALL on SSL_shutdown

(cherry picked from commit bdcee39ebf04f8a74b926dc6e6c311487d3ef601)

* regex: fix spell-check in package

(cherry picked from commit 647ea214f1892f8901f562bc45e0e1e33b699aba)

* ratelimit: initialize the length of the algorithm

(cherry picked from commit 0eebf1058574c622ba3532fb520908da1c1d94a5)

* Updated opensipsctl.base to also search /sbin

The md5 utility is located at /sbin/md5 on FreeBSD 8.3. An additional common location was added to allow the script to accommodate this.
(cherry picked from commit ca87f55ad071257aa3b891347aadb55a7729d25b)

* [dispatcher] fix double allocation issue

(cherry picked from commit d6891363e3b3b4047a1948eb03fb6b6bab285885)

* Fixed bogus memory operations.

Fixed bogus free (of uninit pointer) if parse_contact() fails
Fixed shm leak on errors after print_rr_body
Fixed shm leak on success if record_route is present.
Reported by John Nash.

* Fixed preserving 3xx Contacts in TH without dialog

Reported by Pete Kelly.
Closes #656.

(cherry picked from commit 6184b96c94d0fcc298dbe5bce1cd0ca9fb0445d3)

* Fix bogus timer ref counter during expire update.

Many thanks to Trevor Francis for reporting and helping with troubleshooting and testing.

(cherry picked from commit 047b1b3e32a9af30dd44f2487460975ed7b3a815)

* Process sequential messages received in CONFIRMED_NA state

Due to UDP race conditions, sequential messages may be received
before the ACK confirming the initial INVITE ( eg. Re-INVITE sent
immediately as the call is established in order to force
a specific codec ) - also push these requests through the whole
dialog processing in order to avoid any future issues ( eg. CSEQ
updating which, if left unprocessed, will lead to generating out
of order sequentials by OpenSIPS )

(cherry picked from commit bfaf02242a98c464dfbdcd3c3ebf3fbb555bcc47)

* Fix a string concatenation operator bug

This patch fixes an issue with string concatenation where any NULL
operand would cause all operands to its left to be ignored when
computing the result of the expression.

Reported by Ovidiu Sas
Closes #870

(cherry picked from commit a420752f436a1f952c255df8d5dbe9ea59b0d653)

* re-register topo hiding callbacks after restart

Thanks to Pete Kelly for reporting this

(cherry picked from commit 4c84bd84ad67e71f174b3297ff3432ca21bafab4)

* th: fix dlg flag check

(cherry picked from commit 1b5802d2e4876e0d63eeeec5a6edcb7a2321e9d0)

* Fixed bogus name of  "pkg-config"

* Added extra log message on openssl 1.0.1e-fips bug.

If CRYPTO_set_mem_functions() fails, make a note on the openssl 1.0.1e-fips bug, so users may have a hint on the actual issue.
See more  #834.
Closing  #834.

* [mmgeoip] allow chosing memory caching type

	Before GEOIP_MMAP_CACHE was used causing a segmentation
fault when database file was changed. Now users can choose between
reading the database directly from file, cahing it into memory with
the possibility to change the database file at runtime.

(cherry picked from commit ecf5032aaafbe5a93bbfc3562c4b3358548839e7)

* Revert "Accept TCP aliases by default"

This reverts commit d62bc967b0d6784d2baced88b895da57f3f4ab9a.

Firstly, TCP connection reusage (RFC 5923) should only be employed between
TLS endpoints - only TLS allows the endpoints to authenticate each other
during connection setup, preventing unauthorized connection hijacking.

Secondly, aside from any security considerations, RFC 5923 must
not be employed fanatically (Proxy-Proxy, Edge-UA, UA-Proxy) on any TCP
connection (especially disregarding the ";alias" Via parameter!), but
rather only between adjacent SIP entities who can both initiate a
connection towards each other, and also support the RFC. In the real
world, we're basically only talking about the Proxy-Proxy usage case, as
any SIP UA scenario will most likely involve some form of NAT and a
Proxy that cannot open connections backwards, towards the UA. In these
cases, TCP connection reusage is _completely_ out of the question, as a
single UA might end up receiving all calls of all users behind their
public IP.

Thanks to Jonas Borjesson for reporting the problem in the first place.

(cherry picked from commit 715339fdd25bc74797e6f978d164eb0c4d5669ce)

* TCP connection lookup: Add matching by transport

The fact that all currently supported TCP-oriented protocols have different
standard ports is not an excuse for not including the transport into the
match condition (i.e. dest IP address + dest port + dest transport).

This may very well prevent issues with messages being sent out over the
wrong TCP connection in a number of scenarios where we employ TCP connection
reusage over both plain TCP and TLS with a Proxy that specifies the same port
in the topmost Via header when it establishes each of the two connections.

(cherry picked from commit 13970bb65253f1b35156466c6f514a4c520d8893)

Conflicts:
	modules/proto_bin/proto_bin.c
	modules/proto_hep/proto_hep.c
	modules/proto_wss/proto_wss.c
	modules/tls_mgm/tls_mgm.c

* TCP alias lookup: Add matching by transport

Further improving commit 13970bb.

(cherry picked from commit ea699f0116a28cd03a0d1ff50da3fc6045ac3da5)

* mi_xmlrpc_ng: Fix a shared memory leak

(cherry picked from commit d047e1096e2f6624f776d9a031f92be3cc9a0a0d)

* mi_xmlrpc_ng: Remove an incorrect free operation

Completes commit d047e109

(cherry picked from commit 99f039e37cd79621b2dcc2b5ec2decc9e7c39670)

Conflicts:
	modules/mi_xmlrpc_ng/http_fnc.c

* Obey USE_SYSV_SEM and USE_PTHREAD_MUTEX.

If USE_SYSV_SEM or USE_PTHREAD_MUTEX are defined via Makefile.conf, do you force autodetection (based on arch type) of the locking support.

(cherry picked from commit 39592dc9f25ecee982156e365d160642bdde48e8)

* Fix bogus destroy of a RW lock.

(cherry picked from commit 83f394579a88a6a9185342cf5f92401ef5c18e5a)

* Proper support for USE_POSIX_SEM option in Makefile

(cherry picked from commit 5e40aaf9c3ed8ab4381d847f6a1f6a01a8113bf7)

* Fix bogus set locking functions.

It is used for SYSTEM V locking only, looks like a copy'n'paste error.

(cherry picked from commit 4bcdf4e6aee07ef965f6ae573b289f3fd082fdde)

* Fix warning in SYSTEM V locking functions

(cherry picked from commit 53b3f402a4d9fb0ff1ba30288d810d41d6b55b1b)

* call_center: obey lock_set interface

(cherry picked from commit 4a226ced3309a045b11f6e651bebd6b076faefa2)

* dialplan: Fix a rule tie-breaking bug

When an input string would match both a "string" rule and a "regex"
rule, the priority based tie-breaking was incorrect (now favouring
the bigger priority instead - opposite to default module behavior).

Thanks to @paolodepa for suggesting this fix
Fixes issue #696

(cherry picked from commit cbdd79ab3f6d772c6ef1fb7afc44990e9cad294e)

* fix bin crash if no listener defined

When using usrloc and dialog replication, if no bin_listen is defined,
OpenSIPS crashes. This fix ensures that if there are any replication
destinations defined, the binary listener exists.

Thanks go to Stas Kobzar for reporting this
Closes #652

* dialplan: Improve documentation

Added paragraphs regarding rule types along with explanations on
they way priorities and rule tie-breaking work.

(cherry picked from commit 46894f819d1d7d6092129b334e33956e89e5d4ea)

Conflicts:
	modules/dialplan/doc/dialplan_admin.xml

* dbtext: convert DBG to ERR for better debugging

(cherry picked from commit 0f08b26e40b31bb8af325ba62cfa32676c62ae86)

* Improve error reporting for unknown script vars

Fixes #574

(cherry picked from commit 97ace293dd4c7eb2fe8cd8fbee693455a5737861)

* Fixed missing MI reply on pua_publish.

Properly send an MI reply for the async pua_publish with Expires 0.
Many thanks to Damien Sandrs for invetigating and reporting.

Closing #657

(cherry picked from commit 60d01efe811ac7eeaa063032a309b1895c59e92f)

* add license to rw_locking.h header

(cherry picked from commit e3a57ac953259a0254a07198aabc88eaac9da9c2)

* Link the dialog cell into internally generated requests from the dialog module

Fixes #839

(cherry picked from commit 66937a2834d5680031f81c881719b43018fa06ad)

* Fixed bogus test when using POSIX or PTHREAD locks.

Reported by Steve Woolley.
(this was fixed on 2.2 and trunk when debug support was added for locks).

* Fixed proper cleanup on failure of tcpconn_new()

The chances for going for error cases are very low, still let's do it in the proper way

(cherry picked from commit 57c163b1b7680d3cc01227dbca7676e532aa7539)

* If POSIX sems are used, be sure to link against pthread lib

(cherry picked from commit f7de6406056cbae95ba9f7521d822d280afbe6a2)

* Fixed interface matching in loose_route()

If port is missing in Route URI, do not assume default 5060, but consider the schema and protocol (they may require a different default port).
Ex: sip:10.0.0.5;transport=tls was previously handled as sip:10.0.0.5:5060;transport=tls, which is wrong as the default TLS port is 5061
Reported on mailing list by Ravitez Dondeti.

(cherry picked from commit 3593a5f5b2e012154b1c9a00e1645c67c5ece91c)

* Fix invalid memory access with async MySQL queries

Due to the way the libmysqlclient query result strings were managed,
they would be freed by the library before OpenSIPS would copy them
into the output AVPs.

This patch fixes the issue by adding a new DB API function which handles
the cleanup of async query results.

Reported by Ovidiu Sas
Addresses issue #873

(cherry picked from commit 177c60a0e13471a87d80f21504894b883038ffa4)

Conflicts:
	db/db.h
	modules/avpops/avpops_impl.c
	modules/db_mysql/dbase.c
	modules/db_mysql/dbase.h
	modules/db_sqlite/db_sqlite.c
	modules/db_virtual/db_virtual.c
	modules/db_virtual/dbase.c
	modules/db_virtual/dbase.h
	modules/sipcapture/sipcapture.c

* Update version 2.1.3

* Update ChangeLog for 2.1.3

* httpd: properly treat select response

(cherry picked from commit b49d37494d77c81bdbf76406fc568f530cd66379)

* Fix documentation on former b2bl_key_avp module param

(cherry picked from commit ca21c6d2871e01d093c69371ddcc204c5af0355a)

* Proper handle the case of no usrloc domain registered.

Prevent get_next_udomain() crashing if there are no usrloc domains registered (reported by Qasim Akhan on users mailing list.
Do not enable the pinging support in nathelper if usrloc has no registered domains.

(cherry picked from commit 8f0c677be7dfd3fe6b17932173f14e049ae466a5)

* Fix error handling in DB writes.

If inserting/updating a dlg record in DB fails, do not exit with error, but continue with the rest of the dialogs.
Credits for finding and reporting this go to Rik Broers @ Motto

(cherry picked from commit 0ca6cf035471fc010366e4d29ced5d6fd63199ab)

* Removed unused "error" jump label

(cherry picked from commit 5819b0fa7033bf2a6daef824bc21dd4ba497ae1b)

* Removed wrong "NOT NULL" constraint over the contact DB fields

The code actually handles the case of NULL callee / caller contacts, so DB must allow NULL values.

* Removed compilation warning

implicit declaration of function â"sched_yield" [-Wimplicit-function-declaration]

(cherry picked from commit 8ef8d79701357b7412555519e166481e699e9833)

* Fix evaluating the SIP port from a SIP URI.

Use the new function get_uri_port() to evaluate the port and proto, in a SIP wise manner, form a SIP URI. If port/proto are not explicitly set in the URI, consider the default port for the used transpor proto. If protocol misses, we assume the default protos according to the URI schema.

NOTE: it is completly bogus (and dangerous) to assue 5061 if SIPS schema is used as:
1) SIPS can use used with WSS, which actually has 443 port
2) TLS can pe required via transport param in a SIP schema URI too

(cherry picked from commit 4c54bcd8bf0426f899b82505e493c97ef5378c79)

* Fixed forcing FAST LOCKS for arm6.

Use FAST locking support for arm6 too.
For Linux, use POSIX as default locking support.

(cherry picked from commit 058e16f2a76df9be4e48fa6866b096502981d530)

* Fix potential 100 Trying duplicates.

Added the "auto_100trying" module parameter to allow the script writter to take control (from script level) over when the 100 Trying reply is to be sent back.
By default, the reply is automatically generated when the INVITE transaction is created.
Fixes #833

(cherry picked from commit b023c93a8c476e70b1550da4f46c91d6e2679442)
(cherry picked from commit 71b527446b00fc4e3886d8d02c7d03d313dbee05)

* Fix memory corruption on $stat() vars

The $stat() var specs are kept in pkg, while the name (if stat not found) is kept in memeory. This means all the copies (form all procs) of the specs will point to a single shm block. It is not safet to free this block as you have no idea how many copies of the spec (from other processes) still refer the name.
Closes #902

(cherry picked from commit 4baead765179f6bfbc098b3e59791d7bbc4a8d42)

* Fixed failure to enable NAT pinging.

Commit 8f0c677 introduces a bug in testing is usrloc domains are available, and if not, to disable the NAT pinging in nathelper. The test is wrong as it is done in mod_init, while registrar module registerd the usrloc domain via fixup function, after the mod_init section.

Reported by Nick Altmann

(cherry picked from commit f150fb75611a6e61eabc134f266064bd23f1c850)

* Add support for SIP URIs without user part in 'avpops' module.

This module provides a set of avp_db_xxx functions which take pseudo
var and flag as first argument. Flag can be one of username, domain,
uri or uuid. Previosly avp_db_xxx functions used to return an error if
flag has been set to username, domain or uri and specifed pseudo var
did not contain username and host after parsing as SIP URI. This
behaviour seems to be strange because if flag is being set to
domain/username and sip URI contains domain/username we can still
load/store/delete this variable.

(cherry picked from commit 459f2e90ed277a0371a3325b27038213c5083e8c)

* Update rtpproxy.c

When building I/O vector for command to rtpproxy in "force_rtp_proxy_body", after an IPv6 address is detected and the "6" option is added, increase the length component in the I/O vector so it is passed correctly.
(cherry picked from commit 4e73871adba3f48b67a9ebbf20a2d9c60b823be8)

* Update rtpproxy.c

When moving stored parameters from Branch AVP to Dialog variable, make sure that the integer value "setid" is handled correctly so that it remains valid for the remainder of the dialog.
(cherry picked from commit e267e9eb83e2345ca716b897975c2fbfbb4e75ce)

* rtpproxy: no need to update the len for IPv6

(cherry picked from commit 5cfd916ca41ed60c9997f95d05694c9083b743b1)

* Fix proper testing of context content

If a STR is register to the context, a valid STR * will be always returned , so we need to test the content, not the pointer.

(cherry picked from commit 968a8a807c102a6d53f2bc831cde74c79ee754a9)

* Update version from 2.1.2 to 2.1.3 for specs

* init: use the specified CFGFILE in debian init

In case the CFGFILE changes in the init script, opensips will still start with
the compiled file instead of the one configured

(cherry picked from commit 030efef84d240646ed8e99616b8a6eb64f7d17d2)

* proto: always populate default values for protocols name and port

This allows you to print the protocol you received, and its associated port

(cherry picked from commit 0ae5ba280618e076a7ba658d15db32b877b55442)

* Allow proto modules to populate its name

(cherry picked from commit 00d052c18bd663e24769b7198a24aefbcd1963dc)

* Fix script varibles for providing port and proto (as part of SIP URI).

If the SIP URI does not have an explicit port or proto, determine the default port/proto in a SIP wise manner (rather than returning 5060 / UDP) (Ex: sip:example.com;transport=tls has default port 5061 and not 5060 ; or sips:example.com has default proto TLS and not UDP).

Affected variables are $dp, $rp, $op and $dP, $rP, $oP

(cherry picked from commit 6cc850e34dcd022f1ed354bd50d9a1809518fa1f)

* Fix compiler warning

Using gcc 4.8.4, we would get:

net/trans.c:43:2: warning: missing initializer for field ‘name’ of
‘struct proto_info’ [-Wmissing-field-initializers]
  { }, /* PROTO_NONE */
    ^

(cherry picked from commit 376579fa53abb6fc16de76a3070d082c9d958165)

* Fix dialplan module when using db_text backend.

The db_text makes no difference between NULL or "empty string" values in DB -> both are internally translated as NULL . The dialplan module, in a very abusive way, forces "not null" (in DB schema and in the code for data validation) even for columns that are optional (like subst_exp, repl_exp, timerec and attrs). Besides being bogus (if a column is not to be used, you have to set it to empty string rather than let it NULL), it makes impossible the usage of db_text with dialplan.
This fix allows (DB and code) the mentioned DB columns to be also NULL.
The change is backward compatible, it should not break any existing usage of the dialplan module.

(cherry picked from commit 8f548976389ee3968bf06f649b54d88db694f949)

* [siptrace][bugfix] fix bad macro in siptrace(trace local ip logic)

This commit closes #916
Thanks to @Tinet-AaronAn for reporting the issue

(cherry picked from commit 2a4f686d4997b814eeaa425dc23fe822cb8ef91a)

* permissions: fix get_source_group() return

In case a group is not found, return -1 instead of true

* acc: Fix incorrect Request-URI handling

If the config script does not include any Request-URI altering logic
(e.g. no lookup() or $ru manipulation), the acc module would incorrectly fill
in a "msg->new_uri" field which should NOT be freed into the SIP request
structure, leading to the memory pool being corrupted upon transaction release.

Credits to Guillaume Lacroix for reporting

(cherry picked from commit 02cb9f048d0a5e1f988aa9ccae1691216ed16ee5)

* Fixed compiling on arm6 with fastlocks

Partial revert of 058e16 as we need some extra asm code for fast locking on arm6.
See #923
Closes #912

(cherry picked from commit a69c32877b99fbd6eef736eff58c9b6ed8228166)

* Fix error message when a route is not defined.

Print the name of the route too - the ID is irrelevant for the script writter.

(cherry picked from commit 409481818148d7951e1520c9dd4eb715c2bec7c6)

* dialog: advance to next cell in case of error

(cherry picked from commit 70db2cfcdb0c74e6437db2aa9663fd0a5000ecdd)

* [acc][bugfix] check if database loaded before using its handler

(cherry picked from commit 8dd10d85b408947576223e75a67228ed7c7abd91)

* Fix populating blacklists.

When creating the blacklists, use the port and protocol of the destination too, otherwise the rules may conflict or be too wide to be used (like 2 destinations with same IP but different ports).

(cherry picked from commit 0495faa7d96f92da13102480ca43cd1befd37ba0)

* Fix populating blacklists.

When creating the blacklists, use the port and protocol of the destination too, otherwise the rules may conflict or be too wide to be used (like 2 destinations with same IP but different ports).

(cherry picked from commit 97f309c34c7333270a3f0f997868bdb9b94107f1)

* Fix populating blacklists.

When creating the blacklists, use the port and protocol of the destination too, otherwise the rules may conflict or be too wide to be used (like 2 destinations with same IP but different ports).

(cherry picked from commit 7fa9cee5037af26fd1c63b70710f2bc03e6a31f4)

* Fix advertised port and address per branch.

Before the advertised_port/address are preserved only in the UAS part of the transaction - that means it is only one value and it is from the setting done in Request Route; whatever later setting done in Failure Route or Branch Route are not preserved at transaction level (even if they are used on the spot, for sending out the INVITE).
So, when we have to build a local request (ACK or CANCEL), we do not remember which specific address/port were advertised for that particular UAC (branch).

Fixes #917.

(cherry picked from commit eb850a22f0af83bf75e75dfadbe1320e8b92784b)

* Fix building Via Branch in stateless mode

Instead of copying the branch value from a previous statefull Via header (which may lead to overflow as OpenSIPS has a maximum value for the built branch), we generate a new branch value based on the previous Via branch - in this way, we have full controll over the length of the resulting Branch and we also inherit the uniqueness of the branch value (from the prev Via hdr).

Reported by Gupta, Rahul and Elliott, Ray

(cherry picked from commit 482e643469b351d12418ff54c96beee7b27dca94)

* rest_client: Fix incorrect trim operation

(cherry picked from commit d8bf10da34152612e7835a64cedbb7593b8fc57b)

* permissions: allow any supported protocol

Before this commit, the protocol check was hardcoded in the module. This
commit allows to add in the permissions table any transport protocol
supported.

Thanks go to Kirill Galinurov for reporting this!

(cherry picked from commit 0eecff942dc3700e008a9941ac406a565325ef89)

* Update version to 2.1.4

* Update ChangeLog for 2.1.4

* Fix db_url setting - do not make it mandatory if no db is used

(cherry picked from commit 17beb2de8b5325e4363292bfbee9484809554f4a)

* Fixed memory leak on modules/drouting/drouting.c

This leak occures in function get_group_id() when do_routing is called without parameters in opensips.cfg.
In this case the dr_default_grp variable is not equal -1 and 'return dr_default_grp' is executed without freeing the res variable previously allocated for query execution.

(cherry picked from commit 65739943151f08aee18a7bc2125c7ac90ee84d00)

* Remove unnecessary test.

"res" cannot be null at that point

(cherry picked from commit 0b60681f0cc08ffd13fbac3dc5cbde17904ad177)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants