TRY THIS Call my PBX to fax my resume to entered number

Red RedMan

New Member
Joined
Nov 23, 2014
Messages
16
Reaction score
5
I would love to call my pbx system on my raspberry pi and have a dial plan that lets you send a doc. or pdf. copy of well in my case my Resume, But any file you have pre-configured in dial plan or php what ever would be correct. And Send to an entered number.
Mahalo,
Thank You
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
Do a Forum search in here or a google search as I remember this functionality was done a few years ago.

Where you would call a DID to a Misc Destination that is a List of documents, #1-9, that would be then faxed to the CID you called from. So you would have to call from the machine you wanted the doc sent to.

So if you can find it you may be able to adjust the code to call any number instead of the CID.

I think this was before Incrediblefax (or maybe together with it) so it may be do-able now. I may have a use for ot as well but it is not a critical piece for me right away.

Good Luck
 

Red RedMan

New Member
Joined
Nov 23, 2014
Messages
16
Reaction score
5
Thanks for the fast reply,
I will do a search for this.
I'm just playing around I installed a Cisco NBX 100 and it requires a Cisco 9100 router in 1997 it was $54,000 back then and it did less than this $35 raspberry pi, Huh :eek:
If I find this fax plugin ill post it here or I'll compile my own the dial plan scripting look straight forward.
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
I did some digging and found this WAS done a while back as googling Fax on Demand Piaf brought me to articles on 'Nerd Vittles' written by our own wardmundy .

In the features list is shows Fax on Demand (F-O-D [363]) and has a link -- unfortunately it looks as if the thread was lost in the great crash some months back, (and possibly dropped in newer versions of PiaF )I use green and 363 says call cannot be completed (not a valid code) -- so maybe one of our Devs still has the code used back then, or maybe has updated it for use with green or even incorporated it into Incredifax11 (or newer).

I am relitively certain it can still be done but I am no coder. (I am following the thread Asterisk-GUI as I would like to learn how stuff works [without freePBX] so maybe I CAN be a coder .... someday.

Keep on truckin'
 

Red RedMan

New Member
Joined
Nov 23, 2014
Messages
16
Reaction score
5
Ok I think I'am Close,
I found the sendfax -n -d NNNNNNNNN doc.pdf command.
and I think this should work
add this to /etc/asterisk/extensions_custom.conf

;# [FaxBack]
exten => 329,5,Answer
exten => 329,10,Wait(1)
exten => 329,15,agi(googletts.agi,"Welcome to the Fax Station:. Please enter your 10 digit fax number.",en)
exten => 329,20,Read(NUMBER,beep,10)
exten => 329,25,agi(googletts.agi,"Choose number 1: For your Ryan's Resume:.Please enter the Resume number to retrieve.",en)
exten => 329,30,Read(DOC,beep,1)
exten => 329,35,agi(googletts.agi,"To fax document number ${DOC} to fax number: ",en)
exten => 329,40,SayDigits(${NUMBER},)
exten => 329,45,agi(googletts.agi,"Press 1 now. or 2 Cancel",en)
exten => 329,50,Read(FAXOK,beep,1)
exten => 329,55,GotoIf($["foo${FAXOK}" = "foo1"]?70)
exten => 329,60,agi(googletts.agi,"Your Fax has been cancelled.",en)
exten => 329,65,Goto(80)
exten => 329,70,System(/usr/bin/sendfax -n -d ${NUMBER} /root/faxes/${DOC}.pdf)
exten => 329,75,agi(googletts.agi,"Your Resume number ${DOC} is now being sent.",en)
exten => 329,80,agi(googletts.agi,"Mahalo. Good bye.",en)
exten => 329,85,Hangup
;#[END FaxBack]

But google is down for what ever and can't test it right now it's late here on Maui
Any help would be great
oh just name you pdf files 1,2,3 ect. and place them in /root/fax/ or change line 70 to what ever folder you like just make sure you name the like 1.pdf or 2.pdf ECT.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
FYI: If you put the documents in /root, they'll never go out. Asterisk dialplan runs as user asterisk which has no permissions to access /root tree. Better to put the docs in a new folder under /etc/asterisk.
 

Red RedMan

New Member
Joined
Nov 23, 2014
Messages
16
Reaction score
5
FYI: If you put the documents in /root, they'll never go out. Asterisk dialplan runs as user asterisk which has no permissions to access /root tree. Better to put the docs in a new folder under /etc/asterisk.

Ahh. Thats why it won't send thanks for the help.
 

Red RedMan

New Member
Joined
Nov 23, 2014
Messages
16
Reaction score
5
I found the original it was at http://incrediblepbx.com/fod.txt
But it shows me i was close really close but can't get them to work.
as i'm ssh in my system and use this dial plan it ask's for my password
So im a little confused it on my raspberry pi. don't think it matters
if i use the sendfax -n -d 8085551212 doc.pdf it asks for password and sends perfectly.
but not here with these scripts.
Well Ill get it but any help would be appreciated

RedMan
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Try adding this to the end of /etc/sudoers:

Code:
asterisk ALL = NOPASSWD: /usr/bin/sendfax
 

Red RedMan

New Member
Joined
Nov 23, 2014
Messages
16
Reaction score
5
OK :banghead:
I visudo added the lines at the bottom and no go.
So I faxadduser -a "adminpass" -p "userpass" -u 1000 asterisk . at this point i could use sendfax -0 user: pass -n -d number file.pdf
and it still wants a password .
is there a option after System(/usr/bin/sendfax -n -d ${NUMBER} /root/faxes/${DOC}.pdf) is ran to echo the password with carriage return or something.
Thanks for all the help I do appreciate it.
OH No I'm A PBX Addict :stupid:
 

Red RedMan

New Member
Joined
Nov 23, 2014
Messages
16
Reaction score
5
Found it had to edit /var/spool/hylafax/etc/hosts.hfaxd
and add on bottom 127.0.0.1 to allow local client permission to hylafax with no password.
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top