Back to Skills

sip-media-negotiation

verified

Use when handling SDP offer/answer, codec negotiation, media capabilities, and RTP session setup in SIP applications.

View on GitHub

Marketplace

han

TheBushidoCollective/han

Plugin

jutsu-sip

Technique

Repository

TheBushidoCollective/han
60stars

jutsu/jutsu-sip/skills/sip-media-negotiation/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/jutsu/jutsu-sip/skills/sip-media-negotiation/SKILL.md -a claude-code --skill sip-media-negotiation

Installation paths:

Claude
.claude/skills/sip-media-negotiation/
Powered by add-skill CLI

Instructions

# SIP Media Negotiation

Master Session Description Protocol (SDP) offer/answer model, codec negotiation, and media session establishment for building robust VoIP applications with optimal media handling.

## Understanding SDP and Media Negotiation

SDP (RFC 4566) is used in SIP to describe multimedia sessions. The SDP offer/answer model (RFC 3264) enables endpoints to negotiate media capabilities, codecs, and transport parameters.

## SDP Structure and Syntax

### Basic SDP Message

```
v=0
o=alice 2890844526 2890844527 IN IP4 atlanta.example.com
s=VoIP Call
c=IN IP4 192.0.2.1
t=0 0
m=audio 49170 RTP/AVP 0 8 97
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:97 iLBC/8000
a=ptime:20
a=maxptime:150
a=sendrecv
```

### SDP Line Meanings

```
v=  Protocol version (always 0)
o=  Origin (username, session-id, session-version, network-type, address-type, address)
s=  Session name
c=  Connection information
t=  Timing (start-time stop-time, 0 0 means permanent)
m=  Media description (media, port, protocol, formats)
a=  Attribute (codec mappings, parameters, direction)
```

## SDP Parser Implementation

### Complete SDP Parser

```typescript
interface SdpOrigin {
  username: string;
  sessionId: string;
  sessionVersion: string;
  netType: string;
  addrType: string;
  address: string;
}

interface SdpConnection {
  netType: string;
  addrType: string;
  address: string;
  ttl?: number;
  addressCount?: number;
}

interface SdpMedia {
  media: string;
  port: number;
  portCount?: number;
  protocol: string;
  formats: string[];
  attributes: Map<string, string[]>;
  connection?: SdpConnection;
  bandwidth?: Map<string, number>;
}

interface SdpSession {
  version: number;
  origin: SdpOrigin;
  sessionName: string;
  sessionInfo?: string;
  uri?: string;
  email?: string;
  phone?: string;
  connection?: SdpConnection;
  bandwidth?: Map<string, number>;
  timing: { start: number; stop: number }[];
  attributes: Map<string, string[]>;
  media: SdpMedia[];
}

class SdpPar

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
28858 chars