Skip to main content

Faxlib documentation

Will this ever be accurate again? FreeSWITCH uses v8 for Javascript now.


This is the documentation for an object based approach to faxing for FreeSWITCH with Javascript ( mod_spidermonkey). faxlib exposes certain methods and properties available to the calling program. They are documented here.

All the text below was last edited in 2007, it is therefore likely out-of-date, inaccurate and in dire need of a refresh


  • socketaddr - STRING host host:ip eg "localhost:8084"
  • session - SESSION OBJECT the current session
  • faxDetect - BOOLEAN state of fax CNG detection
  • faxFilePrefix - STRING directory prefix to the fax (for tx or rx)
  • faxFile - STRING the filename in faxFilePrefix of the fax
  • gotFax - BOOLEAN whether or not a fax was received


  • stopFaxDetect - stops fax CNG detection, called automatically when receiving a fax
  • startFaxDetect - starts fax CNG detection
  • getFaxFile - returns a STRING of the full path to the fax file
  • rxFax - receives a fax
  • txFax - transmits a fax
  • fax2pdf - converts a fax tiff into a pdf, the fax object will point to that pdf from then on


fax(session,socketaddr [, faxFilePrefix [, faxFile]])


var f = new fax(session,"localhost:8084","/tmp","myfax.tiff");

The last 2 arguments are optional and if not specified will be "/tmp" and the "<uuid>.tiff" where <uuid> is replaced by the current uuid of the call in progress.