[Freeswitch-users] Nested conditions

Santiago Soares santiagosoares at gmail.com
Wed Nov 10 09:22:35 PST 2010


This didn't work either. The X-Header-Name header is present only on the 486
response message. It contains the hangup cause.
I need to get the value of the header in the 486 message generated in
response for the Invite.
Like this:

         Invite              Invite
User------------->FS--------------->Server

                               486
          404         X-Header=Not Found
User<------------FS<---------------Server


FS would receive a 486 response with X-Header, and generate a response to
the user based on X-Header value.
Is it possible?

Santiago Soares



On Wed, Nov 10, 2010 at 2:28 PM, Anthony Minessale <
anthony.minessale at gmail.com> wrote:

> <extension name="header_test_extension">
>
> <condition field="network_addr" expression="10.1.1.1"/>
>     <condition field="${sip_h_X-Header-Name}" expression="Header Value">
>        <action application="respond" data="404"/>
>        <action application="hangup"/>
>         <anti-action application="set" data="continue_on_fail=USER_BUSY"/>
>        <anti-action application="bridge"
> data="sofia/gateway/profile/${sip_to_user}"/>
>    </condition>
> </extension>
>
>
> On Wed, Nov 10, 2010 at 7:02 AM, Santiago Soares
> <santiagosoares at gmail.com> wrote:
> > Thank you for the answers, but it didn't work.
> > Isn't there any way I can get a header value from the called endpoint
> > response?
> > I have a server that returns 486 for many call setup problems, and I'd
> like
> > that FS send another response to the caller endpoint, based on this
> > "X-Header-Name".
> > In other words, I'd like to override the callee response, based on this
> > header value.
> > Is it possible?
> >
> > Santiago Soares
> > Fone: (41) 8488-0537
> >
> >
> > On Wed, Nov 10, 2010 at 4:27 AM, Troy Anderson
> > <freeswitch at tlainvestments.com> wrote:
> >>
> >> Santiago,
> >>
> >> I think something like this will work:
> >>
> >> <extension name="header_test_extension">
> >>        <condition field="network_addr" expression="10.1.1.1">
> >>            <action application="set" data="continue_on_fail=USER_BUSY"/>
> >>            <action application="bridge"
> >> data="sofia/gateway/profile/${sip_to_user}"/>
> >>            <action application="transfer'
> >> data="header_test_extension-BUSY">
> >>        </condition>
> >> </extension>
> >>
> >> <extension name="header_test_extension-BUSY">
> >>    <condition field="${sip_h_X-Header-Name}" expression="Header Value">
> >>        <action application="respond" data="404"/>
> >>        <action application="hangup"/>
> >>    </condition>
> >> </extension>
> >>
> >> -Troy
> >>
> >> On Nov 8, 2010, at 1:46 PM, Santiago Soares wrote:
> >>
> >> > Hello everybody,
> >> >
> >> > I'd like to handle my calls like this:
> >> > If callee sends a "486 User Busy" AND a certain header is present in
> the
> >> > response, Freeswitch would send a "404 Not Found" to the caller.
> >> > The following code would solve my problem:
> >> >
> >> > <extension name="header_test_extension">
> >> >
> >> > <condition field="network_addr" expression="10.1.1.1">
> >> >     <action application="set" data="continue_on_fail=USER_BUSY"/>
> >> >     <action application="bridge"
> >> > data="sofia/gateway/profile/${sip_to_user}"/>
> >> >     <condition field="${sip_h_X-Header-Name}" expression="Header
> Value">
> >> >         <action application="respond" data="404"/>
> >> >         <action application="hangup"/>
> >> >     </condition>
> >> > </condition>
> >> >
> >> > </extension>
> >> >
> >> > But the thing is that Freeswitch doesn't allow nested conditions.
> >> >
> >> > Any ideas on how I can handle this?
> >> >
> >> > Santiago Soares
> >> > Fone: (41) 8488-0537
> >> > _______________________________________________
> >> > 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
> >>
> >>
> >> _______________________________________________
> >> 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
> >
> >
> > _______________________________________________
> > 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
> >
> >
>
>
>
> --
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
> Twitter: http://twitter.com/FreeSWITCH_wire
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
> googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
> pstn:+19193869900
>
> _______________________________________________
> 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/20101110/4e30f927/attachment-0001.html 


More information about the FreeSWITCH-users mailing list