Handling the 302 Moved Temporarily response from JavaScript
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? _________________________________________________________________ Bing brings you maps, menus, and reviews organized in one place. http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_...
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?
Surprisingly, I've found no way to access the HTTP response status code using mod_spidermonkey_curl. I'd love to see this feature added or discussed if it already exists and I'm missing it. --Stephen On Wed, Nov 25, 2009 at 9:45 AM, Michael Jerris <mike@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Stephen, I think you've jumped into the middle of a thread about sip 302, not about http. Anyway, you might want to look at using mod_curl instead of mod_spidermonkey_curl. mod_curl can give you a json response which you can then parse easily in javascript or any other language. The json response has the http response code, all headers, and the body. On Wed, Nov 25, 2009 at 12:01 PM, Stephen Crosby <stevecrozz@gmail.com>wrote:
Surprisingly, I've found no way to access the HTTP response status code using mod_spidermonkey_curl. I'd love to see this feature added or discussed if it already exists and I'm missing it.
--Stephen
On Wed, Nov 25, 2009 at 9:45 AM, Michael Jerris <mike@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- -Rupa
My apologies, and thanks for the info. --Stephen On Wed, Nov 25, 2009 at 11:06 AM, Rupa Schomaker <rupa@rupa.com> wrote:
Stephen, I think you've jumped into the middle of a thread about sip 302, not about http.
Anyway, you might want to look at using mod_curl instead of mod_spidermonkey_curl. mod_curl can give you a json response which you can then parse easily in javascript or any other language. The json response has the http response code, all headers, and the body.
On Wed, Nov 25, 2009 at 12:01 PM, Stephen Crosby <stevecrozz@gmail.com>wrote:
Surprisingly, I've found no way to access the HTTP response status code using mod_spidermonkey_curl. I'd love to see this feature added or discussed if it already exists and I'm missing it.
--Stephen
On Wed, Nov 25, 2009 at 9:45 AM, Michael Jerris <mike@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- -Rupa
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
How do I turn on dialplan processing of 302 responses? I can solve my problem if I can process 302 responses in my dialplan. ----------------------------------------
From: mike@jerris.com Date: Wed, 25 Nov 2009 12:45:50 -0500 To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Handling the 302 Moved Temporarily response from JavaScript
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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________ Bing brings you maps, menus, and reviews organized in one place. http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_...
from http://svn.freeswitch.org/svn/freeswitch/trunk/conf/sip_profiles/internal.xm... <!-- Handle 302 Redirect in the dialplan --> <!--<param name="manual-redirect" value="true"/> --> It appears this never made the wiki, could someone please get it on there. Thanks Mike On Nov 25, 2009, at 6:21 PM, John Platts wrote:
How do I turn on dialplan processing of 302 responses? I can solve my problem if I can process 302 responses in my dialplan.
----------------------------------------
From: mike@jerris.com Date: Wed, 25 Nov 2009 12:45:50 -0500 To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Handling the 302 Moved Temporarily response from JavaScript
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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________ Bing brings you maps, menus, and reviews organized in one place. http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_... _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
John Platts
-
Michael Jerris
-
Rupa Schomaker
-
Stephen Crosby
-
Tihomir Culjaga