<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> <!--@import url(scrollbar.css); --></STYLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>                        body{FONT-SIZE:12pt; FONT-FAMILY:宋体,serif;}                </STYLE>
<META name=GENERATOR content="MSHTML 11.00.9600.17041"><BASE
target=_blank></HEAD>
<BODY
style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 12px; LINE-HEIGHT: 1.3; BORDER-TOP-WIDTH: 0px"
marginheight="0" marginwidth="0">
<DIV><FONT color=#000000 size=3 face=宋体>Hi Nathan,</FONT></DIV>
<DIV> </DIV>
<DIV>Thanks very much!</DIV>
<DIV> </DIV>
<DIV>Could you please provide the 'require
"/local/freeswitch/bin/hook-libs.pl";' file to me for review?</DIV>
<DIV> </DIV>
<DIV>For PHP or Perl, it's similar for me.</DIV>
<DIV> </DIV>
<DIV>much more guidline is much helpful.</DIV>
<DIV> </DIV>
<DIV>Thanks!</DIV>
<DIV> </DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana>2014-04-17</FONT></DIV>
<DIV align=left><FONT size=2 face=Verdana>
<HR id=SignNameHR style="HEIGHT: 2px; WIDTH: 122px" align=left SIZE=2>
</FONT></DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana><SPAN
id=_FlashSignName>sparklezou</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Verdana>
<HR>
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG>Nathan Neulinger
<nneul@mst.edu></FONT></DIV>
<DIV><FONT size=2
face=Verdana><STRONG>发送时间:</STRONG>2014-04-15 20:48</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG>Re: [Freeswitch-users]
[Freeswitch-dev] How to check the "fax_result_code" in the script? such as php
script?</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>收件人:</STRONG>"FreeSWITCH Users
Help"<freeswitch-users@lists.freeswitch.org></FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG></FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>
<DIV>Can't help you on the PHP side, but I do this with sending a fax with perl based web page. If you're wanting to do it </DIV>
<DIV>inline, I think you'd have to listen for events as you've described... </DIV>
<DIV> </DIV>
<DIV>... </DIV>
<DIV> push( @args, "fax_notify_address='" . $ENV{REMOTE_USER} . "\@mst.edu'" ); </DIV>
<DIV> push( @args, "api_hangup_hook='perl /local/freeswitch/bin/notify-fax-status-hook.pl'" ); </DIV>
<DIV>... </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>and then the attached script. </DIV>
<DIV> </DIV>
<DIV>Key parts: </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>our $env; </DIV>
<DIV>our $session; </DIV>
<DIV>my $addr = $session->getVariable("fax_notify_address"); </DIV>
<DIV>my $to = $session->getVariable("destination_number"); </DIV>
<DIV>... </DIV>
<DIV> my $fax_status = $session->getVariable("fax_success"); </DIV>
<DIV> my $status_msg = "Sent OK"; </DIV>
<DIV> if ( $fax_status != 1 ) { </DIV>
<DIV> $status_msg = "Failed"; </DIV>
<DIV> } </DIV>
<DIV> my $result = $session->getVariable("fax_result_text"); </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>On 04/15/2014 01:00 AM, sparklezou wrote: </DIV>
<DIV>> Hi All, </DIV>
<DIV>> I checked and find two possible solution. But still NOT clear. </DIV>
<DIV>> 1. Run "fs_cli" in PHP script. But NOT find to correct command to show the channel variables. Nor the data for Mod_spandsp. </DIV>
<DIV>> https://wiki.freeswitch.org/wiki/Fs_cli#Simple </DIV>
<DIV>> 2. get info from "Mod event socket". But still NOT very clear how to get the Mod_spandsp event. </DIV>
<DIV>> https://wiki.freeswitch.org/wiki/Mod_event_socket#api </DIV>
<DIV>> https://wiki.freeswitch.org/wiki/Event_Socket_Library#events </DIV>
<DIV>> https://wiki.freeswitch.org/wiki/Event_List#Event-Name </DIV>
<DIV>> https://wiki.freeswitch.org/wiki/Mod_spandsp </DIV>
<DIV>> Please share your idea, how to handle such issue? </DIV>
<DIV>> Hope there is direct way to get the result code, then it will be easy to handle fax step in the script. </DIV>
<DIV>> Thanks! </DIV>
<DIV>> 2014-04-15 </DIV>
<DIV>> ------------------------------------------------------------------------------------------------------------------------ </DIV>
<DIV>> sparklezou </DIV>
<DIV>> ------------------------------------------------------------------------------------------------------------------------ </DIV>
<DIV>> *发件人:*Michael Jerris <mike@jerris.com> </DIV>
<DIV>> *发送时间:*2014-04-14 20:08 </DIV>
<DIV>> *主题:*Re: [Freeswitch-users] How to check the "fax_result_code" in the script? such as php script? </DIV>
<DIV>> *收件人:*"FreeSWITCH Users Help"<freeswitch-users@lists.freeswitch.org> </DIV>
<DIV>> *抄送:* </DIV>
<DIV>> you could use an api hangup hook, or possibly do it in cdr processing. </DIV>
<DIV>> </DIV>
<DIV>> On Apr 10, 2014, at 10:39 PM, sparklezou <sparklezou@163.com <mailto:sparklezou@163.com>> wrote: </DIV>
<DIV>> </DIV>
<DIV>>> Hi Buddies, </DIV>
<DIV>>> Reviewed the wiki,https://wiki.freeswitch.org/wiki/Mod_spandsp </DIV>
<DIV>>> How to check the "fax_result_code" in the php script? </DIV>
<DIV>>> Also other result info, such as*fax_result_text,*then could provide more detail response info to the client. </DIV>
<DIV>>> Thanks! </DIV>
<DIV>>> 2014-03-03 </DIV>
<DIV>>> ------------------------------------------------------------------------------------------------------------------------ </DIV>
<DIV>>> sparklezou </DIV>
<DIV>>> _________________________________________________________________________ </DIV>
<DIV>> </DIV>
<DIV>> </DIV>
<DIV>> </DIV>
<DIV>> _________________________________________________________________________ </DIV>
<DIV>> Professional FreeSWITCH Consulting Services: </DIV>
<DIV>> consulting@freeswitch.org </DIV>
<DIV>> http://www.freeswitchsolutions.com </DIV>
<DIV>> </DIV>
<DIV>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server </DIV>
<DIV>> http://www.cudatel.com </DIV>
<DIV>> </DIV>
<DIV>> Official FreeSWITCH Sites </DIV>
<DIV>> http://www.freeswitch.org </DIV>
<DIV>> http://wiki.freeswitch.org </DIV>
<DIV>> http://www.cluecon.com </DIV>
<DIV>> </DIV>
<DIV>> FreeSWITCH-dev mailing list </DIV>
<DIV>> FreeSWITCH-dev@lists.freeswitch.org </DIV>
<DIV>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev </DIV>
<DIV>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev </DIV>
<DIV>> http://www.freeswitch.org </DIV>
<DIV>> </DIV>
<DIV> </DIV>
<DIV>-- </DIV>
<DIV>------------------------------------------------------------ </DIV>
<DIV>Nathan Neulinger nneul@mst.edu </DIV>
<DIV>Missouri S&T Information Technology (573) 612-1412 </DIV>
<DIV>System Administrator - Architect </DIV>
<DIV> </DIV></FONT></DIV></BODY></HTML>