[Freeswitch-users] Pinned Routing in Dialplan

Roger Castaldo roger.castaldo at gmail.com
Tue Aug 14 00:27:56 MSD 2012


Hi everyone I am trying to setup some pinned routing in freeswitch strictly
through the xml dialplan, so not using any external scripts to validate
pins, that being said i have written a sample dial plan below and it seems
to fail, not sure why.

The parts that are failing are actually detecting a valid pin was placed in
as well as hanging up the phone call when more than 3 attempts have been
made.  can anyone please help me figure out why this is not working.

<extension name="pinned_route_test" inline="true">
      <condition field="destination_number" expression="^5555$">
        <action application="answer"/>
        <action application="log" data="INFO Attempting to obtain pin"/>
        <action application="play_and_get_digits" data="4 10 3 3000 #
conference\8000\conf-pin.wav silence_stream://250 inputted_validation_pin
\d+"/>
        <action application="log" data="INFO Pin Number obtained
${inputted_validation_pin}."/>
        <action application="set"
data="pin_attempts=${expr(${pin_attempts}+1)}"/>
        <action application="log" data="INFO # of pin attempts
${pin_attempts}."/>
      </condition>
      <condition field="inputted_validation_pin" expression="1234"
break="on-true">
        <action application="log" data="INFO Pin number entered was valid"/>
        <anti-action application="log" data="INFO 1234 is not a valid match
for the inputted pin ${inputted_validation_pin}."/>
      </condition>
      <condition field="pin_attempts" expression="3">
        <action application="playback"
data="conference\8000\conf-goodbye.wav"/>
        <action application="hangup"/>
        <anti-action application="log" data="INFO invalid pin was inputted
for attemp ${pin_attempts}."/>
        <anti-action application="playback"
data="conference\8000\conf-bad-pin.wav"/>
        <anti-action application="log" data="INFO restarting extension
pinned_route_test."/>
        <anti-action application="transfer" data="${destination_number} XML
default"/>
      </condition>
    </extension>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120813/87883383/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list