<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [sip.js](./sip.js.md) &gt; [OutgoingRequestMessage](./sip.js.outgoingrequestmessage.md) &gt; [setViaHeader](./sip.js.outgoingrequestmessage.setviaheader.md)

## OutgoingRequestMessage.setViaHeader() method

The Via header field indicates the transport used for the transaction and identifies the location where the response is to be sent. A Via header field value is added only after the transport that will be used to reach the next hop has been selected (which may involve the usage of the procedures in \[4\]).

When the UAC creates a request, it MUST insert a Via into that request. The protocol name and protocol version in the header field MUST be SIP and 2.0, respectively. The Via header field value MUST contain a branch parameter. This parameter is used to identify the transaction created by that request. This parameter is used by both the client and the server. https://tools.ietf.org/html/rfc3261\#section-8.1.1.7

<b>Signature:</b>

```typescript
setViaHeader(branch: string, transport: string): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  branch | <code>string</code> |  |
|  transport | <code>string</code> | The sent protocol transport. |

<b>Returns:</b>

`void`

