[Freeswitch-users] Radius AAA
Tihomir Culjaga
tculjaga at gmail.com
Wed Nov 3 16:10:28 PDT 2010
hello,
auth_function application returns a "OK" or "NOK" result in a channel
variable (in this example ANI_AUTH_RESULT). You need to evaluate the result
and act accordingly.
here is some example (part of my IVR) that checks the user's ANI id if its
known to the billing just prompts for destination number if not, prompts for
PIN.
<extension name="ANIorPIN">
<condition field="destination_number" expression="^ANIorPIN$">
<action application="set" data="CALLINGNUMBER=${caller_id_number}"/>
<action application="auth_function" data="in ${DIALED_NUMBER}, in
${caller_id_number}, in 1234, out ANI_AUTH_RESULT"/>
<action application="execute_extension" data="CheckANI XML NXIVR"/>
</condition>
</extension>
<extension name="CheckANI">
<condition field="destination_number" expression="^CheckANI$"/>
<condition field="${ANI_AUTH_RESULT}" expression="^NOK$">
<action application="log" data="INFO ################# UNKNOWN ANI, go
to ENTER PIN ################\n"/>
<action application="execute_extension" data="EnterPIN XML NXIVR"/>
<action application="log" data="INFO ################# I KNOW WHO YOU
ARE go to get destination number ################\n"/>
<anti-action inline="true" application="export"
data="UNAME=${caller_id_number}"/>
<anti-action inline="true" application="export" data="PASSWD=1234"/>
<anti-action application="execute_extension" data="GetDstNum XML
NXIVR"/>
</condition>
</extension>
<extension name="EnterPIN">
<condition field="destination_number" expression="^EnterPIN$">
<action application="set" data="playback_delimiter=!"/>
<action application="set" data="playback_terminators=#*0123456789"/>
<action application="read" data="${PIN_MIN_DIG} ${PIN_MAX_DIG}
${PIN_ERR_PR}!${CARD_NUMBER_PR} PIN ${PIN_TIMEOUT} *"/>
<action application="set" data="credit_amount=h323-credit-amount=0"/>
<action inline="true" application="set"
data="PIN_RETRIES=${expr(${PIN_RETRIES}+1)}"/>
<action application="execute_extension" data="ParsePIN XML NXIVR"/>
<action application="log" data="INFO PIN=${PIN}"/>
<action application="log" data="INFO UNAME=${UNAME}"/>
<action application="log" data="INFO PASSWD=${PASSWD}"/>
<action inline="true" application="export" data="DIALED_NUMBER="""/>
<action application="auth_function" data="in ${DIALED_NUMBER}, in
${UNAME}, in ${PASSWD}, out AUTH_RESULT"/>
<action application="set" data="auto_hunt=true"/>
<action application="execute_extension" data="PARSE_RET_CODE XML
NXIVR"/>
<action application="execute_extension" data="CheckPIN XML NXIVR"/>
</condition>
</extension>
<extension name="GetDstNum">
<condition field="destination_number" expression="^GetDstNum$">
<action application="set" data="bind_meta_key=#"/>
<action application="bind_meta_app" data="0 a a transfer::LongDTMF XML
NXIVR"/>
<action application="set" data="playback_delimiter=!"/>
<action application="set" data="playback_terminators=#*0123456789"/>
<action application="read" data="${DST_MIN_DIG} ${DST_MAX_DIG}
${DST_ERR_PR}!${ENTER_DEST_PR} DN ${DST_TIMEOUT} *"/>
<action application="execute_extension" data="TranslateLocal XML
NXIVR"/>
<action inline="true" application="set"
data="DST_RETRIES=${expr(${DST_RETRIES}+1)}"/>
<action application="execute_extension" data="ParseDN XML NXIVR"/>
<action application="auth_function" data="in ${DIALED_NUMBER}, in
${UNAME}, in ${PASSWD}, out AUTH_RESULT"/>
<action application="set" data="CALLINGNUMBER=${caller_id_number}"/>
<action application="execute_extension" data="PARSE_RET_CODE XML
NXIVR"/>
<action application="execute_extension" data="CheckDstNum XML NXIVR"/>
</condition>
</extension>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20101104/58afb08c/attachment.html
More information about the FreeSWITCH-users
mailing list