From 6d769f037d00f0ab52e5b50f31f3319e5a9fb00b Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 12 Mar 2013 08:09:41 -0400 Subject: use fax_account_id --- misc/freeswitch/scripts/dialplan/fax.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/freeswitch/scripts/dialplan/fax.lua b/misc/freeswitch/scripts/dialplan/fax.lua index 6dce0a9..dc52d16 100644 --- a/misc/freeswitch/scripts/dialplan/fax.lua +++ b/misc/freeswitch/scripts/dialplan/fax.lua @@ -231,8 +231,8 @@ function Fax.insert_document(self, record) return self.database:query(sql_query); end -function Fax.trigger_notification(self, fax_document_id, uuid) - local command = 'http_request.lua ' .. uuid .. ' http://127.0.0.1/trigger/fax?fax_account_id=' .. tostring(fax_document_id); +function Fax.trigger_notification(self, fax_account_id, uuid) + local command = 'http_request.lua ' .. uuid .. ' http://127.0.0.1/trigger/fax?fax_account_id=' .. tostring(fax_account_id); require 'common.fapi' return common.fapi.FApi:new():execute('luarun', command); -- cgit v1.2.3 From f2d1e7e2d7d0a9c92134bf1d20a61a45495e12da Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 12 Mar 2013 08:10:33 -0400 Subject: trigger url after sending --- misc/freeswitch/scripts/send_fax.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc/freeswitch/scripts/send_fax.lua b/misc/freeswitch/scripts/send_fax.lua index d717f93..ded8c65 100644 --- a/misc/freeswitch/scripts/send_fax.lua +++ b/misc/freeswitch/scripts/send_fax.lua @@ -173,6 +173,12 @@ if session and session:answered() then cause = session:hangupCause(); log:info('FAX_SEND - end - fax_document=', fax_document.id, ', success: ', fax_state.state, ', cause: ', cause, ', result: ', fax_state.result_code, ' ', session:getVariable('fax_result_text')); + + local command = 'http_request.lua sendfax http://127.0.0.1/trigger/fax_has_been_sent/' .. tostring(fax_document.id); + + require 'common.fapi' + common.fapi.FApi:new():execute('luarun', command); + else if session then cause = session:hangupCause(); -- cgit v1.2.3