<!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>&nbsp;</DIV>
<DIV>Thanks very much!</DIV>
<DIV>&nbsp;</DIV>
<DIV>Could you please provide the 'require 
"/local/freeswitch/bin/hook-libs.pl";' file to me for review?</DIV>
<DIV>&nbsp;</DIV>
<DIV>For PHP or Perl, it's similar for me.</DIV>
<DIV>&nbsp;</DIV>
<DIV>much more guidline is much helpful.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks!</DIV>
<DIV>&nbsp;</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 
&lt;nneul@mst.edu&gt;</FONT></DIV>
<DIV><FONT size=2 
face=Verdana><STRONG>发送时间:</STRONG>2014-04-15&nbsp;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"&lt;freeswitch-users@lists.freeswitch.org&gt;</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>抄送:</STRONG></FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Verdana>
<DIV>Can't&nbsp;help&nbsp;you&nbsp;on&nbsp;the&nbsp;PHP&nbsp;side,&nbsp;but&nbsp;I&nbsp;do&nbsp;this&nbsp;with&nbsp;sending&nbsp;a&nbsp;fax&nbsp;with&nbsp;perl&nbsp;based&nbsp;web&nbsp;page.&nbsp;If&nbsp;you're&nbsp;wanting&nbsp;to&nbsp;do&nbsp;it&nbsp;&nbsp;</DIV>
<DIV>inline,&nbsp;I&nbsp;think&nbsp;you'd&nbsp;have&nbsp;to&nbsp;listen&nbsp;for&nbsp;events&nbsp;as&nbsp;you've&nbsp;described...&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>...&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push(&nbsp;@args,&nbsp;"fax_notify_address='"&nbsp;.&nbsp;$ENV{REMOTE_USER}&nbsp;.&nbsp;"\@mst.edu'"&nbsp;);&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push(&nbsp;@args,&nbsp;"api_hangup_hook='perl&nbsp;/local/freeswitch/bin/notify-fax-status-hook.pl'"&nbsp;);&nbsp;</DIV>
<DIV>...&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>and&nbsp;then&nbsp;the&nbsp;attached&nbsp;script.&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Key&nbsp;parts:&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>our&nbsp;$env;&nbsp;</DIV>
<DIV>our&nbsp;$session;&nbsp;</DIV>
<DIV>my&nbsp;$addr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;$session-&gt;getVariable("fax_notify_address");&nbsp;</DIV>
<DIV>my&nbsp;$to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;$session-&gt;getVariable("destination_number");&nbsp;</DIV>
<DIV>...&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$fax_status&nbsp;=&nbsp;$session-&gt;getVariable("fax_success");&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$status_msg&nbsp;=&nbsp;"Sent&nbsp;OK";&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;$fax_status&nbsp;!=&nbsp;1&nbsp;)&nbsp;{&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$status_msg&nbsp;=&nbsp;"Failed";&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;$result&nbsp;=&nbsp;$session-&gt;getVariable("fax_result_text");&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>On&nbsp;04/15/2014&nbsp;01:00&nbsp;AM,&nbsp;sparklezou&nbsp;wrote:&nbsp;</DIV>
<DIV>&gt;&nbsp;Hi&nbsp;All,&nbsp;</DIV>
<DIV>&gt;&nbsp;I&nbsp;checked&nbsp;and&nbsp;find&nbsp;two&nbsp;possible&nbsp;solution.&nbsp;But&nbsp;still&nbsp;NOT&nbsp;clear.&nbsp;</DIV>
<DIV>&gt;&nbsp;1.&nbsp;Run&nbsp;"fs_cli"&nbsp;in&nbsp;PHP&nbsp;script.&nbsp;But&nbsp;NOT&nbsp;find&nbsp;to&nbsp;correct&nbsp;command&nbsp;to&nbsp;show&nbsp;the&nbsp;channel&nbsp;variables.&nbsp;Nor&nbsp;the&nbsp;data&nbsp;for&nbsp;Mod_spandsp.&nbsp;</DIV>
<DIV>&gt;&nbsp;https://wiki.freeswitch.org/wiki/Fs_cli#Simple&nbsp;</DIV>
<DIV>&gt;&nbsp;2.&nbsp;get&nbsp;info&nbsp;from&nbsp;"Mod&nbsp;event&nbsp;socket".&nbsp;But&nbsp;still&nbsp;NOT&nbsp;very&nbsp;clear&nbsp;how&nbsp;to&nbsp;get&nbsp;the&nbsp;Mod_spandsp&nbsp;event.&nbsp;</DIV>
<DIV>&gt;&nbsp;https://wiki.freeswitch.org/wiki/Mod_event_socket#api&nbsp;</DIV>
<DIV>&gt;&nbsp;https://wiki.freeswitch.org/wiki/Event_Socket_Library#events&nbsp;</DIV>
<DIV>&gt;&nbsp;https://wiki.freeswitch.org/wiki/Event_List#Event-Name&nbsp;</DIV>
<DIV>&gt;&nbsp;https://wiki.freeswitch.org/wiki/Mod_spandsp&nbsp;</DIV>
<DIV>&gt;&nbsp;Please&nbsp;share&nbsp;your&nbsp;idea,&nbsp;how&nbsp;to&nbsp;handle&nbsp;such&nbsp;issue?&nbsp;</DIV>
<DIV>&gt;&nbsp;Hope&nbsp;there&nbsp;is&nbsp;direct&nbsp;way&nbsp;to&nbsp;get&nbsp;the&nbsp;result&nbsp;code,&nbsp;then&nbsp;it&nbsp;will&nbsp;be&nbsp;easy&nbsp;to&nbsp;handle&nbsp;fax&nbsp;step&nbsp;in&nbsp;the&nbsp;script.&nbsp;</DIV>
<DIV>&gt;&nbsp;Thanks!&nbsp;</DIV>
<DIV>&gt;&nbsp;2014-04-15&nbsp;</DIV>
<DIV>&gt;&nbsp;------------------------------------------------------------------------------------------------------------------------&nbsp;</DIV>
<DIV>&gt;&nbsp;sparklezou&nbsp;</DIV>
<DIV>&gt;&nbsp;------------------------------------------------------------------------------------------------------------------------&nbsp;</DIV>
<DIV>&gt;&nbsp;*发件人:*Michael&nbsp;Jerris&nbsp;&lt;mike@jerris.com&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;*发送时间:*2014-04-14&nbsp;20:08&nbsp;</DIV>
<DIV>&gt;&nbsp;*主题:*Re:&nbsp;[Freeswitch-users]&nbsp;How&nbsp;to&nbsp;check&nbsp;the&nbsp;"fax_result_code"&nbsp;in&nbsp;the&nbsp;script?&nbsp;such&nbsp;as&nbsp;php&nbsp;script?&nbsp;</DIV>
<DIV>&gt;&nbsp;*收件人:*"FreeSWITCH&nbsp;Users&nbsp;Help"&lt;freeswitch-users@lists.freeswitch.org&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;*抄送:*&nbsp;</DIV>
<DIV>&gt;&nbsp;you&nbsp;could&nbsp;use&nbsp;an&nbsp;api&nbsp;hangup&nbsp;hook,&nbsp;or&nbsp;possibly&nbsp;do&nbsp;it&nbsp;in&nbsp;cdr&nbsp;processing.&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;On&nbsp;Apr&nbsp;10,&nbsp;2014,&nbsp;at&nbsp;10:39&nbsp;PM,&nbsp;sparklezou&nbsp;&lt;sparklezou@163.com&nbsp;&lt;mailto:sparklezou@163.com&gt;&gt;&nbsp;wrote:&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;Hi&nbsp;Buddies,&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;Reviewed&nbsp;the&nbsp;wiki,https://wiki.freeswitch.org/wiki/Mod_spandsp&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;How&nbsp;to&nbsp;check&nbsp;the&nbsp;"fax_result_code"&nbsp;in&nbsp;the&nbsp;php&nbsp;script?&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;Also&nbsp;other&nbsp;result&nbsp;info,&nbsp;such&nbsp;as*fax_result_text,*then&nbsp;could&nbsp;provide&nbsp;more&nbsp;detail&nbsp;response&nbsp;info&nbsp;to&nbsp;the&nbsp;client.&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;Thanks!&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;2014-03-03&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;------------------------------------------------------------------------------------------------------------------------&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;sparklezou&nbsp;</DIV>
<DIV>&gt;&gt;&nbsp;_________________________________________________________________________&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;_________________________________________________________________________&nbsp;</DIV>
<DIV>&gt;&nbsp;Professional&nbsp;FreeSWITCH&nbsp;Consulting&nbsp;Services:&nbsp;</DIV>
<DIV>&gt;&nbsp;consulting@freeswitch.org&nbsp;</DIV>
<DIV>&gt;&nbsp;http://www.freeswitchsolutions.com&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;FreeSWITCH-powered&nbsp;IP&nbsp;PBX:&nbsp;The&nbsp;CudaTel&nbsp;Communication&nbsp;Server&nbsp;</DIV>
<DIV>&gt;&nbsp;http://www.cudatel.com&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;Official&nbsp;FreeSWITCH&nbsp;Sites&nbsp;</DIV>
<DIV>&gt;&nbsp;http://www.freeswitch.org&nbsp;</DIV>
<DIV>&gt;&nbsp;http://wiki.freeswitch.org&nbsp;</DIV>
<DIV>&gt;&nbsp;http://www.cluecon.com&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&gt;&nbsp;FreeSWITCH-dev&nbsp;mailing&nbsp;list&nbsp;</DIV>
<DIV>&gt;&nbsp;FreeSWITCH-dev@lists.freeswitch.org&nbsp;</DIV>
<DIV>&gt;&nbsp;http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev&nbsp;</DIV>
<DIV>&gt;&nbsp;UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev&nbsp;</DIV>
<DIV>&gt;&nbsp;http://www.freeswitch.org&nbsp;</DIV>
<DIV>&gt;&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>--&nbsp;&nbsp;</DIV>
<DIV>------------------------------------------------------------&nbsp;</DIV>
<DIV>Nathan&nbsp;Neulinger&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nneul@mst.edu&nbsp;</DIV>
<DIV>Missouri&nbsp;S&amp;T&nbsp;Information&nbsp;Technology&nbsp;&nbsp;&nbsp;&nbsp;(573)&nbsp;612-1412&nbsp;</DIV>
<DIV>System&nbsp;Administrator&nbsp;-&nbsp;Architect&nbsp;</DIV>
<DIV>&nbsp;</DIV></FONT></DIV></BODY></HTML>