[Freeswitch-users] mod_rad_auth dial plan condition to match radius result

Vallimamod Abdullah vma at vallimamod.org
Tue Jul 4 16:09:39 UTC 2017


Hi,

In this case, use two extensions: in the first one, do the authentication and set the return code as a variable then transfer the call (with the transfer app) to a second extension where you test this variable to bridge or hangup the call accordingly.

Hope this helps.

Best Regards,
-- 
Vallimamod Abdullah
SIP Solutions
vma at sipsolutions.fr
.

> On 3 Jul 2017, at 22:48, Joseph Waite <joelists at tm.net.uk> wrote:
> 
> Ok, So I have done a lot of playing and it seems that I cannot run the Auth_function inline as it won’t allow me to. I get an error in the log.
> 
> It therefore means that the result of it is not available for when the condition is parsed.
> 
> So my question is, How do I make Freeswitch hang up the call if the Auth fails?
> 
> Any help would be much appreciated as I am banging my head against this!
> 
> Regards
>> On 2 Jul 2017, at 22:45, Joseph Waite <joelists at tm.net.uk <mailto:joelists at tm.net.uk>> wrote:
>> 
>> If I put the inline=“true” in the action that calls auth_function then it fails to return any results in the log output.
>> 
>> 
>>> On 2 Jul 2017, at 18:28, Vallimamod Abdullah <vma at vallimamod.org <mailto:vma at vallimamod.org>> wrote:
>>> 
>>> Hi,
>>> 
>>> Try adding inline="true" to the action returning the result you want to check.
>>> There is a nice explanation on the wiki on how the dialplan works and why this is necessary if you want to use the result of an action in a subsequent condition.
>>> 
>>> Best regards,
>>> -- 
>>> Vallimamod Abdullah
>>> SIP Solutions
>>> vma at sipsolutions.fr <mailto:vma at sipsolutions.fr>.
>>> 
>>>> On 2 Jul 2017, at 18:30, Jospeh Waite <joelists at tm.net.uk <mailto:joelists at tm.net.uk>> wrote:
>>>> 
>>>> Hi Guys
>>>> 
>>>> Nearly there with mod_rad_auth, I have it being called in my dial plan and its sending the Radisu auth and working as expected.
>>>> 
>>>> I now want to put a condition so that in the event of Radius Auth failing the dial plan will end and not allow the call to be made.
>>>> 
>>>> I have put the following in the dial plan
>>>> 
>>>>         <action application="auth_function" data="in ${DIALED_NUMBER}, in ${USERNAME}, in ${PASSWD}, out AUTH_RESULT"/>
>>>> 
>>>>   <action application="log" data="INFO  AUTH_RESULT=${AUTH_RESULT}"/>
>>>>   <action application="log" data="INFO  credit_time=${credit_time}"/>
>>>>   <action application="log" data="INFO  return_code=${return_code}"/>
>>>>    <condition field="${return_code}" expression="^16$">
>>>> 
>>>>             <action application="set" data="execute_on_answer=sched_hangup +${credit_time} alloted_timeout" />
>>>>             <action application="bridge" data="{sip_invite_from_uri=sip:${sip_from_user}@${sip_network_ip}}sofia/internal/${destination_number}@185.35.229.30:5060 <sip:${sip_from_user}@${sip_network_ip}}sofia/internal/${destination_number}@185.35.229.30:5060>" />
>>>>             <action application="hangup" data="${bridge_hangup_cause}"/>
>>>>         </condition>
>>>> 
>>>> 
>>>> And I check the freeswitch log and see
>>>> 
>>>> EXECUTE sofia/external/07966677711 at 185.8.92.3 <mailto:sofia/external/07966677711 at 185.8.92.3> log(INFO  AUTH_RESULT=OK)
>>>> 2017-07-02 17:28:12.885037 [INFO] mod_dptools.c:1724  AUTH_RESULT=OK
>>>> EXECUTE sofia/external/07966677711 at 185.8.92.3 <mailto:sofia/external/07966677711 at 185.8.92.3> log(INFO  credit_time=7199)
>>>> 2017-07-02 17:28:12.885037 [INFO] mod_dptools.c:1724  credit_time=7199
>>>> EXECUTE sofia/external/07966677711 at 185.8.92.3 <mailto:sofia/external/07966677711 at 185.8.92.3> log(INFO  return_code=16)
>>>> 2017-07-02 17:28:12.885037 [INFO] mod_dptools.c:1724  return_code=16
>>>> 
>>>> 
>>>> But it fails to execute the bit within the condition.
>>>> 
>>>> 
>>>> Any Ideas of how to make this work?
>>>> 
>>>> Regards
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org <mailto:consulting at freeswitch.org>
>>>> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
>>>> 
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org <http://www.freeswitch.org/>
>>>> http://confluence.freeswitch.org
>>>> http://www.cluecon.com
>>>> 
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>> 
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org <mailto:consulting at freeswitch.org>
>>> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
>>> 
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>> 
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>> 
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org <mailto:consulting at freeswitch.org>
>> http://www.freeswitchsolutions.com
>> 
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>> 
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170704/79d685e2/attachment.html>


More information about the FreeSWITCH-users mailing list