AFAIK 302 reenters the dialplan. If the destination number is unchanged, it will execute the same commands after the redirect as it did before the redirect, which would likely cause it to continously bridge, redirect, bridge, redirect.... That could explain what you're experiencing.

How do you want to handle the 302?

It's advisable to be careful what to do with a 302 which is why it reenters the dialplan. You can try dialing a $0.01 route but have it redirect you to a $1.00 route leaving you sending the call out on a route costing you $1.00 but charging your customer $0.01, or if you do bill them correctly leaving them with a bill of $1.00 when they expected only $0.01.

It's possible to handle a 302 manually by sending them to a dialplan context specifically for it, which keeps the redirect logic away from your main dialplan. See http://wiki.freeswitch.org/wiki/Dialplan_Handling_Incoming_Redirect

-Steve


On 11 August 2010 21:17, Chris Veazey <chris.veazey@gmail.com> wrote:
Recompiled. Now getting a continuous Invite-->302 loop. That eventually gets killed with a 503 by the upstream redirect server.


[root@fs1 log]# tail -f freeswitch.log
2010-08-11 20:03:30.027817 [DEBUG] switch_core_session.c:1039 Send signal sofia/external/9995552000000 [BREAK]
2010-08-11 20:03:30.027817 [DEBUG] switch_core_session.c:1202 Session 6 (sofia/external/9995552000000) Locked, Waiting on external entities
2010-08-11 20:03:30.027817 [NOTICE] switch_core_session.c:1220 Session 6 (sofia/external/9995552000000) Ended
2010-08-11 20:03:30.027817 [NOTICE] switch_core_session.c:1222 Close Channel sofia/external/9995552000000 [CS_DESTROY]
2010-08-11 20:03:30.027817 [DEBUG] switch_core_state_machine.c:427 (sofia/external/9995552000000) Callstate Change HANGUP -> DOWN
2010-08-11 20:03:30.027817 [DEBUG] switch_core_state_machine.c:430 (sofia/external/9995552000000) Running State Change CS_DESTROY
2010-08-11 20:03:30.027817 [DEBUG] switch_core_state_machine.c:440 (sofia/external/9995552000000) State DESTROY
2010-08-11 20:03:30.027817 [DEBUG] mod_sofia.c:358 sofia/external/9995552000000 SOFIA DESTROY
2010-08-11 20:03:30.027817 [DEBUG] switch_core_state_machine.c:60 sofia/external/9995552000000 Standard DESTROY
2010-08-11 20:03:30.027817 [DEBUG] switch_core_state_machine.c:440 (sofia/external/9995552000000) State DESTROY going to sleep
2010-08-11 20:07:50.601786 [DEBUG] sofia.c:5999 IP 10.14.0.128 Rejected by acl "domains". Falling back to Digest auth.
2010-08-11 20:07:51.179975 [DEBUG] sofia.c:5999 IP 10.14.0.128 Rejected by acl "domains". Falling back to Digest auth.
2010-08-11 20:07:51.186996 [NOTICE] switch_channel.c:779 New Channel sofia/internal/9995551000000@sip.blinkmind.net [1e96cac0-a584-11df-ba1a-11ad2b71c214]
2010-08-11 20:07:51.187997 [DEBUG] switch_core_state_machine.c:314 (sofia/internal/9995551000000@sip.blinkmind.net) Running State Change CS_NEW
2010-08-11 20:07:51.187997 [DEBUG] switch_core_state_machine.c:320 (sofia/internal/9995551000000@sip.blinkmind.net) State NEW
2010-08-11 20:07:51.195018 [DEBUG] sofia.c:4317 Channel sofia/internal/9995551000000@sip.blinkmind.net entering state [received][100]
2010-08-11 20:07:51.195018 [DEBUG] sofia.c:4328 Remote SDP:
v=0
o=- 0 0 IN IP4 10.14.0.128
s=-
c=IN IP4 10.14.0.128
t=0 0
m=audio 20596 RTP/AVP 107 0 101
a=rtpmap:107 CTL-SB-ADPCM/16000

a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
m=video 21114 RTP/AVP 125
a=rtpmap:125 H264/90000
a=fmtp:125 packetization-mode=1;profile-level-id=42E01F;sprop-parameter-sets=Z0IADPQLBKIA,aM44gAA=

