Setting ignore_early_media=true has a better chance of success for T38 fax transmissions.
Setting this as a fax variable in default settings is enough for most cases where a successful transmission occurs on the first attempt. However if fax retries are needed this variable was ignored until now.
This change ensures that IF the user sets ignore_early_media=true as a default fax setting it will also be used for fax retry scenarios when T38 is enabled. If ignore_early_media is not set to true then the changes here are ignored thus minimizing risk.
Had an issue with malformed email confirmation where the number_dialed was showing up with a bunch of random repeating strings after it. This resolved it for me. Also fixed a grammar error.
Please do further testing/review and give comments and suggest cleanup, etc.
This bug is only tripped if all of the following are true:
a) fax send fails
b) email notification of fax failure also fails
c) Other?
how to test
- have a 100% working fax to email setup.
- Change Advanced->defaults->email and set the port to be something invalid.
- e.g. smtp port 9999 is invalid
- send a test fax to something without a fax
- e.g. I just faxed my own DID which does NOT have fax answering
- each time the phone rings answer...wait 5 seconds, and then hang up
- note: it will retry sending the fax 5 times so repeat the above.
- on the last try it will give up, and try to send the failure email
- the email will fail (bad port) and then it will insert the failed email into v_emails
- the insert will fail and nothing in v_emails
Error was caused by trying to insert '' into the domain_uuid field.
'' is invalid in a uuid field, but null is okay.
The null is caused by no x-headers being passed. So these two fields end up null:
$headers["X-FusionPBX-Domain-UUID"]
$headers["X-FusionPBX-Email-Type"]
Ignoring unset/uninitialized variables hides bugs.
Fix: feed the X-Header in the calling lua code.