- BYE requests received in confirmed state should terminate the dialog only if they match the TO-tag from 200 OK INVITE.
  This affects parallel forking scenarios where rejected branches are terminated via BYE by caller.
  Thanks for reporting and testing to Marco Hierl.
- code beautification - tabs versus spaces / identation
- removed unused variable
 - normalize some debug logs
- partial porting of merge 50117f (adapted to 1.8)
Fix memleak in nathelper natping when "failed to fetch contacts".

Re-ordered some code around in nh_timer() so buf is always freed. Even
in rare cases when ul.get_all_ucontacts() returns false (because someone
broke the database).
Merge pull request #68 from wdoekes/wjd-fix_nathelper_memleak

Fix memleak in nathelper natping when "failed to fetch contacts".
- 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.