2010-08-11 20:07:51.195018 [DEBUG] sofia.c:4445 (sofia/internal/9995551000000@sip.blinkmind.net) State Change CS_NEW -> CS_INIT
2010-08-11 20:07:51.195018 [DEBUG] switch_core_session.c:1039 Send signal sofia/internal/9995551000000@sip.blinkmind.net [BREAK]
2010-08-11 20:07:51.195018 [DEBUG] switch_core_state_machine.c:314 (sofia/internal/9995551000000@sip.blinkmind.net) Running State Change CS_INIT
2010-08-11 20:07:51.195018 [DEBUG] switch_core_state_machine.c:338 (sofia/internal/9995551000000@sip.blinkmind.net) State INIT
2010-08-11 20:07:51.195018 [DEBUG] mod_sofia.c:83 sofia/internal/9995551000000@sip.blinkmind.net SOFIA INIT
2010-08-11 20:07:51.195018 [DEBUG] mod_sofia.c:119 (sofia/internal/9995551000000@sip.blinkmind.net) State Change CS_INIT -> CS_ROUTING
2010-08-11 20:07:51.195018 [DEBUG] switch_core_session.c:1039 Send signal sofia/internal/9995551000000@sip.blinkmind.net [BREAK]
2010-08-11 20:07:51.195018 [DEBUG] switch_core_state_machine.c:338 (sofia/internal/9995551000000@sip.blinkmind.net) State INIT going to sleep
2010-08-11 20:07:51.195018 [DEBUG] switch_core_state_machine.c:314 (sofia/internal/9995551000000@sip.blinkmind.net) Running State Change CS_ROUTING
2010-08-11 20:07:51.195018 [DEBUG] switch_channel.c:1512 (sofia/internal/9995551000000@sip.blinkmind.net) Callstate Change DOWN -> RINGING
2010-08-11 20:07:51.196022 [DEBUG] switch_core_state_machine.c:341 (sofia/internal/9995551000000@sip.blinkmind.net) State ROUTING
2010-08-11 20:07:51.196022 [DEBUG] mod_sofia.c:142 sofia/internal/9995551000000@sip.blinkmind.net SOFIA ROUTING
2010-08-11 20:07:51.196022 [DEBUG] switch_core_state_machine.c:77 sofia/internal/9995551000000@sip.blinkmind.net Standard ROUTING
2010-08-11 20:07:51.196022 [INFO] mod_dialplan_xml.c:331 Processing 9995551000000->9995552000000 in context default
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net parsing [default->unloop] continue=false
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net Regex (PASS) [unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net Regex (FAIL) [unloop] ${sip_looped_call}() =~ /^true$/ break=on-false
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net parsing [default->sip_uri] continue=false
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net Regex (FAIL) [sip_uri] destination_number(9995552000000) =~ /^sip:(.*)$/ break=on-false
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net parsing [default->catchall] continue=false
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net Regex (PASS) [catchall] destination_number(9995552000000) =~ /.*/ break=on-false
Dialplan: sofia/internal/9995551000000@sip.blinkmind.net Action bridge(sofia/gateway/sip.blinkmind.net/${destination_number})
2010-08-11 20:07:51.196022 [DEBUG] switch_core_state_machine.c:119 (sofia/internal/9995551000000@sip.blinkmind.net) State Change CS_ROUTING -> CS_EXECUTE
2010-08-11 20:07:51.196022 [DEBUG] switch_core_session.c:1039 Send signal sofia/internal/9995551000000@sip.blinkmind.net [BREAK]
2010-08-11 20:07:51.196022 [DEBUG] switch_core_state_machine.c:341 (sofia/internal/9995551000000@sip.blinkmind.net) State ROUTING going to sleep
2010-08-11 20:07:51.196022 [DEBUG] switch_core_state_machine.c:314 (sofia/internal/9995551000000@sip.blinkmind.net) Running State Change CS_EXECUTE
2010-08-11 20:07:51.196022 [DEBUG] switch_core_state_machine.c:348 (sofia/internal/9995551000000@sip.blinkmind.net) State EXECUTE
2010-08-11 20:07:51.196022 [DEBUG] mod_sofia.c:235 sofia/internal/9995551000000@sip.blinkmind.net SOFIA EXECUTE
2010-08-11 20:07:51.196022 [DEBUG] switch_core_state_machine.c:157 sofia/internal/9995551000000@sip.blinkmind.net Standard EXECUTE
EXECUTE sofia/internal/9995551000000@sip.blinkmind.net bridge(sofia/gateway/sip.blinkmind.net/9995552000000)
2010-08-11 20:07:51.196022 [NOTICE] switch_channel.c:779 New Channel sofia/external/9995552000000 [1e984e40-a584-11df-ba1b-11ad2b71c214]
2010-08-11 20:07:51.196022 [DEBUG] mod_sofia.c:3892 (sofia/external/9995552000000) State Change CS_NEW -> CS_INIT
2010-08-11 20:07:51.196022 [DEBUG] switch_core_session.c:1039 Send signal sofia/external/9995552000000 [BREAK]
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:314 (sofia/external/9995552000000) Running State Change CS_INIT
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:338 (sofia/external/9995552000000) State INIT
2010-08-11 20:07:51.197023 [DEBUG] mod_sofia.c:83 sofia/external/9995552000000 SOFIA INIT
2010-08-11 20:07:51.197023 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.197023 [DEBUG] mod_sofia.c:119 (sofia/external/9995552000000) State Change CS_INIT -> CS_ROUTING
2010-08-11 20:07:51.197023 [DEBUG] switch_core_session.c:1039 Send signal sofia/external/9995552000000 [BREAK]
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:338 (sofia/external/9995552000000) State INIT going to sleep
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:314 (sofia/external/9995552000000) Running State Change CS_ROUTING
2010-08-11 20:07:51.197023 [DEBUG] switch_channel.c:1512 (sofia/external/9995552000000) Callstate Change DOWN -> RINGING
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:341 (sofia/external/9995552000000) State ROUTING
2010-08-11 20:07:51.197023 [DEBUG] mod_sofia.c:142 sofia/external/9995552000000 SOFIA ROUTING
2010-08-11 20:07:51.197023 [DEBUG] switch_ivr_originate.c:66 (sofia/external/9995552000000) State Change CS_ROUTING -> CS_CONSUME_MEDIA
2010-08-11 20:07:51.197023 [DEBUG] switch_core_session.c:1039 Send signal sofia/external/9995552000000 [BREAK]
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:341 (sofia/external/9995552000000) State ROUTING going to sleep
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:314 (sofia/external/9995552000000) Running State Change CS_CONSUME_MEDIA
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:360 (sofia/external/9995552000000) State CONSUME_MEDIA
2010-08-11 20:07:51.197023 [DEBUG] switch_core_state_machine.c:360 (sofia/external/9995552000000) State CONSUME_MEDIA going to sleep
2010-08-11 20:07:51.198023 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.201020 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.201020 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.203018 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.204015 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.206022 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.207023 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.209026 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.209026 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.212037 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.212037 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.215047 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.215047 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.217052 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.217052 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.220062 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.220062 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.222070 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.223073 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.225079 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.225079 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.227086 [DEBUG] sofia_glue.c:2036 sip:10.11.0.20 Setting proxy route to sofia/external/9995552000000
2010-08-11 20:07:51.228089 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [calling][0]
2010-08-11 20:07:51.230097 [DEBUG] sofia.c:4317 Channel sofia/external/9995552000000 entering state [terminated][503]
2010-08-11 20:07:51.230097 [DEBUG] switch_channel.c:2309 (sofia/external/9995552000000) Callstate Change RINGING -> HANGUP
2010-08-11 20:07:51.230097 [NOTICE] sofia.c:4931 Hangup sofia/external/9995552000000 [CS_CONSUME_MEDIA] [NORMAL_TEMPORARY_FAILURE]
2010-08-11 20:07:51.230097 [DEBUG] switch_channel.c:2325 Send signal sofia/external/9995552000000 [KILL]
2010-08-11 20:07:51.230097 [DEBUG] switch_core_session.c:1039 Send signal sofia/external/9995552000000 [BREAK]
2010-08-11 20:07:51.230097 [DEBUG] switch_core_state_machine.c:314 (sofia/external/9995552000000) Running State Change CS_HANGUP
2010-08-11 20:07:51.230097 [DEBUG] switch_core_state_machine.c:535 (sofia/external/9995552000000) State HANGUP
2010-08-11 20:07:51.230097 [DEBUG] mod_sofia.c:447 sofia/external/9995552000000 Overriding SIP cause 503 with 503 from the other leg


On Wed, Aug 11, 2010 at 2:15 PM, Jeff Lenk <jeff@jefflenk.com> wrote:

Line 3998 of Sofia.c
switch_channel_hangup(channel, SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION);
--
View this message in context: http://freeswitch-users.2379917.n2.nabble.com/FS-processing-302-tp5393783p5413561.html
Sent from the freeswitch-users mailing list archive at Nabble.com.

_______________________________________________
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