[Freeswitch-users] Hangup hook in js is never called

Michael Collins msc at freeswitch.org
Fri Feb 13 14:51:15 PST 2009


> http://wiki.freeswitch.org/wiki/Example_Hangup_hook
>
>
>
> Is the code in error?
>

It might just be. I think you are better off using api_hangup_hook.
What are you trying to do on hangup? The api_hangup_hook lets you call
any API, including running a script. Here's an example that we played
with today that I haven't even put on the wiki yet. I renames the wav
file after the call is hung up.

  <!-- Mikey's minimal test case for Bougyman's api_hangup_up thingymabob -->
  <extension name="api_hangup_hook filename change test thingy">
    <condition field="destination_number" expression="^(1990)$">
      <!-- Just do something simple - in this case x-fer caller to 9888 -->
      <action application="answer"/>
      <action application="record_session" data="/tmp/${uuid}.wav"/>
      <action application="set" data="api_hangup_hook=system mv
/tmp/${uuid}.wav /tmp/${uuid}-DONE.wav"/>
      <action application="log" data="INFO HOOK: '${api_hangup_hook}'"/>
      <action application="transfer" data="9888"/>
    </condition>
  </extension>


-MC




More information about the FreeSWITCH-users mailing list