- fixed NULL sockets in external scenarios (this leads to crashing when building the contact hdr)
  Reported by dexteruk on IRC .
 Fixed bug introduced by previous commit :

	- downstream BYEs should go to 200OK leg in order to trigger dialog termination
	- upstream BYEs have no such limitation ( there's only one caller leg :) )
(cherry picked from commit e1ae01b41a6c1db4ccfcf4d378d4a8365f3004e9)
Fixed RFC 4235 notifications compliance.

The RFC states that a NOTIFY sent after a SUBSCRIBE (initial
or refreshed) must contain a full state notification.
However, a NOTIFY sent after a PUBLISH must contain a partial state
indicating the specific state change.

Without this patch, OpenSIPS actually publishes a full state
notification in all cases (despite announcing a partial notification),
making the publish ordering fix patch useless.
Code beautification.

Use a 4-chars wide tab for indentation instead of spaces.
Merge pull request #62 from dsandras/ds-dialoginfo-notifications-fixes

Fixed RFC 4235 notifications compliance.
- when starting the FR timer, it should not override any previous setting of a FR or FR_INV timers.
  Solves Issue #25 (reported and troubleshooted by Mayama Takeshi) when a very fast 100 reply may stop retransmissions, but brake the updating of fr timer from FR to FR_INV state.
-  Gracefully detect if the uac_auth modules is available for usage in b2b_entities modules - do not through an error message but rather an info one, as find the uac_auth module is optional.
- fixed CANCEL matching in B2B
- backport from 5c9b24f
always free the DB result ( or else subsequent select queries will/might fail )
Correct the min_expires default in pua documentation.
Fix evi crash when defining more than 10 events
(cherry picked from commit ba04cba6d5f7bc945bbc42d2e46694639fea8b79)
Fix PUA module so that it sends a final PUBLISH on expiration.

A final PUBLISH with expires=0 is now generated when a publication has
expired. This will trigger the transmission of a final state NOTIFY.

Cherry picked from: c5a57a8d39cf568d6558332ca71ea8344a5a4f57
Merge pull request #73 from wdoekes/wjd-pua_min_expires_doc

pua.c sets int min_expires= 300, not 0 as documentation states.
- fixed overflow in parsing the content len value
  Reported by franklyfox on GITHUB
  Closing issue #78
- fixed double free when building insert fails (in buffered insert mode)
  Reported by Brett Nemeroff
- doc examples fixed
  Reported by "miha" on IRC
handle the signals while waiting for the startup route to end (if not, the main proc will never know if the child running startup route crashed and it will hang for ever during startup)
In DELAYED mode, flush vars & profile to DB at ACK time too - no timer tick between 200 OK and ACK was droping the update operation to DB.
Please note that this "bug" had actually no implications, as dialog data is either used from memory cache, either from DB after a restart (and a shutdown flushes everything to DB).
Related to issue #97.
Fixed the re-loading of dlg vars after restart
Credits to Nick Altmann
(cherry picked from commit ec0d05aaef41b0a4f30419bbab1295eb4bce7e49)
Fix a particular startup crash

e.g. when defining only 1 tcp interface while specifying
"disable_tcp=true"
(cherry picked from commit 101ee782480af07cd9d056b41b9f33d331d21951)