[Freeswitch-users] Handling the 302 Moved Temporarily response from JavaScript

Tihomir Culjaga tculjaga at gmail.com
Wed Nov 25 10:04:56 PST 2009


this is how i do it from the dialplan:




   <extension name="ServiceLookup">
      <condition field="destination_number"
expression="^(300030)(.*)|^\+(300030)(.*)">

         <action application="set" data="bPfx=$1$3"/>
         <action application="set" data="bNum=$2$4"/>

         <action inline="true" application="set"
data="intf=${regex(${caller_id_number}|^i\+(......)(.*) |%1)}"/>
         <action application="set"
data="caller_id_number=${cond(${intf}==true ? ${caller_id_number:1:32} :
${caller_id_number})}"/>

         <action inline="true" application="set"
data="aPfx=${caller_id_number:0:6}"/>
         <action inline="true" application="set"
data="aNum=${caller_id_number:6:16}"/>
         <action inline="true" application="set"
data="IP_ADDR=${network_addr}:5060"/>

         <action application="lookup_service_destination" data="in ${aNum},
                                                                in ${aPfx},
                                                                in ${bNum},
                                                                in ${bPfx},
                                                                in
${IP_ADDR},
                                                                out
redContact,
                                                                out
authResult"/>

         <action application="log" data="INFO ########################
ServiceLookup ########################\n"/>
         <action application="log" data="INFO ########################
contact = '${redContact}' ##############\n"/>
         <action application="log" data="INFO ########################
CallerNum = '${caller_id_number:6:16}' ##########\n"/>
         <action application="log" data="INFO ########################
RADIUS auth = '${authResult}' ##########\n"/>

         <action application="execute_extension" data="doRedirect XML
public"/>
        </condition>
   </extension>


   <extension name="doRedirect">
      <condition field="destination_number" expression="^doRedirect$"/>
      <condition field="${authResult}" expression="^0$|">
         <action application="log" data="INFO ########################
RADIUS auth OK!!!' ##########\n"/>
         <action application="redirect" data="${red_contact}"/>
         <anti-action application="log" data="INFO ########################
RADIUS auth NOK!! ##########\n"/>
         <anti-action application="respond" data="403 Forbidden"/>
      </condition>

   </extension>




On Wed, Nov 25, 2009 at 6:45 PM, Michael Jerris <mike at jerris.com> wrote:

> In trunk there is a sofia profile setting to allow dialplan processing of
> 302 responses.  This won't get you back into your same javascript, but you
> can probably do something clever from there.
>
> Mike
>
> On Nov 24, 2009, at 5:04 PM, John Platts wrote:
>
> >
> > I have considered writing JavaScript code to bridge two calls together.
> However, I would like to perform custom handling of the 302 Moved
> Temporarily response. How do I handle the 302 Moved Temporarily response if
> I use JavaScript?
> >
>
> _______________________________________________
> 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/20091125/638a2202/attachment-0002.html 


More information about the FreeSWITCH-users mailing list