modules/sca: fix 180 replies in sca_call_info_invite_reply_18x_handler()

    - Per Broadworks Release 13.0v1 documentation, 180s should produce
      "appearance-state=progressing" just like 183s do; Polycom OS 3.3.4
      doesn't care, but 4.x swaps leg information when it hears
      "appearance-state=alerting"
    - report and patch from  Joao Vitor Arruda

(cherry picked from commit 82e67c07eebe9f7277156a6a6d87ffd5e04c892d)
rtpproxy: swap tags for lookup command (l) to fix one way audio on reinvite

- affected cases when the lookup was used explicitely

(cherry picked from commit 21e54da18f9bc6f87f913a897c9183074de4c937)
dialog: simplified dlg referencing on creation and spiral detection

(cherry picked from commit fcf5f5b3115c0c40f4df9eb066489bb3e590c3b1)
dialog: release of dialog for not-forwarded initial request done by creator

- avoid releasing new dialog in case of upstream paralel forking
  or retransmission by other processes than the other which created the
  dialog
- it could result in destroying the dialog in initial state if the
  request was not forwarded yet, likely to happen because creator
  process runs more callbacks

(cherry picked from commit c125cf6f36aedb75b4f1e0b32dbe5bdd0a48b8b5)
dialog: when adding a new dialog, lock the slot until the structure is linked

- search for dialog based on sip attributes and if no result found, then
  lock the hash table slot until the new structure is built and linked
  in the table
- should avoid simulataneous creation for same dialog if there is a
  not-handled retransmission or parallel forking upstream, resulting in
  many processing managing duplicated requests

(cherry picked from commit 6fb686de57f783b3c29e5b4e11ad1509882616bb)
textopsx: msg_apply_changes() exits config execution if result is not parsing well

- sip_msg_t structure is can be invalid
- similar behavior with the case when the message is broken from the
  network, it doesn't get to config file
- reported by Marco B.

(cherry picked from commit 55960106bbaa908057c3f619034b146fda7df48b)
pua_dialoginfo: proper jump to end of the structure

- void has no standard size
- descovered on a report by Charles Chance

(cherry picked from commit 4108c7a125a3e50d1d670bc4c842b29cc32ec438)
json: fixed parameter number for free fixup function

(cherry picked from commit a1b6093aaee9e96f00475752273c9c925ba390d3)
core: main - proper info for -D command line option

(cherry picked from commit 2b33768745130b91e984b679f9eed01a6267d8cc)
core: update content for -D option in man page

(cherry picked from commit ee9ea2f543975769ca544dcf3b75b97698e3b53e)
tm: rebuild local Via when force socket is changed in event_route[tm:local-request]

- new forced socket is also set for sending out

(cherry picked from commit e404d123610b63ddd1c75d39667b373c40071eab)
tm: rebuild the local request if uri was changed in event route

- rebuild was done only on changes over headers and body, with an
  eventual new r-uri being used in that case
- no should work also when only r-uri is changed
- closes FS#158

(cherry picked from commit dbd8ea9b1fa216e59d4c36e2eb4b671202824259)
core: return OK as string for a successful dns.delete rpc command

- closes FS#260

(cherry picked from commit b77613398fe7a69d4ac52add3630c94373cbe3e8)
Makefile.defs: don't set gcc flag -maltivec if not advertised for powerpc

- reported at FS#444,
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=729635
- following a patch by Roland Stigge <stigge@antcom.de> on debian bug
  tracker

(cherry picked from commit 6fe4e56937563a413cfd83794e0fe71a20caf3d5)
msilo: proper walk through sent list for cleanup

- reported by Bhupendra Singh

(cherry picked from commit 5fd8a1bdaae82decdb606901fe7bf3e6e9149803)
xhttp_pi: proper sizeof for memset

(cherry picked from commit 613d188f92401c60549ea0337ea0dcf3c68067d7)
dialog: Set the dialog context on incoming replies

Before, the dialog context would be derived from the callid and tags. This
could select the wrong dialog in case of spirals. This patch sets the correct
dialog context by storing the it in the transaction and restoring it on an
incoming response. Now the correct dialog variables are available in
onreply_route.

(cherry picked from commit 25a3297915fbcc0a267d444d245526de978a5d62)
dialog: Set the dialog context on transaction failure

Before, the dialog context would be derived from the callid and tags. This
could select the wrong dialog in case of spirals. This patch sets the correct
dialog context by storing the it in the transaction and restoring it on a
failure. Now the correct dialog variables are available in failure_route.

(cherry picked from commit 811bb515c09e7270d1d7f8a28d280e184874e487)
dialog: Correctly restore dialog lifetime from DB

Restore the lifetime to the configured value instead of the offset from the
time the reload from the DB took place.

(cherry picked from commit 3d5f8af6efb5a33e46427a1a9b273e445a3064c7)
presence: take in consideration send_fast_notify when sending empty NOTIFY

- patch by Luis Azedo <luis.azedo@factorlusitano.com>

(cherry picked from commit 5bffcf8bdc83628aea4f5e3cda06b20ce88f659f)