## Assign or clear a phone number's SIP profile

`client.SipProfiles.Assign(ctx, phoneNumber, body) (*SipProfileAssignResponse, error)`

**put** `/v3/phone-numbers/{phoneNumber}/sip-profile`

## SIP configuration

Your Linq representative provides the signaling and media IP ranges and
ports to allow through your firewall during onboarding.

Set `primary_uri` to your endpoint as scheme + host — `sips:` for TLS or
`sip:` for UDP, with no user part (we add it). Each call arrives at your
endpoint as:

```
sip:<called-number>@<your-host>
```

so you can route on the dialed number. The caller's number is in the
`From` header in E.164.

---

Assign a SIP profile to route inbound calls to its SIP URI. This takes
precedence over an existing `forwarding_number` without clearing it.
Send `sip_profile_id: null` to remove the SIP assignment and resume
existing forwarding, if configured. Allow about 5 minutes for routing
changes to propagate. The phone number must belong to the authenticated
partner.

### Parameters

- `phoneNumber string`

- `body SipProfileAssignParams`

  - `SipProfileID param.Field[string]`

    The SIP profile to assign, or null to clear the number's current assignment.

### Returns

- `type SipProfileAssignResponse struct{…}`

  - `PhoneNumber string`

    The phone number whose assignment changed

  - `SipProfileID string`

    The assigned SIP profile id, or null when cleared

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.SipProfiles.Assign(
    context.TODO(),
    "+14254758217",
    linqgo.SipProfileAssignParams{
      SipProfileID: linqgo.String("sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.SipProfileID)
}
```

#### Response

```json
{
  "phone_number": "+14254758217",
  "sip_profile_id": "sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c"
}
```
