Asterisk flow while fowarding the call

Iam using Asterisk for making an outgoing call. I forward my outgoing call to another SIP extension in xlite softphone when the called number is busy, which works fine. But i want to know how is this process happens in Asterisk. I get the following in my asterisk cli prompt.

[code] – Executing [600@default:1] Dial(“SIP/102-08b5bee0”, “SIP/600”) in new stack
Called 600
– SIP/600-08b62700 is ringing
– SIP/600-08b62700 answered SIP/102-08b5bee0
– Packet2Packet bridging SIP/102-08b5bee0 and SIP/600-08b62700
– Attempting call on Local/outbound@dialout for outbound-handler@dialout:1 (Retry 1)
– Executing [outbound@dialout:1] Answer(“Local/outbound@dialout-7943,2”, “”) in new stack
– Executing [ outbound-handler@dialout:1] Dial(“Local/outbound@dialout-7943,1”, “SIP/102|40|gM(outbound-connect^agi://10.40.0.122/ivr/speak^—+%0Aname%3A+sanchu%0Aid%3A+344%0A^)”) in new stack
– Called 102
– Executing [outbound@dialout:2] Wait(“Local/outbound@dialout-7943,2”, “20”) in new stack

– Got SIP response 302 “Moved Temporarily” back from 10.40.0.121
– Now forwarding Local/outbound@dialout-7943,1 to ‘Local/400@default’ (thanks to SIP/102-08b6a070)

– Executing [400@default:1] Dial(“Local/400@default-342e,2”, “SIP/400”) in new stack
– Called 400
– SIP/400-08b6f030 is ringing
– Local/400@default-342e,1 is ringing
– SIP/400-08b6f030 answered Local/400@default-342e,2
– Local/400@default-342e,1 stopped sounds
– Local/400@default-342e,1 answered Local/outbound@dialout-7943,1
– Executing [s@macro-outbound-connect:1] Answer(“Local/400@default-342e,1”, “”) in new stack
[/code]

As you can see the sip response 302 “Moved Temporarily” is which comes from chan_sip.c file, after this how does the asterisk handle to forward my call.

In the above log i have already established the call with SIP/600 and i forward the call to SIP/400.

Thanks and appreciate for your valuable inputs.

Naveen

Can anyone please let me know the flow in asterisk after the call is getting forwarded please, as i could still not find out the same.

I could break the code, once the SIP response is 302 “Temporarily moved”, the next action is in app_dial.c file from where it forwards to the required destination.