Via special params:
- if the address in via is different from the src_ip or an existing received=something is found, received=src_ip is added (and any preexisting received is deleted). received is added as the first via parameter if no receive is previously present or over the old receive.
- if the original via contains rport / rport=something or msg->msg_flags FL_FORCE_RPORT is set (e.g. script force_rport() cmd) rport=src_port is added (over previous rport / as first via param or after received if no received was present and received is added too)
(see also sl_send_reply)
- rport and received are added in mostly the same way as for requests, but in the reverse order (first rport and then received). See also limitations.
- if reply_to_via is set (default off) the local reply will be sent to the address in via (received is ignored since it was not set by us). The destination port is either the message source port if via contains rport or the FL_FORCE_RPORT flag is set or the port from the via. If either port or rport are present a normal dns lookup (instead of a srv lookup) is performed on the address. If no port is present and a srv lookup is performed the port is taken from the srv lookup. If the srv lookup failed or it was not performed, the port is set to the default sip port (5060).
- if reply_to_via is off (default) the local reply is sent to the message source ip address. The destination port is set to the source port if rport is present or FL_FORCE_RPORT flag is set, to the via port or to the default sip port (5060) if neither rport or via port are present.
- if received is present the message is sent to the received address else if no port is present (neither a normal via port or rport) a dns srv lookup is performed on the host part and the reply is sent to the resulting ip. If a port is present or the host part is an ip address the dns lookup will be a "normal" one (A or AAAA).
- if rport is present, it's value will be used as the destination port (and this will also disable srv lookups)
- if no port is present the destination port will be taken from the srv lookup. If the srv lookup fails or is not performed (e.g. ip address in host) the destination port will be set to the default sip port (5060).
- when locally replying to a message, rport and received will be appended to the via header parameters (for forwarded requests they are inserted at the beginning).
- a locally generated reply might get two received via parameters if a received is already present in the original message (this should not happen though, but ...)
Generated on Fri Feb 10 12:00:45 2012 for Kamailio - The Open Source SIP Server by
1.5.6