12. ngcp-faxserver system configuration

12.1. ngcp-faxserver mail2fax configuration
12.2. ngcp-faxserver per subscriber configuration
12.3. sending faxes using email clients (mail2fax)
12.4. sending and receiving faxes via the REST API
12.4.1. configuring fax settings
12.4.2. sending a fax
12.4.3. receiving a fax
12.4.4. configuring the mail2fax settings
12.4.5. using advanced faxserver and mail2fax settings via the REST API
12.5. fax tests
12.6. Fax Debug

The fax solution is available in Pro and Carrier only

12.1. ngcp-faxserver mail2fax configuration

  • sip:provider PRO mail server (Exim in this case) must be configured to receive emails from outside as by default Exim listens on the local interface only
  • run "dpkg-reconfigure exim4-config" to adjust Exim configuration
  • DNS must be configured with a subdomain starting as mail2fax.yourcompany.com, that is where the faxes will be sent by users to trigger "mail2fax" or alternatively, edit /etc/ngcp-config/templates/etc/exim4/conf.d/router/999_mail2fax.tt2 and adjust it to your personal preferences

12.2. ngcp-faxserver per subscriber configuration

  • On the GUI interface (ngcp-panel) Subscribers → Preferences
  • Look up the "Fax Features" section where there are "Fax2Mail and Sendfax" and "Mail2Fax" subsections.

12.3. sending faxes using email clients (mail2fax)

  • "To" header must contain sip:provider PRO the subscriber’s number
  • "Subject" header must contain the fax destination number
  • "Body" should consist of text data and/or PDF attachment(s)
  • To use "Secret key", it should be either put in the first row of the body followed by an empty line or included as a text attachment. Once validated, it is removed from the email.

Note: either add the "Secret key" to the body or attach it. Never add both as only one will be recognized and removed, leaving the other one to be sent as a part of the fax.

Example:

  • provided there is a subscriber on sip:provider PRO platform with the 43130111 number, the destination fax is 43130222 and the "Secret key" is "MySecretKey"
To: 43130111
Subject: 43130222

MySecretKey

This is a test fax.

Cheers

12.4. sending and receiving faxes via the REST API

You can send and receive faxes using the built-in REST API interface and configure fax settings.

12.4.1. configuring fax settings

The following example retrieves the fax settings for the subscriber with ID 3.

Method: GET Content-Type: application/hal+json

https://127.0.0.1:1443/api/faxserversettings/3

The output format is as follows (only the relevant output data is shown):

"active" : true,
 "destinations" : [
    {
       "destination" : "user@company.com",
       "filetype" : "PDF14",
       "incoming" : true,
       "outgoing" : true,
       "status" : true
    }
 ],
 "name" : null,
 "password" : null

The following example updates a specific parameter, Namely, it deactivates the fax feature for the particular subscriber.

Method: PATCH Content-Type: application/json-patch+json

https://127.0.0.1:1443/api/faxserversettings/3

--data-binary [ { "op" : "replace", "path" : "/active", "value" : 0 } ]

12.4.2. sending a fax

The following request sends a pdf file located at /tmp/test_fax.pdf as fax to 431110002 from the subscriber with ID 3.

Method: POST Content-Type: multipart/form-data

https://127.0.0.1:1443/api/faxes/

--form json={"destination" : "431110002", "subscriber_id" : 3} --form faxfile=@/tmp/test_fax.pdf

12.4.3. receiving a fax

All received faxes are stored on the server and can be retrieved on demand. You can retrieve a stored fax by following these steps:

Firstly, obtain the internal ID of the fax

Method: GET Content-Type: application/json

https://127.0.0.1:1443/api/faxes/3

This request returns the list of stored faxes for the subscriber with ID 3.

One of the available faxes is returned like this:

"callee" : "431110002",
"caller" : "431110001",
"direction" : "out",
"duration" : "0",
"filename" : "d9799276-b7d9-454f-98c3-714edf7e3072.tif",
"id" : 5,
"pages" : "1",
"quality" : "8031x7700",
"reason" : "Normal Clearing / SIP 200 OK [1/3]",
"signal_rate" : "14400",
"status" : "SUCCESS",
"subscriber_id" : 1,
"time" : "2016-07-30 09:49:59"

Now, to retrieve the fax with ID 5, use the following request:

Method: GET Content-Type: application/hal+json

https://127.0.0.1:1443/api/faxerecordings/5

By default, the fax is in the TIFF format. It is also possible to request it in a different format (currently supported formats are: PS, PDF, PDF14).

To retrieve the same fax in PDF14, use the following request:

https://127.0.0.1:1443/api/faxerecordings/5?format=pdf14

12.4.4. configuring the mail2fax settings

The configuration of mail2fax settings via the REST API is similar to the fax settings configuration.

To get the mail2fax configuration for the subscriber with id 3, use the following request:

Method: GET Content-Type: application/hal+json

https://127.0.0.1:1443/api/mailtofaxsettings/3

The output format is as follows (only the relevant output data is shown):

"acl" : [],
"active" : false,
"secret_key" : "secretkeypassword",
"secret_key_renew" : "daily",
"secret_renew_notify" : [
   {
      "destination" : "user1@company.com"
   }
]

The following set of requests changes the mail2fax configuration:

  • the secret key update:

Method: PATCH Content-Type: application/json-patch+json

https://127.0.0.1:1443/api/faxserversettings/3

--data-binary [ { "op" : "replace", "path" : "/secret_key", "value" : "newsecretkeypassword" } ]

  • the secret key renewal interval update:

--data-binary [ { "op" : "replace", "path" : "/secret_key_renew", "value" : "monthly" } ]

  • update the list of email addresses that receive the automatic secret key update notifications

--data-binary [ { "op" : "replace", "path" : "/secret_renew_notify", "value" : [ { "destination": "user2@company.com" }, { "destination": "user3@company.com" } ] } ]

12.4.5. using advanced faxserver and mail2fax settings via the REST API

On the NGCP REST API documentation web page you can find the complete list of available faxserver and mail2fax configuration parameters: https://127.0.0.1:1443/api/ The information on the web page is relevant for your paltform version and may change in next releases.

12.5. fax tests

  • To test an incoming fax, dial the corresponding phone/fax number from a fax machine. You should receive the email with the attached fax
  • To test an outgoing fax, login to the subscriber self-care interface and send a fax from it
  • Mail2Fax, send an email to the configured "mail2fax" subscriber

12.6. Fax Debug

  • Use the following log file to debug the fax functionality /var/log/ngcp/faxserver.log