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?

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .