Subject: [Sip] : The Via header and the "received:" tag: when is this tag filled (and by whom) with the IP address ?

From: "Pianigiani, Jacopo (Jacopo)" <[email-masked]>
Date: Tue, 27 Aug 2002 14:20:06 +0200

Supposing the following typical call flow:

                 atlanta.com  . . . biloxi.com<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

                 .      proxy              proxy     .

               .                                       .

       Alice's  . . . . . . . . . . . . . . . . . . . .  Bob's

      softphone                                        SIP Phone

         |                |                |                |

         |    INVITE F1   |                |                |

         |--------------->|    INVITE F2   |                |

         |  100 Trying F3 |--------------->|    INVITE F4   |

         |<---------------|  100 Trying F5 |--------------->|

         |                |<-------------- | 180 Ringing F6 |

         |                | 180 Ringing F7 |<---------------|

         | 180 Ringing F8 |<---------------|     200 OK F9  |

         |<---------------|    200 OK F10  |<---------------|

         |    200 OK F11  |<---------------|                |

         |<---------------|                |                |

         |                       ACK F12                    |

         |------------------------------------------------->|

         |                   Media Session                  |

         |<================================================>|

         |                       BYE F13                    |

         |<-------------------------------------------------|

         |                     200 OK F14                   |

         |------------------------------------------------->|

         |                                                  |
 
a) When is the IP address of each proxy (or UA) added into the VIA header (with the "received:" tag) ? 
    a.1) when the invite is forwarded to the next hop 
    a.2) or when the e.g. 100 Trying response is received backward ?
 
Referring to e.g. message F1 and F3, does Alice's softphone send the INVITE already with its Via header and with the "received:" tag (with Alice's softphone  IP addr), or does the Atlanta.com proxy provide the rectified Via header, complemented with Alice's IP address into the Received tag ?
I have this confusion since i noticed that in RFC3261 the initial INVITE (page 11) does not have the IP address. Then suddenly, when I see page 14 with the 200 OK messages, all the Via headers are complemented with the "received:" tags with each UA's IP addresses.
 
Thanks in advance and regards
Jacopo