I'm calling an application (txfax) using an originate.
I've managed to monitor events and wait for a hangup event so that I
know that the application has completed executing.
The question is how do I get the return value from the application.
Reading the source of txfax (app_txfax.c) it appears that txfax returns
a value of -1 if the call fails.
In further reading it appears that many applications increment the
priority in some manner.
If so can I get the return value be getting the priority and subtracting
some base value?
If that is the technique then how do I get the priority value?
And the code
originateAction = new OriginateAction();
originateAction.setChannel(channel.getChannelName() + "/"
+ Fax.getTelephoneNo(recipient));
originateAction.setContext(channel.getContext());
HashMap<String, String> variables = new HashMap<String,
String>();
Configuration config = Configuration.getInstance();
variables.put("MaxRetries", "1");
variables.put("RetryTime", new Integer(config.getRetryTime())
.toString());
variables
.put("WaitTime", new
Long(config.getWaitTime()).toString());
originateAction.setVariables(variables);
originateAction.setApplication("txfax");
String data = fax.getTiffFile().getFile().getAbsolutePath()
+ "|caller";
if (config.isDebugTxFax())
data += "|debug";
originateAction.setData(data);
originateAction.setPriority(new Integer(config.getPriority()));
originateAction.setTimeout(new Long(config.getTimeOut()));
Any help would be appreciated.
Regards,
Brett
|