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

John Covici covici at ccs.covici.com
Mon Jul 3 22:00:09 UTC 2017


Yep, the dialplan is for very simple things, what you want to do is if
auth fails, don't do the bridge, I am not a Lua expert, but maybe that
would work.

On Mon, 03 Jul 2017 17:14:02 -0400,
Joseph Waite wrote:
> 
> Really? for a simple If auth fails, hangup?
> 
> > On 3 Jul 2017, at 21:58, John Covici <covici at ccs.covici.com> wrote:
> > 
> > I would say you have to do that logic using some programming language,
> > lua, c# or whatever, this is too much for the xml dialplan.
> > 
> > On Mon, 03 Jul 2017 16:48:22 -0400,
> > Joseph Waite wrote:
> >> 
> >> [1  <multipart/alternative (7bit)>]
> >> [1.1  <text/plain; utf-8 (quoted-printable)>]
> >> [1.2  <text/html; utf-8 (quoted-printable)>]
> >> 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> 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> 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
> >> .
> >> 
> >> On 2 Jul 2017, at 18:30, Jospeh Waite <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" />
> >> <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 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 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 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
> >> 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
> >> 
> >> _________________________________________________________________________
> >> 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
> >> 
> >> [2  <text/plain; utf-8 (base64)>]
> >> _________________________________________________________________________
> >> 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
> > 
> > -- 
> > Your life is like a penny.  You're going to lose it.  The question is:
> > How do
> > you spend it?
> > 
> >         John Covici
> >         covici at ccs.covici.com
> > 
> > _________________________________________________________________________
> > 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
> 
> 
> _________________________________________________________________________
> 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
> 

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici
         covici at ccs.covici.com



More information about the FreeSWITCH-users mailing list