This directory contains software for configuring FreeSWITCH
to provide AT&T (aka Lucent aka Avaya) System 25 PBX compatible
park and pickup park functions.  Specifically:

  a) Putting a call on hold and then dialing *5 will park the
     call on your phone.

  b) Dialing *8 followed by an extension will pickup a call parked
     on that extension.

as a bonus:

  c) Doing a blind transfer of a call to *5 will park the call
     on your phone.

  d) Doing a blind transfer of a call to *5 followed by an extension
     will park the call on that extension.

  e) Dialing *8 without an extension will prompt for an extension.

s25park.js goes into the FreeSWITCH scripts directory.

Configuration fragments look something like:

  conf/dialplan/default.xml

    <extension name="system25_park">
      <condition field="source" expression="mod_sofia"/>
      <condition field="destination_number" expression="^\*5$"/>
      <condition field="${sip_h_Referred-By}" expression="^<sip:([0-9]{4})@.*$">
        <action application="transfer" data="*5$1"/>
        <anti-action application="javascript" data="s25park.js"/>
      </condition>
    </extension>

    <extension name="system25_park_on_extension">
      <condition field="destination_number" expression="^\*5([0-9]{4})$">
        <action application="set" data="fifo_music=$${hold_music}"/>
        <action application="set" data="fifo_orbit_exten=$1:120"/>
        <action application="fifo" data="$1@$${domain} in"/>
      </condition>
    </extension>

    <extension name="system25_pickup">
      <condition field="destination_number" expression="^\*8$">
        <action application="answer"/>
        <action application="sleep" data="1"/>
        <action application="read" data="3 5 $${base_dir}/sounds/en/us/callie/ivr/8000/ivr-enter_ext.wav ext 1000 #"/>
        <action application="transfer" data="*8${ext}"/>
      </condition>
    </extension>

    <extension name="system25_pickup_from_extension">
      <condition field="destination_number" expression="^\*8[0-9]{3,4}$"/>
      <condition field="destination_number" expression="^\*8([0-9]{4})$">
        <action application="fifo" data="$1@$${domain} out nowait"/>
        <anti-action application="bridge" data="openzap/5/a/${destination_number}"/>
      </condition>
    </extension>

The system25 park and pickup dialplan patterns are designed
to only consider four digit extensions for local parking.
"system25_pickup_from_extension" recognizes three digit
extensions as being parked on a foreign PBX ... modify
as appropriate for your installation.

Be aware that the default dialplan contains an extension
called "group-intercept" which needs to be commented out
in order for "system25_pickup" to work since they both
match *8.

Tested using FreeSWITCH SVN 13769 running on FreeBSD 6.4.
