Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am about to make some email to fax gateway --- some python program will make Asterisk call files and put them into some queue (files or db based).

Then another program should take "call tasks" from queue and "feed" them to asterisk (honoring some configured limit, because of res_fax_digium will drop over-limited tasks).

Next, let's suppose, everything is great and asterisk successfully sent some fax document. What could be a way to get the status of this operation?

If logfiles parsing is the best, I would, probably, assign some special accountcode (I can play with this field, probably) to drop CDRs into separate files, too.

Please, which other ways I should evaluate?

share|improve this question
up vote 2 down vote accepted

So, I dropped this approach and will go another way --- AMI, Asterisk Management Interface API.

In a couple of words.

Having created dialplan like this one:

exten => _X.,1,NoOp()
     same => n,SendFax(${faxfile},f)

I can originate calls with (using pyst):

res = mgr.originate(
        'TRUNK': 'SIP/m2000',
        'faxfile': '/tmp/file.tiff',

And having set debug = on in manager.conf, I can listen to needed events:

# will catch a status of `originate` call
# (this does not require `debug = on` in `manager.conf`):
mgr.register_event('OriginateResponse', handle_response)

# will catch `SendFax` application's result:
mgr.register_event('FaxStatus', handle_response)

So, res_fax_digium fires FaxStatus event after SendFax is complete.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.