News for hackers. Stuff that matters.
Re:Command Line Faxing by jnankin on Monday August 04, 2014 @12:59PM (#8132734)
Phaxio co-founder here. Thanks for the write up, Pete! Really great to see the product we've been bootstrapping for 3 years on the front page of HN. We're devoted to making developer faxing as easy as possible. If you have any comments or questions about the service, feel free to contact me directly at josh at phaxio dot com.
Re:Command Line Faxing by joosters on Monday August 04, 2014 @11:39AM (#8132215)
In general, it's a terrible idea to run a command that contains secret information in the command line. The 'API secret' will be viewable by any user on the machine. (For instance, they could run 'ps waux' and grab the key)

Of course, the script could be running on a machine with only one user, so there might be no problem for this specific case. But it's just good practice to avoid creating potential security holes.

Re:Command Line Faxing by zrail on Monday August 04, 2014 @11:42AM (#8132239)
Yep, absolutely right. This is just running on my laptop so there's no other user, but a server-based solution should absolutely hit the API using something like Faraday[1] or requests[2].

[1]: https://github.com/lostisland/faraday

[2]: http://docs.python-requests.org/en/latest/

Re:Command Line Faxing by joosters on Monday August 04, 2014 @02:22PM (#8133233)
I think there's an even easier fix here; you can solve it by getting curl to read the form parameters from a file (I'm not 100% sure, the manpage seems to suggest that -F can take a file source, but it might just be referring to how to upload an entire file?)
Re:Command Line Faxing by cpr on Monday August 04, 2014 @10:46AM (#8131950)
Nice work, thanks for documenting!

We've been very happy with the HelloFax (YC W11) service for some time now.

We pay $5/month for the once-every-few-months fax we get or send, but it still seems like a good deal for an official fax interface to the world. It's painless to use and has a pleasant web interface.

Re:Command Line Faxing by zrail on Monday August 04, 2014 @10:50AM (#8131968)
Thanks!

I was initially using eFax but their $16.99/mo fee was waaay too high for my usage, so then I tried to use HelloFax but their sign up form was busted. Ended up with Phaxio while searching for an API to power my own web-based fax app which never materialized after I found the email integration.

Re:Command Line Faxing by zrail on Monday August 04, 2014 @10:20AM (#8131834)
Note: Phaxio hasn't compensated me for this post. I'm just a happy small-time customer :)
Re:Command Line Faxing by otoburb on Monday August 04, 2014 @10:32AM (#8131888)
Thanks for the write-up. This hits a serious pain point for anybody needing to interface with older institutions or businesses preferring fax as their main communication channel.

Appreciate the reminder of the OS X Preview signature signing capability!

Re:Command Line Faxing by jobu on Monday August 04, 2014 @01:26PM (#8132914)
+1 for the tip about capturing signatures in OSX Preview. That's a pretty cool feature that I had no idea existed.
Re:Command Line Faxing by ef4 on Monday August 04, 2014 @11:25AM (#8132135)
Thanks. I have integrated with both Pamfax and Interfax, and neither really makes me happy. I will check this out in detail.

HelloFax is also a great service, but not comparable. It's for end users, not a programmable API.

Re:Command Line Faxing by hsitz on Monday August 04, 2014 @11:38AM (#8132210)
I have been happy with Faxaway. I think my $10 payments each last me almost a year, given how much I use the service ($1/month plus $0.11 per minute sending in U.S., receive faxes for free). The interface is email: put fax phone number + '@fax2.faxaway.com' as recipient, 'FAXDOC' as subject, and attach pdf of document you're faxing. Works great.
Re:Command Line Faxing by dergachev on Monday August 04, 2014 @11:47AM (#8132273)
We've been using myfax.com for $10/month and it works the same way. Hasn't failed us once in many years, but kind of pricy. Maybe worth considering a cheaper alternative.
Re:Command Line Faxing by sunsu on Monday August 04, 2014 @11:52AM (#8132310)
I highly doubt that actually have "a whole bunch of fax machines" or even "banks of modems" anywhere. They are probably just using FreeSWITCH.
Re:Command Line Faxing by cbhl on Monday August 04, 2014 @01:23PM (#8132894)
Just curious: how does one connect FreeSWITCH to POTS without "banks of modems"? I was under the impression that sending faxes over SIP was a Bad Idea(TM).
Re:Command Line Faxing by tbyehl on Monday August 04, 2014 @03:09PM (#8133467)
PRI interfaces with hardware or software DSPs are the "new" banks of modems.
Re:Command Line Faxing by zrail on Monday August 04, 2014 @11:55AM (#8132326)
Oh I had no idea FreeSWITCH lets you send faxes. That makes a lot more sense :)
Re:Command Line Faxing by vladimirralev on Monday August 04, 2014 @01:24PM (#8132899)
Not only that, but sending a fax from your own freeswitch is a one-liner from the command line itself like this:

  fs_cli originate sofia/sipinterface/destination@privider &txfax(/fax.tiff)
Re:Command Line Faxing by XorNot on Monday August 04, 2014 @12:30PM (#8132575)
Hylafax through IAXmodem with Asterisk will also do it. Asterisk will directly as well, but it's not as well put together.
Re:Command Line Faxing by latchkey on Monday August 04, 2014 @01:58PM (#8133099)
I solved this issue with an obi200 + cheapo fax machine + google voice. I need a hardware solution because my non-techie wife needs to be able to fax without my help. I had a obi100 but it couldn't fax at all, so I sold it for a small profit (ha!).

I also got an email from Obihai recently saying that GV is discontinuing fax support, but so far it seems to continue working just fine, shrug.

Re:Command Line Faxing by tfrivold on Thursday August 07, 2014 @05:01AM (#8146811)
I really like this guide. Also because it gives me a nice example of how to use an API with Python (I'm learning stuff). Much apprechiated!
Re:Command Line Faxing by rsync on Monday August 04, 2014 @01:34PM (#8132961)
On the one hand, this interests me because I am a unix user and I hate faxing so, so much.

But on the other hand, this just promotes faxing. Faxing needs to die, immediately. Nobody anywhere should be faxing anything for any reason, ever.

The only reasonable response to (anything to do with faxing) is this:

http://cdn.shopify.com/s/files/1/0042/9942/products/hatedeat...

Re:Command Line Faxing by anarchoni on Monday August 04, 2014 @02:31PM (#8133284)
Easily the coolest thing I've seen in a while.
Re:Command Line Faxing by tghw on Monday August 04, 2014 @12:06PM (#8132416)
Does Ruby not have a good HTTP library? Why would you ever shell out to curl?
Re:Command Line Faxing by zrail on Monday August 04, 2014 @12:10PM (#8132442)
Because I'm lazy, basically. I already had a working curl command, I just wanted to make it sanity check my arguments. Also, in my experience convincing the various Ruby libraries to do multipart form uploads (for the documents themselves) is sort of a pain (but if there's an alternative I would love to hear it!)
Re:Command Line Faxing by tghw on Monday August 04, 2014 @12:37PM (#8132609)
Sorry, can't make any Ruby suggestions. I spend more time in the Python world where we have requests[0], which makes it all dead simple.

For example, multipart file uploads looks like:

    files = {'filename[]': open(filename, 'rb')}
    data = {'to': to, 'api_key': api_key, 'api_secret': api_secret}
    response = requests.post(url, data=data, files=files)
[0]http://docs.python-requests.org/en/latest/