<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: SIP GAMES</title>
    <description>The latest articles on DEV Community by SIP GAMES (@sip_games).</description>
    <link>https://dev.to/sip_games</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3254680%2F38716dd8-865f-49d7-b16b-f172c87b4a4a.png</url>
      <title>DEV Community: SIP GAMES</title>
      <link>https://dev.to/sip_games</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sip_games"/>
    <language>en</language>
    <item>
      <title>🛠️ RTCP - The RTP Caretaker</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Sat, 04 Oct 2025 12:36:14 +0000</pubDate>
      <link>https://dev.to/sip_games/rtcp-the-rtp-caretaker-2l0l</link>
      <guid>https://dev.to/sip_games/rtcp-the-rtp-caretaker-2l0l</guid>
      <description>&lt;p&gt;So far in our series we have discussed &lt;strong&gt;&lt;a href="https://dev.to/sip_games/the-voice-courier-meet-rtp-5coj"&gt;RTP: The Voice Courier&lt;/a&gt;&lt;/strong&gt; and how it is crucial for carrying voice and video. But how do we know if those packets are arriving on time, or if the call quality is suffering? &lt;/p&gt;

&lt;p&gt;Introducing &lt;strong&gt;RTCP (Real-Time Control Protocol)&lt;/strong&gt;. While RTP carries voice or video, &lt;strong&gt;RTCP monitors quality, synchronizes streams, and reports stats&lt;/strong&gt; like jitter, packet loss, and delay. Defined in &lt;strong&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc3550" rel="noopener noreferrer"&gt;RFC 3550&lt;/a&gt;&lt;/strong&gt; (the same spec as RTP), RTCP is the &lt;em&gt;control plane&lt;/em&gt; for RTP streams.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 What is RTCP?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RTP&lt;/strong&gt; sends the &lt;em&gt;media stream&lt;/em&gt; (voice, video, etc.).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RTCP&lt;/strong&gt; sends &lt;em&gt;control and quality feedback&lt;/em&gt; alongside RTP.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Together, they make a complete real-time transport framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Why RTCP Exists?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality Feedback&lt;/strong&gt; → Reports on packet loss, jitter, delay
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synchronization&lt;/strong&gt; → Aligns RTP streams (e.g., audio &amp;amp; video) using NTP + RTP timestamps
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Participant Identification&lt;/strong&gt; → Each SSRC gets a unique ID so you know who’s who
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt; → Bandwidth control ensures RTCP doesn’t eat into RTP’s share
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RTCP packets travel periodically (every few seconds) to:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Report on &lt;strong&gt;packet loss&lt;/strong&gt;, &lt;strong&gt;jitter&lt;/strong&gt;, and &lt;strong&gt;round-trip time (RTT)&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Provide &lt;strong&gt;sender statistics&lt;/strong&gt; (how many RTP packets were sent).
&lt;/li&gt;
&lt;li&gt;Carry &lt;strong&gt;source descriptions&lt;/strong&gt; (like CNAMEs for sync).
&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;feedback mechanisms&lt;/strong&gt; (NACK, picture loss indication, etc.).
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔍 RTCP in the Protocol Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Protocol Stack&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Application Signaling (SIP/SDP)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RTCP (control, reporting) / RTP (media transport)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transport (UDP / DTLS)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;RTP: Media stream
&lt;/li&gt;
&lt;li&gt;RTCP: Control/feedback stream
&lt;/li&gt;
&lt;li&gt;Both usually run on &lt;strong&gt;adjacent UDP ports&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 RTCP Packet Structure
&lt;/h2&gt;

&lt;p&gt;Every RTCP packet starts with a &lt;strong&gt;common header&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P| Count | Packet Type | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;V&lt;/strong&gt; (2 bits): Protocol version (always 2).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;P&lt;/strong&gt; (1 bit): Padding.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Count&lt;/strong&gt; (5 bits): Varies by packet type (e.g., number of reports).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packet Type (PT)&lt;/strong&gt;: Identifies RTCP message type.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Length&lt;/strong&gt;: Length of this RTCP packet in 32-bit words.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📑 Types of RTCP Messages
&lt;/h2&gt;

&lt;p&gt;RTCP defines multiple packet types, each with a specific purpose.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Sender Report (SR) – PT=200
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sent by active senders.
&lt;/li&gt;
&lt;li&gt;Contains:

&lt;ul&gt;
&lt;li&gt;NTP timestamp (wall clock).
&lt;/li&gt;
&lt;li&gt;RTP timestamp (media clock).
&lt;/li&gt;
&lt;li&gt;Count of packets/bytes sent.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Used for synchronization and quality monitoring.
&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Receiver Report (RR) – PT=201
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sent by receivers.
&lt;/li&gt;
&lt;li&gt;Contains:

&lt;ul&gt;
&lt;li&gt;Packet loss percentage.
&lt;/li&gt;
&lt;li&gt;Jitter.
&lt;/li&gt;
&lt;li&gt;Last SR timestamp and delay.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Gives feedback to the sender about stream quality.
&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Source Description (SDES) – PT=202
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Provides metadata about streams.
&lt;/li&gt;
&lt;li&gt;Example: CNAME, name, email, tool used.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. BYE – PT=203
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Indicates end of participation.
&lt;/li&gt;
&lt;li&gt;Graceful “leaving the game.”
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. APP – PT=204
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Application-specific RTCP extensions.
&lt;/li&gt;
&lt;li&gt;Rare, custom use cases.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. Extended Reports (XR)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Defined later to carry detailed stats (e.g., round-trip delay, burst metrics).
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. Feedback Messages (RTP/AVPF extensions)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NACK (Negative ACK)&lt;/strong&gt; → Request retransmission.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PLI (Picture Loss Indication)&lt;/strong&gt; → Request a new video keyframe.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FIR (Full Intra Request)&lt;/strong&gt; → Force a full intra-frame.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Real RTCP Packet Example
&lt;/h2&gt;

&lt;p&gt;Let’s look at a &lt;strong&gt;real RTCP Sender Report (SR)&lt;/strong&gt; packet captured with Wireshark:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0000 81 c8 00 06 12 34 56 78 00 00 01 63 89 ab cd ef
0010 11 22 33 44 00 00 27 10 00 00 09 f6 00 00 00 01
0020 5e f6 7a 2c 00 00 00 00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  📖 Field Breakdown
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
|V=2|P=0|RC=1| PT=200 (SR) | length=6 |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;81 c8 00 06&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;V=2&lt;/code&gt; → RTP version 2
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;P=0&lt;/code&gt; → No padding
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;RC=1&lt;/code&gt; → 1 report block will follow
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PT=200&lt;/code&gt; → Packet Type = SR (Sender Report)
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;length=6&lt;/code&gt; → This RTCP packet is 7 words (28 bytes) long
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| SSRC of sender |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;12 34 56 78&lt;/strong&gt; → SSRC = &lt;code&gt;0x12345678&lt;/code&gt; (unique sender identifier)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| NTP timestamp, most significant word |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| NTP timestamp, least significant word |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;00 00 01 63 89 ab cd ef&lt;/strong&gt; → NTP timestamp

&lt;ul&gt;
&lt;li&gt;High 32 bits: &lt;code&gt;0x00000163&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Low 32 bits:  &lt;code&gt;0x89abcdef&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Used to sync RTP streams to real wall-clock time &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| RTP timestamp |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;11 22 33 44&lt;/strong&gt; → RTP timestamp = &lt;code&gt;0x11223344&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Media timestamp used for jitter calculation and sync with NTP
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| sender's packet count |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| sender's octet count |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;00 00 27 10&lt;/strong&gt; → Sender’s packet count = &lt;code&gt;10000&lt;/code&gt; packets
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;00 00 09 f6&lt;/strong&gt; → Sender’s octet count = &lt;code&gt;2550&lt;/code&gt; bytes
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| Report Block (for one source) |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;00 00 00 01 5e f6 7a 2c 00 00 00 00&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SSRC=0x00000001&lt;/code&gt; (source being reported)
&lt;/li&gt;
&lt;li&gt;Fraction lost, cumulative lost, extended highest seq received, jitter, and delay since last SR
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧩 Why This Matters
&lt;/h3&gt;

&lt;p&gt;This single RTCP packet tells us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Who the sender is&lt;/strong&gt; (&lt;code&gt;SSRC&lt;/code&gt;)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When media was sent&lt;/strong&gt; (NTP + RTP timestamps)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How much was sent&lt;/strong&gt; (packet &amp;amp; octet counts)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How the receiver is doing&lt;/strong&gt; (loss/jitter stats from the report block)
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, SRs and RRs form the &lt;strong&gt;control loop&lt;/strong&gt; that makes RTP reliable for real-time communication.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎮 Real Life Examples
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Monitoring Voice Call Quality&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RTCP RRs reveal packet loss % and jitter.
&lt;/li&gt;
&lt;li&gt;VoIP monitoring tools (like Wireshark) use these stats.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Video Call Resync&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Receiver sends &lt;strong&gt;PLI&lt;/strong&gt; when frames are corrupted.
&lt;/li&gt;
&lt;li&gt;Sender reacts by sending a new keyframe.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Conference Systems&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SRs synchronize multiple media streams (audio + video).
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🔗 Port Usage
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Traditionally&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RTP uses port &lt;code&gt;N&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;RTCP uses port &lt;code&gt;N+1&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;But in practice&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RTCP Mux (RFC 5761):&lt;/strong&gt; RTP and RTCP share the same port to save resources (common in WebRTC).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bundle (RFC 8843):&lt;/strong&gt; Multiple media streams (audio, video, data) share a single 5-tuple (IP, port pair).
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;Why?&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NAT/firewall traversal is easier.
&lt;/li&gt;
&lt;li&gt;Fewer ports to manage.
&lt;/li&gt;
&lt;li&gt;Cleaner for ICE/STUN/TURN usage.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📝 Quick RTCP Reference Table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;PT&lt;/th&gt;
&lt;th&gt;Message&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;Sender Report&lt;/td&gt;
&lt;td&gt;Stats from sender + sync&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;201&lt;/td&gt;
&lt;td&gt;Receiver Report&lt;/td&gt;
&lt;td&gt;Feedback on quality from receiver&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;202&lt;/td&gt;
&lt;td&gt;Source Description&lt;/td&gt;
&lt;td&gt;Metadata (CNAME, user, tool)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;203&lt;/td&gt;
&lt;td&gt;BYE&lt;/td&gt;
&lt;td&gt;End participation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;204&lt;/td&gt;
&lt;td&gt;APP&lt;/td&gt;
&lt;td&gt;Application specific&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XR&lt;/td&gt;
&lt;td&gt;Extended Reports&lt;/td&gt;
&lt;td&gt;Detailed metrics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NACK&lt;/td&gt;
&lt;td&gt;Feedback&lt;/td&gt;
&lt;td&gt;Retransmission request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PLI&lt;/td&gt;
&lt;td&gt;Feedback&lt;/td&gt;
&lt;td&gt;Request video keyframe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FIR&lt;/td&gt;
&lt;td&gt;Feedback&lt;/td&gt;
&lt;td&gt;Request full intra-frame&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🏁 Wrap Up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RTP carries the voice/video. RTCP monitors it.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;With reports, feedback, and metadata, RTCP keeps the real-time flow honest.
&lt;/li&gt;
&lt;li&gt;In modern deployments, &lt;strong&gt;RTCP-mux&lt;/strong&gt; and &lt;strong&gt;Bundle&lt;/strong&gt; simplify port usage.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RTCP is the quiet referee in the SIP Games — not in the spotlight, but making sure everything runs fair. ⚖️   &lt;/p&gt;




&lt;p&gt;🎮 Thanks for playing another round of &lt;strong&gt;SIP Games&lt;/strong&gt;!&lt;br&gt;&lt;br&gt;
👉 &lt;strong&gt;Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt;&lt;/strong&gt; to unlock the next level.&lt;/p&gt;

</description>
      <category>rtcp</category>
      <category>rtp</category>
      <category>voip</category>
      <category>webrtc</category>
    </item>
    <item>
      <title>💬 Presence, Messaging, and Subscriptions - It's that SIMPLE</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Mon, 22 Sep 2025 17:04:24 +0000</pubDate>
      <link>https://dev.to/sip_games/presence-messaging-and-subscriptions-its-that-simple-l2o</link>
      <guid>https://dev.to/sip_games/presence-messaging-and-subscriptions-its-that-simple-l2o</guid>
      <description>&lt;p&gt;Our SIP journey has focused mostly on &lt;strong&gt;calls&lt;/strong&gt; (INVITE, ACK, BYE, RTP…). But SIP is &lt;strong&gt;more than just voice&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SIP SIMPLE&lt;/strong&gt; is an extension framework that enables &lt;strong&gt;instant messaging, presence, and event notifications&lt;/strong&gt; over SIP. This article introduces SIP SIMPLE, explains why it was created, and walks through some example scenarios.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 What is SIP SIMPLE?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE)&lt;/strong&gt; is a set of SIP extensions defined by multiple RFCs.  &lt;/p&gt;

&lt;p&gt;It was designed to make SIP more than a “phone call protocol” — by adding:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Presence&lt;/strong&gt; → Is a user available, busy, offline?
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subscriptions&lt;/strong&gt; → Letting clients subscribe to events.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Messaging&lt;/strong&gt; → Sending short instant messages over SIP.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ SIP Requests in SIMPLE
&lt;/h2&gt;

&lt;p&gt;SIMPLE reuses existing SIP request methods and adds new ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SUBSCRIBE&lt;/strong&gt; → Client subscribes to presence/events.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NOTIFY&lt;/strong&gt; → Server notifies subscriber of updates (e.g., presence change).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MESSAGE&lt;/strong&gt; → Instant messaging.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PUBLISH&lt;/strong&gt; → User publishes their own presence state.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  👀 Presence with SIMPLE
&lt;/h2&gt;

&lt;p&gt;Presence is about letting others know your &lt;strong&gt;status&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;Example flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Watcher (UA A).       Presence Server

 SUBSCRIBE (presence of B) --------&amp;gt;
 &amp;lt;--------------------------- 200 OK
 &amp;lt;--------------- NOTIFY (B=offline)
                 ...
 &amp;lt;---------------- NOTIFY (B=online)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;UA A (Watcher) sends &lt;code&gt;SUBSCRIBE&lt;/code&gt; to the server for UA B’s presence.
&lt;/li&gt;
&lt;li&gt;The Presence Server responds with 200 OK and then &lt;code&gt;NOTIFY&lt;/code&gt;s updates as B’s status changes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  SUBSCRIBE
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;SUBSCRIBE sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt; SIP/2.0&lt;br&gt;
From: sip:&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;;tag=1111&lt;br&gt;
To: sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt;&lt;br&gt;
Call-ID: &lt;a href="mailto:pres-1234@example.com"&gt;pres-1234@example.com&lt;/a&gt;&lt;br&gt;
CSeq: 1 SUBSCRIBE&lt;br&gt;
Event: presence&lt;br&gt;
Expires: 3600&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  NOTIFY
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTIFY sip:&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt; SIP/2.0&lt;br&gt;
From: sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt;;tag=2222&lt;br&gt;
To: sip:&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;;tag=1111&lt;br&gt;
Call-ID: &lt;a href="mailto:pres-1234@example.com"&gt;pres-1234@example.com&lt;/a&gt;&lt;br&gt;
CSeq: 2 NOTIFY&lt;br&gt;
Event: presence&lt;br&gt;
Subscription-State: active&lt;br&gt;
Content-Type: application/pidf+xml&lt;/p&gt;

&lt;p&gt;&amp;lt;presence entity="sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt;"&amp;gt; &lt;br&gt;
  &amp;lt;tuple id="t1"&amp;gt; &lt;br&gt;
    &amp;lt;status&amp;gt;&lt;br&gt;
      &amp;lt;basic&amp;gt;open&amp;lt;/basic&amp;gt;&lt;br&gt;
    &amp;lt;/status&amp;gt; &lt;br&gt;
  &amp;lt;/tuple&amp;gt; &amp;gt; &lt;br&gt;
  &amp;lt;/presence&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  💬 Messaging with SIMPLE
&lt;/h2&gt;

&lt;p&gt;SIP SIMPLE also defines MESSAGE, a lightweight request for sending instant messages.&lt;/p&gt;

&lt;p&gt;Unlike MSRP (Message Session Relay Protocol, used for large chat/file sessions), MESSAGE is page-mode messaging — think SMS-like.&lt;/p&gt;

&lt;p&gt;Example Flow&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UA A                           UA B

 MESSAGE "Hi Bob!"  -------------&amp;gt;
 &amp;lt;------------------------- 200 OK

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  MESSAGE
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;MESSAGE sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt; SIP/2.0&lt;br&gt;
From: &lt;a&gt;sip:alice@example.com&lt;/a&gt;;tag=aaaa&lt;br&gt;
To: &lt;a&gt;sip:bob@example.com&lt;/a&gt;&lt;br&gt;
Call-ID: &lt;a href="mailto:msg-5555@example.com"&gt;msg-5555@example.com&lt;/a&gt;&lt;br&gt;
CSeq: 1 MESSAGE&lt;br&gt;
Content-Type: text/plain&lt;br&gt;
Content-Length: 7&lt;/p&gt;

&lt;p&gt;Hello!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📡 PUBLISH presence with SIMPLE
&lt;/h2&gt;

&lt;p&gt;SIP PUBLISH is how a user tells the network “here’s my current status” — online, busy, or away.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Think of PUBLISH as posting a status update in SIP — presence servers read it, watchers get notified.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PUBLISH doesn’t go peer-to-peer; it’s a signal to the presence server, which relays the info.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each PUBLISH comes with an Expires — like saying “I’m online for the next 30 mins unless I update.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With PUBLISH, SIP users share context (chat-ready, in a call, do-not-disturb) across the network.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example Flow&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Presentity (UA B)          Presence Server

 PUBLISH (I'm online)   ----------------&amp;gt;
 &amp;lt;-------------------------------- 200 OK

          NOTIFY all subscribers
        ( Server tells watchers )
 &amp;lt;-------------------------------- NOTIFY

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;PUBLISH&lt;/code&gt; sets the status.&lt;/li&gt;
&lt;li&gt;The server distributes updates via &lt;code&gt;NOTIFY&lt;/code&gt; to watchers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  PUBLISH
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;PUBLISH sip:presence.example.com SIP/2.0&lt;br&gt;
Via: SIP/2.0/UDP alicepc.example.com;branch=z9hG4bK776sgdkse&lt;br&gt;
Max-Forwards: 70&lt;br&gt;
From: "Alice" &amp;lt;sip:&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;&amp;gt;;tag=1928301774&lt;br&gt;
To: &amp;lt;sip:&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;&amp;gt;&lt;br&gt;
Call-ID: &lt;a href="mailto:a84b4c76e66710@alicepc.example.com"&gt;a84b4c76e66710@alicepc.example.com&lt;/a&gt;&lt;br&gt;
CSeq: 314159 PUBLISH&lt;br&gt;
Contact: &amp;lt;sip:&lt;a href="mailto:alice@alicepc.example.com"&gt;alice@alicepc.example.com&lt;/a&gt;&amp;gt;&lt;br&gt;
Event: presence&lt;br&gt;
Expires: 3600&lt;br&gt;
Content-Type: application/pidf+xml&lt;br&gt;
Content-Length: 178&lt;/p&gt;

&lt;p&gt;&amp;lt;presence xmlns="urn:ietf:params:xml:ns:pidf"entity="sip:&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;"&amp;gt;&lt;br&gt;
  &amp;lt;tuple id="t123"&amp;gt;&lt;br&gt;
    &amp;lt;status&amp;gt;&lt;br&gt;
      &amp;lt;basic&amp;gt;open&amp;lt;/basic&amp;gt;&lt;br&gt;
    &amp;lt;/status&amp;gt;&lt;br&gt;
    &amp;lt;note&amp;gt;Available for chat&amp;lt;/note&amp;gt;&lt;br&gt;
  &amp;lt;/tuple&amp;gt;&lt;br&gt;
&amp;lt;/presence&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ⚔️ SIMPLE vs XMPP Presence
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;XMPP (Extensible Messaging and Presence Protocol)&lt;/strong&gt; was designed from the ground up for chat and presence.&lt;br&gt;&lt;br&gt;
👉 &lt;em&gt;dedicated protocol for messaging ecosystems&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SIP SIMPLE&lt;/strong&gt; was created for environments that already used SIP, to avoid running a completely separate protocol for messaging/presence.&lt;br&gt;&lt;br&gt;
👉 &lt;em&gt;extend what you already have in SIP networks&lt;/em&gt;.  &lt;/p&gt;


&lt;h3&gt;
  
  
  Presence workflow comparison
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+---------------------------+  +----------------------------+
|        SIP SIMPLE         |  |           XMPP             |
+---------------------------+  +----------------------------+
| UA A (Watcher)            |  | Client A                   |
|   SUBSCRIBE presence ----&amp;gt;|  |   &amp;lt;presence to="server"&amp;gt;   |
|                           |  |---------------------------&amp;gt;|
| Presence Server           |  | XMPP Server                |
|   200 OK ----------------&amp;gt;|  |   Routes to B’s roster     |
|   NOTIFY (offline/online)&amp;gt;|  |   Broadcast presence       |
|                           |  |&amp;lt;---------------------------|
| UA A learns status        |  | Client B status to A       |
+---------------------------+  +----------------------------+

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;SIMPLE → Presence is explicitly subscribed and managed with SUBSCRIBE/NOTIFY.&lt;/li&gt;
&lt;li&gt;XMPP → Presence is broadcast automatically by the server when a client’s status changes.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🎬 Real-world SIMPLE scenario
&lt;/h2&gt;

&lt;p&gt;Alice subscribes to Bob’s presence, learns when he comes online, and then sends him a message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice (Watcher)            Presence Server                Bob (Presentity)
--------------------------------------------------------------------------
 SUBSCRIBE (presence of Bob) -------&amp;gt;
 &amp;lt;---------------------------- 200 OK
 &amp;lt;-------------- NOTIFY (Bob=offline)


                                     &amp;lt;------------------ PUBLISH (online)
                                     200 OK ----------------------------&amp;gt;
 &amp;lt;--------------- NOTIFY (Bob=online)

 MESSAGE "Hey Bob!" ----------------------------------------------------&amp;gt;
 &amp;lt;---------------------------------------------------------------- 200 OK

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Alice subscribes to Bob’s presence.&lt;/li&gt;
&lt;li&gt;Initially, Bob is offline.&lt;/li&gt;
&lt;li&gt;Later, Bob publishes “I’m online.”&lt;/li&gt;
&lt;li&gt;The server notifies Alice that Bob is now online.&lt;/li&gt;
&lt;li&gt;Alice sends a MESSAGE.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🏁 Wrap Up
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SIP SIMPLE Request Messages&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SUBSCRIBE&lt;/td&gt;
&lt;td&gt;Ask to follow an event (e.g. presence)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NOTIFY&lt;/td&gt;
&lt;td&gt;Deliver updates to subscribers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MESSAGE&lt;/td&gt;
&lt;td&gt;Send a short IM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PUBLISH&lt;/td&gt;
&lt;td&gt;Publish own state (presence info)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;SIP SIMPLE&lt;/em&gt; turns SIP into more than a voice protocol.&lt;/li&gt;
&lt;li&gt;It enables presence, messaging, and subscriptions using standard SIP transactions.&lt;/li&gt;
&lt;li&gt;SIMPLE shines in SIP-native environments but is less common than XMPP or modern WebRTC chat solutions.&lt;/li&gt;
&lt;li&gt;SIMPLE builds on SIP’s event notification framework (RFC 3265).&lt;/li&gt;
&lt;li&gt;Apart from presence, SUBSCRIBE/NOTIFY can track:

&lt;ul&gt;
&lt;li&gt;Message-summary → Voicemail indicators (MWI)&lt;/li&gt;
&lt;li&gt;Conference state&lt;/li&gt;
&lt;li&gt;Registration state&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;p&gt;👉 Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt;to unlock the next level.&lt;/p&gt;

</description>
      <category>sip</category>
      <category>voip</category>
      <category>networking</category>
      <category>uc</category>
    </item>
    <item>
      <title>🤔 VoIP NAT Traversal – Getting Through the Maze</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Thu, 04 Sep 2025 16:56:01 +0000</pubDate>
      <link>https://dev.to/sip_games/voip-nat-traversal-getting-through-the-maze-2d0m</link>
      <guid>https://dev.to/sip_games/voip-nat-traversal-getting-through-the-maze-2d0m</guid>
      <description>&lt;p&gt;If you have ever tried setting up VoIP calls over the internet, you have probably run into the &lt;strong&gt;NAT wall&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
Packets go out and somehow don’t come back. SIP signaling breaks, RTP streams vanish, and you’re left staring at dead air.  &lt;/p&gt;

&lt;p&gt;This article explores &lt;strong&gt;NAT traversal&lt;/strong&gt; in SIP and RTP: why NAT complicates things, what types of NAT exist, and how tools like &lt;strong&gt;STUN, TURN, and ICE&lt;/strong&gt; help us get calls working.&lt;/p&gt;


&lt;h2&gt;
  
  
  🌐 Quick Primer: What is NAT?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;NAT (Network Address Translation)&lt;/strong&gt; allows multiple devices on a private network to share a single public IP.&lt;br&gt;&lt;br&gt;
Problem? SIP and RTP are peer-to-peer by design, and they often embed &lt;strong&gt;private IPs&lt;/strong&gt; inside signaling (SIP/SDP).&lt;br&gt;&lt;br&gt;
The outside world can’t route to &lt;code&gt;192.168.x.x&lt;/code&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  🧩 Types of NAT
&lt;/h2&gt;

&lt;p&gt;Different NAT behaviors affect how easily SIP/RTP can traverse:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type of NAT&lt;/th&gt;
&lt;th&gt;Behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Full Cone NAT&lt;/td&gt;
&lt;td&gt;Any external host can send to mapped port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restricted Cone NAT&lt;/td&gt;
&lt;td&gt;Only hosts previously contacted can reply&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port Restricted Cone&lt;/td&gt;
&lt;td&gt;Same as above but also checks source port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Symmetric NAT&lt;/td&gt;
&lt;td&gt;New mapping for each destination&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;👉 &lt;strong&gt;Symmetric NAT&lt;/strong&gt; is the hardest for VoIP — it breaks simple hole punching.&lt;/p&gt;


&lt;h2&gt;
  
  
  ☎️ Navigating SIP Through NAT
&lt;/h2&gt;

&lt;p&gt;SIP headers often carry &lt;strong&gt;contact addresses&lt;/strong&gt; that may be private (e.g., &lt;code&gt;Contact: sip:alice@192.168.1.10&lt;/code&gt;).&lt;br&gt;&lt;br&gt;
If the proxy or callee tries to respond there — 💥 call fails.  &lt;/p&gt;
&lt;h3&gt;
  
  
  Key SIP Helpers:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;rport&lt;/code&gt; (RFC 3581):&lt;/strong&gt;
Client adds &lt;code&gt;rport&lt;/code&gt; to &lt;code&gt;Via&lt;/code&gt; → Server responds back to the &lt;strong&gt;source port&lt;/strong&gt;, not the private IP in the header.
Example:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Via: SIP/2.0/UDP 192.168.1.10:5060;branch=z9hG4bK123;rport
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Contact&lt;/code&gt; rewriting (NAT-aware SBCs):&lt;/strong&gt;
SIP servers (B2BUA/SBC) may rewrite Contact headers to reflect the public IP/port.
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🎶 Navigating RTP Through NAT
&lt;/h2&gt;

&lt;p&gt;RTP streams face the same NAT issues:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SDP offers&lt;/strong&gt; may contain private IP addresses (e.g., &lt;code&gt;c=IN IP4 192.168.1.10&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;Even if SIP signaling connects, media won’t flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Solution → &lt;strong&gt;ICE Framework&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ICE (Interactive Connectivity Establishment)&lt;/strong&gt; gathers multiple &lt;strong&gt;candidates&lt;/strong&gt; (possible addresses) and tries them in priority order.&lt;/p&gt;

&lt;p&gt;Types of candidates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Host candidates&lt;/strong&gt; → Direct local IPs
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server reflexive&lt;/strong&gt; → From &lt;strong&gt;STUN&lt;/strong&gt; server (public-facing IP/port)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relay candidates&lt;/strong&gt; → Allocated via &lt;strong&gt;TURN&lt;/strong&gt; server (media relay)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  ❄️ STUN: Simple Traversal of UDP
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;STUN&lt;/strong&gt; lets a client discover its public IP/port as seen by a server.&lt;br&gt;&lt;br&gt;
It works well with &lt;strong&gt;cone NATs&lt;/strong&gt;.  &lt;/p&gt;
&lt;h3&gt;
  
  
  Example: SDP with STUN candidates
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a=candidate:1 1 UDP 2130706431 192.168.1.10 54400 typ host
a=candidate:2 1 UDP 1694498815 203.0.113.45 60000 typ srflx raddr 192.168.1.10 rport 54400
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Candidate 1: Local private address (host)
&lt;/li&gt;
&lt;li&gt;Candidate 2: Public IP/port discovered via STUN (server reflexive)
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Trickle ICE
&lt;/h3&gt;

&lt;p&gt;Instead of sending all candidates upfront, clients can &lt;strong&gt;send them as they’re found&lt;/strong&gt;. Speeds up call setup.&lt;/p&gt;


&lt;h2&gt;
  
  
  🌀 TURN: Traversal Using Relays
&lt;/h2&gt;

&lt;p&gt;When NAT is &lt;strong&gt;symmetric&lt;/strong&gt; or firewalls block UDP, STUN fails.&lt;br&gt;&lt;br&gt;
That’s where &lt;strong&gt;TURN&lt;/strong&gt; steps in — media is relayed through a public TURN server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Higher latency and resource cost.
&lt;/li&gt;
&lt;li&gt;Guaranteed connectivity fallback.
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🔗 STUN Binding in RTP Setup
&lt;/h2&gt;

&lt;p&gt;When RTP starts, peers send &lt;strong&gt;STUN Binding Requests&lt;/strong&gt; over the selected candidate pair.&lt;br&gt;&lt;br&gt;
This validates the path and confirms bidirectional connectivity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Caller (UA A)                     Callee (UA B)

- Send STUN Binding ------------&amp;gt; Respond Binding OK
&amp;lt;---------------:- STUN Binding - Respond Binding OK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once validated, RTP media flows over that same path.&lt;/p&gt;

&lt;h2&gt;
  
  
  📜 Example: SIP INVITE with ICE Candidates
&lt;/h2&gt;

&lt;p&gt;Here’s what a NAT-traversed SIP INVITE might look like when a UA (behind NAT) sends an offer using &lt;strong&gt;ICE with STUN&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;INVITE sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt; SIP/2.0&lt;br&gt;
Via: SIP/2.0/UDP 192.168.1.10:5060;branch=z9hG4bK1234;rport&lt;br&gt;
Max-Forwards: 70&lt;br&gt;
From: "Alice" sip:&lt;a href="mailto:alice@example.com"&gt;alice@example.com&lt;/a&gt;;tag=1928301774&lt;br&gt;
To: sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt;&lt;br&gt;
Call-ID: &lt;a href="mailto:a84b4c76e66710@192.168.1.10"&gt;a84b4c76e66710@192.168.1.10&lt;/a&gt;&lt;br&gt;
CSeq: 314159 INVITE&lt;br&gt;
Contact: sip:&lt;a href="mailto:alice@203.0.113.45"&gt;alice@203.0.113.45&lt;/a&gt;:60000&lt;br&gt;
Content-Type: application/sdp&lt;br&gt;
Content-Length: 420&lt;/p&gt;

&lt;p&gt;v=0&lt;br&gt;
o=alice 2890844526 2890844526 IN IP4 192.168.1.10&lt;br&gt;
s=-&lt;br&gt;
c=IN IP4 192.168.1.10&lt;br&gt;
t=0 0&lt;br&gt;
m=audio 54400 RTP/AVP 0 96&lt;br&gt;
a=rtpmap:0 PCMU/8000&lt;br&gt;
a=rtpmap:96 opus/48000/2&lt;br&gt;
a=ice-ufrag:8hhY&lt;br&gt;
a=ice-pwd:asd88fgpdd777uzjYhagZg&lt;br&gt;
a=candidate:1 1 UDP 2130706431 192.168.1.10 54400 typ host&lt;br&gt;
a=candidate:2 1 UDP 1694498815 203.0.113.45 60000 typ srflx raddr 192.168.1.10 rport 54400&lt;br&gt;
a=end-of-candidates&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🔎 Breaking it Down
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SIP Headers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Via&lt;/code&gt; + &lt;code&gt;rport&lt;/code&gt;: Ensures responses come back through the NAT’s mapped port.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Contact&lt;/code&gt;: Rewritten (or discovered via STUN/SBC) to include the &lt;strong&gt;public IP:port&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Call-ID&lt;/code&gt;, &lt;code&gt;From&lt;/code&gt; tag, &lt;code&gt;To&lt;/code&gt; tag: Tie requests and responses into the same dialog.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;SDP Offer&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;m=audio 54400 RTP/AVP 0 96&lt;/code&gt;: Proposes an RTP stream at port 54400 with codecs G.711 (&lt;code&gt;0&lt;/code&gt;) and Opus (&lt;code&gt;96&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;a=ice-ufrag&lt;/code&gt; + &lt;code&gt;a=ice-pwd&lt;/code&gt;: ICE credentials used to authenticate connectivity checks.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;a=candidate:1 typ host&lt;/code&gt;: Local private address (192.168.1.10:54400).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;a=candidate:2 typ srflx&lt;/code&gt;: Public &lt;strong&gt;server-reflexive&lt;/strong&gt; candidate discovered via STUN (203.0.113.45:60000).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;a=end-of-candidates&lt;/code&gt;: Marks candidate gathering complete.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;How This Works&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Alice sends the INVITE with both private and public candidates.
&lt;/li&gt;
&lt;li&gt;Bob replies with his own candidates in the 200 OK SDP.
&lt;/li&gt;
&lt;li&gt;Both sides perform &lt;strong&gt;STUN Binding requests&lt;/strong&gt; across candidates.
&lt;/li&gt;
&lt;li&gt;The best working path (host → srflx → relay) is selected.
&lt;/li&gt;
&lt;li&gt;RTP flows over the chosen pair.
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;p&gt;📌 In practice:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If Alice and Bob are both behind &lt;strong&gt;cone NAT&lt;/strong&gt;, the &lt;strong&gt;server-reflexive (STUN) candidate&lt;/strong&gt; usually works.
&lt;/li&gt;
&lt;li&gt;If either side is behind &lt;strong&gt;symmetric NAT&lt;/strong&gt;, ICE will fall back to &lt;strong&gt;TURN relay&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;This all happens &lt;em&gt;automatically&lt;/em&gt; once ICE/STUN/TURN are implemented by the SIP stack or media engine.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🏁 Wrap Up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SIP needs help (rport, Contact rewriting, SBCs) to work behind NAT.
&lt;/li&gt;
&lt;li&gt;RTP needs ICE → STUN for discovery, TURN for relaying.
&lt;/li&gt;
&lt;li&gt;STUN binding checks ensure the media path is alive.
&lt;/li&gt;
&lt;li&gt;Symmetric NAT remains the final boss, and TURN is the safety net.
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;👉 &lt;strong&gt;Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt;&lt;/strong&gt; for the next level.&lt;/p&gt;

</description>
      <category>voip</category>
      <category>sip</category>
      <category>rtp</category>
      <category>networking</category>
    </item>
    <item>
      <title>🎯 SIP Responses: Talking Back</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Wed, 20 Aug 2025 14:08:35 +0000</pubDate>
      <link>https://dev.to/sip_games/sip-responses-talking-back-5ca8</link>
      <guid>https://dev.to/sip_games/sip-responses-talking-back-5ca8</guid>
      <description>&lt;p&gt;In the previous round, we explored &lt;strong&gt;SIP Requests&lt;/strong&gt; — the moves you make to start, manage, and end a SIP session. But what happens when your move lands?  &lt;/p&gt;

&lt;p&gt;That’s where &lt;strong&gt;SIP Responses&lt;/strong&gt; come in. Every request gets an answer. Some are good, some bad, and some just say, &lt;em&gt;"Hold up, we’re thinking about it."&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;This post will cover:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Categories of SIP responses (1xx → 6xx).
&lt;/li&gt;
&lt;li&gt;How to interpret them.
&lt;/li&gt;
&lt;li&gt;Examples for quick understanding.
&lt;/li&gt;
&lt;li&gt;A handy &lt;strong&gt;response code reference table&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;How unique identifiers (tags, Call-ID) tie requests and responses together.
&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;SIP timers&lt;/strong&gt; behave with responses.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 SIP Response Categories
&lt;/h2&gt;

&lt;p&gt;SIP responses follow a &lt;strong&gt;status code system&lt;/strong&gt; (like HTTP, but SIP-flavored).  &lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;1xx: Provisional Responses&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;These don’t finish the transaction. They’re progress updates.
&lt;/li&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;100 Trying&lt;/code&gt; → &lt;em&gt;“Got your request, working on it.”&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;180 Ringing&lt;/code&gt; → &lt;em&gt;“User is being alerted.”&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;183 Session Progress&lt;/code&gt; → &lt;em&gt;“Here’s early media info.”&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;2xx: Success Responses&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Everything went fine.
&lt;/li&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;200 OK&lt;/code&gt; → The Swiss Army knife of SIP. Success for INVITE, BYE, REGISTER, etc.
&lt;/li&gt;
&lt;li&gt;With INVITE, it establishes the &lt;strong&gt;dialog&lt;/strong&gt; (when To-tag is set).
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;3xx: Redirection Responses&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The called party isn’t here, but they suggest where to go.
&lt;/li&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;302 Moved Temporarily&lt;/code&gt; → &lt;em&gt;“Try this other address.”&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;4xx: Client Error Responses&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Something’s wrong with the request. Caller must fix it.
&lt;/li&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;400 Bad Request&lt;/code&gt; → Syntax or formatting error.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;401 Unauthorized&lt;/code&gt; → Challenge for authentication (with &lt;code&gt;WWW-Authenticate&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;404 Not Found&lt;/code&gt; → User not registered / unknown.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;415 Unsupported Media Type&lt;/code&gt; → Codec/SDP mismatch.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;5xx: Server Error Responses&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The server understood the request but failed to process it.
&lt;/li&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;500 Server Internal Error&lt;/code&gt; → General failure.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;503 Service Unavailable&lt;/code&gt; → Overloaded or temporarily down.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 &lt;strong&gt;6xx: Global Failure Responses&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Final “no” that applies everywhere.
&lt;/li&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;603 Decline&lt;/code&gt; → Callee doesn’t want to talk.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;606 Not Acceptable&lt;/code&gt; → Callee’s capabilities don’t match caller’s request.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 SIP Response Code Reference Table
&lt;/h2&gt;

&lt;p&gt;Here’s a quick reference for the most common responses:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;Provisional&lt;/td&gt;
&lt;td&gt;Trying&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;180&lt;/td&gt;
&lt;td&gt;Provisional&lt;/td&gt;
&lt;td&gt;Ringing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;183&lt;/td&gt;
&lt;td&gt;Provisional&lt;/td&gt;
&lt;td&gt;Session Progress (early media)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;Success&lt;/td&gt;
&lt;td&gt;OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;202&lt;/td&gt;
&lt;td&gt;Success&lt;/td&gt;
&lt;td&gt;Accepted (rare in INVITE, more in SUB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;td&gt;Redirection&lt;/td&gt;
&lt;td&gt;Moved Temporarily&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;Bad Request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;401&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;Unauthorized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;403&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;Forbidden&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;Not Found&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;415&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;Unsupported Media Type&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;480&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;Temporarily Unavailable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;486&lt;/td&gt;
&lt;td&gt;Client Error&lt;/td&gt;
&lt;td&gt;Busy Here&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;Server Error&lt;/td&gt;
&lt;td&gt;Internal Server Error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;503&lt;/td&gt;
&lt;td&gt;Server Error&lt;/td&gt;
&lt;td&gt;Service Unavailable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;603&lt;/td&gt;
&lt;td&gt;Global Failure&lt;/td&gt;
&lt;td&gt;Decline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;606&lt;/td&gt;
&lt;td&gt;Global Failure&lt;/td&gt;
&lt;td&gt;Not Acceptable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🏷️ How IDs Tie It Together
&lt;/h2&gt;

&lt;p&gt;Remember from our last post:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Call-ID&lt;/strong&gt;: Shared across all requests and responses in a dialog.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;From-tag&lt;/strong&gt;: Caller’s unique dialog identifier.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;To-tag&lt;/strong&gt;: Set by callee in the first final response (like &lt;code&gt;200 OK&lt;/code&gt; to INVITE).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Via branch parameter&lt;/strong&gt;: Identifies the specific &lt;strong&gt;transaction&lt;/strong&gt; so responses can find their way back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INVITE sip:bob@example.com SIP/2.0
Via: SIP/2.0/UDP 192.0.2.10;branch=z9hG4bK123
From: Alice sip:alice@example.com
;tag=111
To: Bob sip:bob@example.com

Call-ID: 1234567890@example.com

CSeq: 1 INVITE
...

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.0.2.10;branch=z9hG4bK123
From: Alice sip:alice@example.com
;tag=111
To: Bob sip:bob@example.com
;tag=222
Call-ID: 1234567890@example.com

CSeq: 1 INVITE

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;branch&lt;/strong&gt; matches the INVITE transaction.
&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;To-tag&lt;/strong&gt; creates the dialog.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Call-ID&lt;/strong&gt; stays constant for all dialog messages.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📞 Example Call Flow with Responses
&lt;/h2&gt;

&lt;p&gt;Here’s a simple ASCII call flow showing requests + responses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice                           Bob
| INVITE ---------------------&amp;gt; |
| &amp;lt;---------- 100 Trying -------|
| &amp;lt;---------- 180 Ringing ------|
| &amp;lt;---------- 200 OK -----------|
| ACK -------------------------&amp;gt;|
|========= Media (RTP) =========|
| BYE -------------------------&amp;gt;|
| &amp;lt;---------- 200 OK -----------|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;100 Trying&lt;/code&gt; → Provisional, no retransmission of INVITE needed.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;180 Ringing&lt;/code&gt; → Alerts Alice, doesn’t complete transaction.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;200 OK&lt;/code&gt; → Final response, completes the INVITE transaction.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ACK&lt;/code&gt; → Separate request confirming the dialog setup.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⏱️ SIP Timers and Responses
&lt;/h2&gt;

&lt;p&gt;SIP uses &lt;strong&gt;timers&lt;/strong&gt; to ensure requests don’t get lost forever. Some key ones:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Timer A&lt;/strong&gt; → INVITE retransmission interval (UDP). Stops when &lt;strong&gt;100 Trying&lt;/strong&gt; is received.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer B&lt;/strong&gt; → INVITE transaction timeout (default 32s). If no final response (2xx–6xx), transaction fails.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer D&lt;/strong&gt; → Wait time after sending final response to INVITE (to absorb stray retransmissions).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer F&lt;/strong&gt; → Non-INVITE transaction timeout.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer K&lt;/strong&gt; → Wait time before cleaning up after final response in non-INVITE.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How responses affect them:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;100 Trying&lt;/strong&gt;: Stops retransmission (Timer A).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;200 OK&lt;/strong&gt;: Ends INVITE transaction → Caller must send ACK.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4xx/5xx/6xx&lt;/strong&gt;: Also final, but may trigger re-INVITE or fallback by application.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔎 Quick-Reference: Timers vs Responses
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timer&lt;/th&gt;
&lt;th&gt;Triggered / Stopped By&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Timer A&lt;/td&gt;
&lt;td&gt;Stopped by 100 Trying&lt;/td&gt;
&lt;td&gt;INVITE retransmission timer (UDP)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timer B&lt;/td&gt;
&lt;td&gt;Stopped by final resp&lt;/td&gt;
&lt;td&gt;INVITE timeout (32s if no reply)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timer D&lt;/td&gt;
&lt;td&gt;After sending final resp&lt;/td&gt;
&lt;td&gt;Keeps transaction state to absorb stray retransmits (INVITE server)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timer F&lt;/td&gt;
&lt;td&gt;Stopped by final resp&lt;/td&gt;
&lt;td&gt;Non-INVITE timeout (client side)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timer K&lt;/td&gt;
&lt;td&gt;After final resp (non-INVITE)&lt;/td&gt;
&lt;td&gt;Waits before cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  📞 Example: Timers in Action
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Caller (UAC)                      Callee (UAS)

INVITE ---------------------------&amp;gt; (Start Timer A, B)

[ Timer A running: Retransmit INVITE if no response ]
[ Timer B running: Fail after 32s if no final response ]
        &amp;lt;----------------------- 100 Trying
         (Stops Timer A)

        &amp;lt;----------------------- 180 Ringing
         (Timer B still running)

        &amp;lt;----------------------- 200 OK
         (Stops Timer B)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 In this flow:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Timer A&lt;/code&gt; makes sure the INVITE doesn’t vanish (stopped by &lt;code&gt;100 Trying&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Timer B&lt;/code&gt; guarantees the call won’t hang forever if the other side stays silent.
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;200 OK&lt;/code&gt; stops Timer B and the transaction is finalized with the ACK.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ties responses directly to timers, helping you debug retransmissions, timeouts, or why a SIP phone “gives up” after a while.  &lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Quick Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SIP Responses = feedback for SIP Requests.
&lt;/li&gt;
&lt;li&gt;Categories: &lt;strong&gt;1xx progress, 2xx success, 3xx redirect, 4xx client error, 5xx server error, 6xx global failure&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;IDs (Call-ID, tags, branch) bind everything together.
&lt;/li&gt;
&lt;li&gt;Timers ensure SIP doesn’t wait forever.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⏭️ Next Round: SIP in Action with Scenarios
&lt;/h2&gt;

&lt;p&gt;Up next, we’ll dive into &lt;strong&gt;real-world call scenarios&lt;/strong&gt; with SIP Requests + Responses, and build toward understanding all the different SIP methods in actual use.  &lt;/p&gt;




&lt;p&gt;🕹 Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt; to survive the signaling jungle.&lt;/p&gt;

</description>
      <category>voip</category>
      <category>sip</category>
      <category>telephony</category>
      <category>networking</category>
    </item>
    <item>
      <title>🎭 SIP Requests Unmasked: The Moves Behind the Game</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Mon, 18 Aug 2025 14:30:48 +0000</pubDate>
      <link>https://dev.to/sip_games/sip-requests-unmasked-the-moves-behind-the-game-7nm</link>
      <guid>https://dev.to/sip_games/sip-requests-unmasked-the-moves-behind-the-game-7nm</guid>
      <description>&lt;p&gt;In the previous articles, we explored SIP basics, SDP, RTP, and even the sneaky tools and security layers that keep VoIP calls safe.&lt;br&gt;&lt;br&gt;
Now, it’s time to dive into the &lt;strong&gt;moves&lt;/strong&gt; of the SIP game — the &lt;strong&gt;SIP Requests&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;If SIP is a game of signaling, then SIP Requests are the &lt;em&gt;cards you play&lt;/em&gt;.&lt;br&gt;&lt;br&gt;
Each request has a role, its own headers, and strict rules about when and how it can be used.&lt;/p&gt;


&lt;h2&gt;
  
  
  🥇 What is a SIP Request?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;SIP Request&lt;/strong&gt; is a message sent by a SIP User Agent (UA) or SIP Server to initiate, modify, or terminate a session.&lt;br&gt;&lt;br&gt;
They are the &lt;strong&gt;verbs&lt;/strong&gt; of the SIP protocol — telling the other party &lt;em&gt;what to do&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Example (simplified SIP INVITE request):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INVITE sip:bob@voip.games SIP/2.0
Via: SIP/2.0/UDP 192.168.1.20:5060;branch=z9hG4bK-524287-1---d2f5d8
Max-Forwards: 70
From: "Alice" sip:alice@voip.games;tag=1928301774
To: sip:bob@voip.games
Call-ID: a84b4c76e66710@192.168.1.20
CSeq: 314159 INVITE
Contact: sip:alice@192.168.1.20:5060
Content-Type: application/sdp
Content-Length: 142
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📦 The Mandatory Headers in SIP Requests
&lt;/h2&gt;

&lt;p&gt;Every SIP request must carry some key headers for routing, identification, and handling.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Header&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Via&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Records the path taken by the request. Includes the &lt;code&gt;branch&lt;/code&gt; parameter.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Max-Forwards&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Prevents loops; decremented at each hop.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;From&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Caller identity (with &lt;code&gt;tag&lt;/code&gt; to differentiate multiple calls).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;To&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Callee identity (tag added later during responses).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Call-ID&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Globally unique ID for the call/dialog.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CSeq&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Sequence number + method (e.g., &lt;code&gt;314159 INVITE&lt;/code&gt;).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Contact&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Where to send future requests to this UA.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Content-Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Type of body (usually &lt;code&gt;application/sdp&lt;/code&gt;).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Content-Length&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Size of the body.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These headers are like the &lt;strong&gt;uniform and ID badges&lt;/strong&gt; for each SIP request, ensuring they are recognized and routed properly.&lt;/p&gt;




&lt;h2&gt;
  
  
  📖 The SIP Requests Explained
&lt;/h2&gt;

&lt;p&gt;Here’s the full list of SIP Requests and their roles:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;INVITE&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Initiates a call/session. Can also re-INVITE to modify an existing session.&lt;/li&gt;
&lt;li&gt;Carries &lt;strong&gt;SDP&lt;/strong&gt; in the body (media details).&lt;/li&gt;
&lt;li&gt;Example: Alice invites Bob to a call.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice               Bob
|----- INVITE -----&amp;gt;|
|&amp;lt;---- 180 Ringing--|
|&amp;lt;----- 200 OK -----|
|------ ACK -------&amp;gt;|
|&amp;lt;==== RTP Media ==&amp;gt;|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. &lt;strong&gt;ACK&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Confirms final responses to INVITE (e.g., 200 OK).&lt;/li&gt;
&lt;li&gt;Critical for completing the &lt;strong&gt;3-way handshake&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;BYE&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Terminates an existing session (ends a call).&lt;/li&gt;
&lt;li&gt;Sent by either side.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice               Bob
|&amp;lt;==== RTP Media ==&amp;gt;|
|------ BYE -------&amp;gt;|
|&amp;lt;----- 200 OK -----|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. &lt;strong&gt;CANCEL&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Cancels a pending INVITE before it’s accepted.&lt;/li&gt;
&lt;li&gt;Example: Hang up before the other side answers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice                      Bob
|----- INVITE ------------&amp;gt;|
|------ CANCEL -----------&amp;gt;|
|&amp;lt;----- 487 Req Terminated |
|&amp;lt;----- 200 OK (CANCEL) ---|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. &lt;strong&gt;REGISTER&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Binds a user’s SIP URI to their current IP/Contact address.&lt;/li&gt;
&lt;li&gt;Tells the SIP Registrar where the UA can be reached.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice           Registrar
|---- REGISTER ----&amp;gt;|
|&amp;lt;---- 200 OK ------|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. &lt;strong&gt;OPTIONS&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Query capabilities of another UA or server.&lt;/li&gt;
&lt;li&gt;Example: “Do you support video?”
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice              Bob
|---- OPTIONS ----&amp;gt;|
|&amp;lt;---- 200 OK -----|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  7. &lt;strong&gt;INFO&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Mid-session signaling (e.g., DTMF, statistics).&lt;/li&gt;
&lt;li&gt;Not used for session setup.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  8. &lt;strong&gt;PRACK&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Provisional Acknowledgement.
&lt;/li&gt;
&lt;li&gt;Used to reliably acknowledge 1xx provisional responses.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  9. &lt;strong&gt;SUBSCRIBE / NOTIFY&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Event notification framework (e.g., presence, voicemail).&lt;/li&gt;
&lt;li&gt;SUBSCRIBE asks for updates, NOTIFY sends them.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  10. &lt;strong&gt;UPDATE&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Modify session parameters before final response is sent.
&lt;/li&gt;
&lt;li&gt;Lighter than re-INVITE.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  11. &lt;strong&gt;MESSAGE&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Instant messaging in SIP.&lt;/li&gt;
&lt;li&gt;Example: Sending a text via SIP SIMPLE.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  12. &lt;strong&gt;REFER&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Ask a UA to initiate a new request (e.g., call transfer).&lt;/li&gt;
&lt;li&gt;Example: “Please call this third party instead.”
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice                    Bob
|---- REFER ------------&amp;gt;|
|&amp;lt;---- 202 ACCEPTED -----|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧩 SIP Transaction vs Dialog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Transaction:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;request + all responses to it&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Example: An INVITE and the 100 Trying, 180 Ringing, 200 OK, and ACK.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dialog:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;persistent peer-to-peer association&lt;/strong&gt; created by INVITE, SUBSCRIBE, or REFER.&lt;/li&gt;
&lt;li&gt;Identified by &lt;strong&gt;Call-ID + To Tag + From Tag&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Example: The ongoing session between Alice and Bob after INVITE completes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Caller (UA A)                           Callee (UA B)
     |                                       |
     |---------- INVITE --------------------&amp;gt;|   \
     |&amp;lt;--------- 100 Trying -----------------|    \
     |&amp;lt;--------- 180 Ringing ----------------|     }  INVITE transaction (T1)
     |&amp;lt;--------- 200 OK ---------------------|    /
                                                 /
     |----------- ACK ----------------------&amp;gt;|    }   ACK to 2xx is a separate transaction (T2)

     |&amp;lt;====== RTP Media (within dialog) ====&amp;gt;|

     |------------ BYE ---------------------&amp;gt;|   \   BYE transaction (T3)
     |&amp;lt;----------- 200 OK -------------------|   /
     |                                       |

===================== SIP DIALOG LIFETIME ======================
Created by the 200 OK to INVITE (when To-tag is set)
and ends after BYE / 200 OK completes.
Call-ID: same
From-tag: set by Caller
To-tag:   set by Callee in 200 OK
===============================================================

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What’s What?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Transactions (short-lived):

&lt;ul&gt;
&lt;li&gt;T1 (INVITE transaction): INVITE + all provisional/final responses (100/180/200).&lt;/li&gt;
&lt;li&gt;T2 (ACK for 2xx): The ACK to a 2xx is its own transaction.&lt;/li&gt;
&lt;li&gt;T3 (BYE transaction): BYE + 200 OK.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Dialog (long-lived):

&lt;ul&gt;
&lt;li&gt;Created when the 2xx to INVITE is received and the To-tag is set.&lt;/li&gt;
&lt;li&gt;Identified by Call-ID + From-tag + To-tag.&lt;/li&gt;
&lt;li&gt;Persists across multiple transactions (e.g., re-INVITE, UPDATE, BYE).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔑 Unique Identifiers in SIP Requests
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Call-ID&lt;/strong&gt;: Unique per call across the entire network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Via Branch Parameter (&lt;code&gt;branch=z9hG4bK...&lt;/code&gt;)&lt;/strong&gt;: Unique per transaction, ensures no loops(changes between INVITE, ACK(2xx), BYE).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tags (&lt;code&gt;From&lt;/code&gt; and &lt;code&gt;To&lt;/code&gt;)&lt;/strong&gt;: Differentiate multiple dialogs with same Call-ID.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;From&lt;/code&gt; tag: Set by caller in the initial INVITE.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;To&lt;/code&gt; tag: Set by callee in the first 2xx (or reliable 1xx) creating the dialog.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Think of them like &lt;strong&gt;game tokens&lt;/strong&gt; — no two can be identical in the same round.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⏲️ SIP Timers
&lt;/h2&gt;

&lt;p&gt;SIP uses timers to avoid hanging transactions and retransmit when needed.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Timer A&lt;/strong&gt;: INVITE request retransmit interval.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer B&lt;/strong&gt;: INVITE transaction timeout.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer D&lt;/strong&gt;: Wait time for response retransmits.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer E/F&lt;/strong&gt;: Non-INVITE request retransmit and timeout.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timer H/J&lt;/strong&gt;: Wait for ACK and cleanup.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These ensure SIP is reliable even over UDP.&lt;/p&gt;




&lt;h2&gt;
  
  
  📑 SIP Requests Cheatsheet
&lt;/h2&gt;

&lt;p&gt;Here’s a handy quick reference for the most common SIP Requests:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Example Use Case&lt;/th&gt;
&lt;th&gt;Example Flow&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;INVITE&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Initiate/modify a call&lt;/td&gt;
&lt;td&gt;Alice calls Bob&lt;/td&gt;
&lt;td&gt;INVITE → 180 Ringing → 200 OK → ACK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ACK&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Confirm INVITE final response&lt;/td&gt;
&lt;td&gt;Completes 3-way handshake&lt;/td&gt;
&lt;td&gt;ACK after 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BYE&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Terminate a session&lt;/td&gt;
&lt;td&gt;End the call&lt;/td&gt;
&lt;td&gt;BYE → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CANCEL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cancel a pending INVITE&lt;/td&gt;
&lt;td&gt;Caller hangs up before callee answers&lt;/td&gt;
&lt;td&gt;CANCEL → 487 Req Terminated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;REGISTER&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Register user’s current location&lt;/td&gt;
&lt;td&gt;Alice tells Registrar where she can be reached&lt;/td&gt;
&lt;td&gt;REGISTER → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OPTIONS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Query capabilities&lt;/td&gt;
&lt;td&gt;Check if peer supports video&lt;/td&gt;
&lt;td&gt;OPTIONS → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;INFO&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mid-session signaling&lt;/td&gt;
&lt;td&gt;Send DTMF digits in a call&lt;/td&gt;
&lt;td&gt;INFO → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PRACK&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Provisional acknowledgement&lt;/td&gt;
&lt;td&gt;Reliable delivery of 183 Session Progress&lt;/td&gt;
&lt;td&gt;PRACK → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SUBSCRIBE&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Subscribe to events&lt;/td&gt;
&lt;td&gt;Presence/voicemail notifications&lt;/td&gt;
&lt;td&gt;SUBSCRIBE → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NOTIFY&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Send event notifications&lt;/td&gt;
&lt;td&gt;Inform watcher of presence changes&lt;/td&gt;
&lt;td&gt;NOTIFY → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Update session before final answer&lt;/td&gt;
&lt;td&gt;Early media changes before call established&lt;/td&gt;
&lt;td&gt;UPDATE → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MESSAGE&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Instant messaging in SIP&lt;/td&gt;
&lt;td&gt;Send chat message&lt;/td&gt;
&lt;td&gt;MESSAGE → 200 OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;REFER&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ask UA to initiate a request&lt;/td&gt;
&lt;td&gt;Call transfer&lt;/td&gt;
&lt;td&gt;REFER → 202 Accepted&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🏁 Wrapping Up
&lt;/h2&gt;

&lt;p&gt;SIP Requests are the &lt;strong&gt;moves&lt;/strong&gt; of the game — INVITE to start, BYE to quit, REGISTER to log in, and so on.&lt;br&gt;&lt;br&gt;
They’re powered by headers, tied together with transactions and dialogs, and kept safe by timers.  &lt;/p&gt;

&lt;p&gt;👉 Next up: &lt;strong&gt;SIP Responses&lt;/strong&gt; — the &lt;em&gt;reactions&lt;/em&gt; to these moves. Because every request deserves an answer, right?&lt;/p&gt;

&lt;p&gt;🕹 Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt; for more VoIP magic — minus the RFC migraines.&lt;/p&gt;

</description>
      <category>sip</category>
      <category>voip</category>
      <category>telephony</category>
      <category>networking</category>
    </item>
    <item>
      <title>🔒 VoIP Security 101</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Sun, 17 Aug 2025 17:02:06 +0000</pubDate>
      <link>https://dev.to/sip_games/sip-games-voip-security-101-138b</link>
      <guid>https://dev.to/sip_games/sip-games-voip-security-101-138b</guid>
      <description>&lt;p&gt;&lt;em&gt;"In VoIP, it’s not enough to play the game — sometimes you need to play it in stealth mode."&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In previous levels, we built up VoIP basics:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SIP&lt;/strong&gt; to set up calls
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDP&lt;/strong&gt; to negotiate media
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RTP&lt;/strong&gt; to carry voice and video
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But what happens when the &lt;em&gt;arena is hostile&lt;/em&gt;? Eavesdroppers, man-in-the-middle attacks, or even malicious proxies could steal or tamper with calls. That’s where &lt;strong&gt;VoIP security&lt;/strong&gt; comes in.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎭 Securing the Two Worlds: Signaling vs Media
&lt;/h2&gt;

&lt;p&gt;VoIP has &lt;strong&gt;two layers to protect&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Signaling (SIP)&lt;/strong&gt; — Who’s calling, how, where to connect.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Media (RTP)&lt;/strong&gt; — The actual voice/video packets.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both require different protection strategies.&lt;/p&gt;




&lt;h2&gt;
  
  
  📞 Securing Signaling with SIPS
&lt;/h2&gt;

&lt;p&gt;SIP normally rides on plain &lt;strong&gt;UDP or TCP&lt;/strong&gt;. That’s like mailing postcards — anyone along the route can read them.  &lt;/p&gt;

&lt;p&gt;The fix? &lt;strong&gt;Transport Layer Security (TLS).&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SIP over TLS (SIPS)&lt;/strong&gt; encrypts SIP signaling between endpoints and proxies.
&lt;/li&gt;
&lt;li&gt;Port convention: &lt;code&gt;5061&lt;/code&gt; instead of &lt;code&gt;5060&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Certificates are used to authenticate servers (and optionally clients).
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Caller SIP UA] --TLS--&amp;gt; [SIP Proxy] --TLS--&amp;gt; [Callee SIP UA]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Think of it as wrapping your SIP messages in an armored envelope.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎧 Securing Media with SRTP
&lt;/h2&gt;

&lt;p&gt;While SIPS hides &lt;em&gt;setup instructions&lt;/em&gt;, the media path (RTP) still needs protection. That’s where &lt;strong&gt;Secure RTP (SRTP)&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;p&gt;SRTP encrypts and authenticates RTP streams, ensuring that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nobody can eavesdrop on your audio/video.
&lt;/li&gt;
&lt;li&gt;Nobody can inject fake packets into the stream.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But SRTP alone isn’t enough — it needs a way to &lt;strong&gt;exchange keys&lt;/strong&gt;. This is where different methods come in.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔑 Key Exchange Mechanisms for SRTP
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;SRTP with SDES (Session Description Protocol Security Descriptions)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;With SDES, keys are shared &lt;strong&gt;inside the SDP&lt;/strong&gt; body of SIP messages.  &lt;/p&gt;

&lt;p&gt;Example SDP with SDES:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=0
o=- 12345 67890 IN IP4 192.0.2.1
s=VoIP Call
c=IN IP4 192.0.2.1
t=0 0
m=audio 49170 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:MTIzNDU2Nzg5MDEyMzQ1Ng==
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;a=crypto&lt;/code&gt; defines the encryption algorithm and key.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AES_CM_128_HMAC_SHA1_80 = AES&lt;/code&gt; with HMAC authentication.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;inline:&lt;/code&gt; value is the base64-encoded SRTP key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ Risk: If SIP isn’t protected with TLS, anyone sniffing the signaling path can steal the SRTP key.&lt;/p&gt;

&lt;p&gt;👉 Best for: Controlled/trusted networks where SIP signaling is already protected with TLS.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;SRTP with DTLS (Datagram Transport Layer Security)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;DTLS provides a handshake (like TLS for UDP) to exchange SRTP keys directly between endpoints.&lt;br&gt;
Instead of placing keys in SDP, endpoints exchange fingerprints for certificate verification.&lt;/p&gt;

&lt;p&gt;Example SDP with DTLS-SRTP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v=0
o=- 46117326 2 IN IP4 192.0.2.10
s=VoIP Call
c=IN IP4 192.0.2.10
t=0 0
m=audio 54000 RTP/SAVPF 111 0
a=rtpmap:111 opus/48000/2
a=rtpmap:0 PCMU/8000
a=setup:actpass
a=fingerprint:sha-256 12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF
a=ice-ufrag:abcd
a=ice-pwd:efghijklmnop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key lines explained:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;a=setup:&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;actpass&lt;/strong&gt; → Caller offers to act as either client or server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;active&lt;/strong&gt; → Endpoint will initiate DTLS handshake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;passive&lt;/strong&gt; → Endpoint will wait for DTLS handshake.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;a=fingerprint:&lt;/code&gt; → Hash of the certificate used for DTLS session. Ensures authenticity.&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;RTP/SAVPF&lt;/code&gt; → Secure RTP profile with feedback (commonly used in WebRTC).&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;👉 Best for: WebRTC and modern SIP deployments. Provides stronger end-to-end protection.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌐 Transport Security Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SIP signaling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;UDP/TCP&lt;/code&gt; → Plaintext, insecure.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TLS&lt;/code&gt; → Encrypted (SIPS).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;RTP media:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Plain RTP&lt;/code&gt; → Insecure.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SRTP/SDES&lt;/code&gt; → Keys in SIP/SDP, simpler.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SRTP/DTLS&lt;/code&gt; → Keys exchanged via DTLS handshake, stronger.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 Quick Comparison Table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Plain Protocol&lt;/th&gt;
&lt;th&gt;Secure Protocol&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SIP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SIP over UDP/TCP&lt;/td&gt;
&lt;td&gt;SIPS (SIP over TLS)&lt;/td&gt;
&lt;td&gt;Protects signaling from eavesdropping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;RTP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;RTP&lt;/td&gt;
&lt;td&gt;SRTP&lt;/td&gt;
&lt;td&gt;Encrypts and authenticates media&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SRTP Keying&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;SDES&lt;/td&gt;
&lt;td&gt;Keys exchanged via SDP (requires SIPS)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SRTP Keying&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;DTLS&lt;/td&gt;
&lt;td&gt;Keys exchanged via DTLS handshake (WebRTC)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🎮 TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SIPS (TLS) secures SIP signaling.&lt;/li&gt;
&lt;li&gt;SRTP secures the media path.

&lt;ul&gt;
&lt;li&gt;SDES = simpler, but requires trusted signaling.&lt;/li&gt;
&lt;li&gt;DTLS = modern, secure, and WebRTC-approved.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Up Next in SIP GAMES:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;“Choose Your Fighter: SIP Call Scenarios”&lt;/strong&gt; 🎬&lt;br&gt;
We’ll break down real-world call flows and SIP requests — &lt;strong&gt;INVITE, BYE, REFER, REGISTER&lt;/strong&gt;, and more — showing how signaling changes in different situations (basic calls, transfers, forking).&lt;/p&gt;

&lt;p&gt;Stay tuned, because the next level is all about &lt;strong&gt;SIP Requests in Action&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt;&lt;/p&gt;

</description>
      <category>voip</category>
      <category>sips</category>
      <category>srtp</category>
      <category>security</category>
    </item>
    <item>
      <title>🕵️‍♂️ Spy Tools for VoIP Agents</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Sat, 09 Aug 2025 15:16:31 +0000</pubDate>
      <link>https://dev.to/sip_games/spy-tools-for-voip-agents-4ofe</link>
      <guid>https://dev.to/sip_games/spy-tools-for-voip-agents-4ofe</guid>
      <description>&lt;p&gt;&lt;em&gt;"The game isn’t just about playing — it’s about watching, analyzing, and winning."&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In the last level of SIP GAMES, we learned about &lt;strong&gt;RTP&lt;/strong&gt; — the courier that runs your media across the network. But what happens when the game lags, drops, or mysteriously fails?  &lt;/p&gt;

&lt;p&gt;You don’t guess. You &lt;strong&gt;spy&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
Not on people, but on &lt;strong&gt;packets&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s your VoIP agent toolkit — categorized, explained, and ready for action.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛡 1. &lt;strong&gt;Surveillance Tools&lt;/strong&gt; — Capture &amp;amp; Analyze Traffic
&lt;/h2&gt;

&lt;p&gt;When something goes wrong in a VoIP call, your first job is to &lt;strong&gt;see the traffic&lt;/strong&gt;. These tools let you peek inside packets like a movie detective flipping through secret files.&lt;/p&gt;

&lt;h3&gt;
  
  
  🐬 &lt;strong&gt;Wireshark&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Capture and inspect SIP, SDP, RTP (and more) packets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case:&lt;/strong&gt;
Call drops after 30 seconds? See if a BYE or timeout happened.
No audio? Check if RTP is flowing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to use:&lt;/strong&gt;

&lt;ol&gt;
&lt;li&gt;Install from &lt;a href="https://www.wireshark.org/download.html" rel="noopener noreferrer"&gt;wireshark.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Start capture on the correct network interface.&lt;/li&gt;
&lt;li&gt;Apply filters like:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sip&lt;/code&gt; → Show only SIP messages&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rtp&lt;/code&gt; → Show only RTP packets&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ip.addr == 192.168.1.50&lt;/code&gt; → Show traffic for a specific IP&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Right-click → “Follow” → “UDP Stream” for audio flow.&lt;/li&gt;

&lt;/ol&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pro tip:&lt;/strong&gt; Enable &lt;strong&gt;VoIP Calls&lt;/strong&gt; under &lt;em&gt;Telephony → VoIP Calls&lt;/em&gt; to reconstruct call flow.&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 2. &lt;strong&gt;Simulation Tools&lt;/strong&gt; — Generate Test Calls
&lt;/h2&gt;

&lt;p&gt;Sometimes you can’t wait for a bug to happen — you need to &lt;strong&gt;force&lt;/strong&gt; it. That’s where call simulators come in.&lt;/p&gt;

&lt;h3&gt;
  
  
  📞 &lt;strong&gt;sipp&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; SIP traffic generator and test tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case:&lt;/strong&gt;
Stress-test your SIP server with thousands of calls, or simulate specific SIP scenarios (registration floods, custom headers, delayed responses).&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;How to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install from &lt;a href="https://sipp.sourceforge.net" rel="noopener noreferrer"&gt;sipp.sourceforge.net&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Basic call test:
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; sipp &lt;span class="nt"&gt;-sn&lt;/span&gt; uac 192.168.1.20
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;em&gt;(This sends an INVITE to &lt;code&gt;192.168.1.20&lt;/code&gt; using the default UAC scenario.)&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use XML scenario files to define custom call flows.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Combine with Wireshark to capture the generated traffic for later analysis.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔀 3. &lt;strong&gt;Media Manipulation Tools&lt;/strong&gt; — Intercept &amp;amp; Modify RTP
&lt;/h2&gt;

&lt;p&gt;When you need to &lt;strong&gt;play with the media path&lt;/strong&gt; — for debugging, transcoding, or rerouting — these tools take control.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 &lt;strong&gt;rtpengine&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; RTP proxy for relaying and modifying RTP streams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case:&lt;/strong&gt;
NAT traversal issues, transcoding between codecs, or enabling SRTP on one side while keeping RTP on the other.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;How to use:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install from &lt;a href="https://github.com/sipwise/rtpengine" rel="noopener noreferrer"&gt;rtpengine.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Use via CLI or integrate with SIP proxies like Kamailio/OpenSIPS.&lt;/li&gt;
&lt;li&gt;Control with commands like:
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; ngcp-rtpengine-ctl list
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;em&gt;(Lists active RTP sessions.)&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Use it to simulate one-way audio problems by blocking one RTP direction.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠 Example Debugging Scenarios
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;How It Helps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One-way audio&lt;/td&gt;
&lt;td&gt;Wireshark, rtpengine&lt;/td&gt;
&lt;td&gt;Capture RTP to see which side isn’t sending&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Call setup delay&lt;/td&gt;
&lt;td&gt;Wireshark, sipp&lt;/td&gt;
&lt;td&gt;Compare SIP INVITE timestamps with responses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Codec mismatch&lt;/td&gt;
&lt;td&gt;Wireshark&lt;/td&gt;
&lt;td&gt;Inspect SDP offers/answers for supported codecs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAT traversal failure&lt;/td&gt;
&lt;td&gt;Wireshark, rtpengine&lt;/td&gt;
&lt;td&gt;Verify if private IPs appear in SDP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stress testing&lt;/td&gt;
&lt;td&gt;sipp&lt;/td&gt;
&lt;td&gt;Generate high call volume to see when servers fail&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🎮 TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wireshark&lt;/strong&gt; = See everything
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sipp&lt;/strong&gt; = Simulate anything
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;rtpengine&lt;/strong&gt; = Control media flow
&lt;/li&gt;
&lt;li&gt;Debugging VoIP isn’t about guessing — it’s about &lt;strong&gt;capturing, analyzing, and proving&lt;/strong&gt; where the problem lives.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Up Next in SIP GAMES:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;“Keeping It Secret: VoIP Security 101”&lt;/strong&gt; 🔒&lt;br&gt;&lt;br&gt;
We’ll explore &lt;strong&gt;SIPS&lt;/strong&gt;, &lt;strong&gt;SRTP&lt;/strong&gt;, &lt;strong&gt;SIP over TLS&lt;/strong&gt;, &lt;strong&gt;RTP over DTLS&lt;/strong&gt;, and &lt;strong&gt;SDES&lt;/strong&gt; — because in VoIP, sometimes the game isn’t just about speed, but keeping your cards hidden.&lt;/p&gt;

&lt;p&gt;Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt; and stay in the game.&lt;/p&gt;

</description>
      <category>voip</category>
      <category>debugging</category>
      <category>tools</category>
      <category>sip</category>
    </item>
    <item>
      <title>🎤 The Voice Courier: Meet RTP</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Sat, 28 Jun 2025 19:49:03 +0000</pubDate>
      <link>https://dev.to/sip_games/the-voice-courier-meet-rtp-5coj</link>
      <guid>https://dev.to/sip_games/the-voice-courier-meet-rtp-5coj</guid>
      <description>&lt;p&gt;&lt;em&gt;“SDP made the rules, RTP plays the game.”&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In the previous episode of SIP GAMES, we peeked inside the &lt;strong&gt;SDP&lt;/strong&gt; invite that tells your opponent how you'd &lt;em&gt;like&lt;/em&gt; to play: what codecs, what ports, and what IPs. But who actually carries the media?&lt;/p&gt;

&lt;p&gt;🎮 Enter &lt;strong&gt;RTP&lt;/strong&gt; — &lt;em&gt;Real-time Transport Protocol&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧳 What is RTP?
&lt;/h2&gt;

&lt;p&gt;Think of RTP as the courier that carries your voice across the network — broken into little time-stamped, sequence-numbered packages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SIP&lt;/strong&gt; sets up the call&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDP&lt;/strong&gt; describes the media setup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RTP&lt;/strong&gt; &lt;em&gt;sends the actual media&lt;/em&gt; (voice/video)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RTP runs on top of &lt;strong&gt;UDP&lt;/strong&gt; (User Datagram Protocol) because it’s fast and tolerant of occasional loss — just like a real conversation.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧬 RTP Packet Structure
&lt;/h2&gt;

&lt;p&gt;Here’s the basic layout of an RTP packet:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
|V=2|P|X|CC|M| PT | Sequence Number |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| Timestamp |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| Synchronization Source (SSRC) Identifier |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| Contributing Source (CSRC) Identifiers (optional) |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br&gt;
| Payload (audio/video) |&lt;br&gt;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s decode this header:&lt;/p&gt;




&lt;h3&gt;
  
  
  🔍 RTP Header Fields
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What It Means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;V&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Version (always 2)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;P&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Padding (if extra bytes added)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;X&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Extension header present&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;CSRC count (used in conferencing)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;M&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Marker bit (e.g. start of a talkspurt)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Payload type (codec, e.g., 0 = PCMU, 96 = dynamic)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Sequence Number&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Increments by 1 per packet — used to detect loss&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Timestamp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Used for media playback timing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SSRC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sender’s unique ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CSRC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;IDs of other contributing streams (optional)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Payload&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Actual audio or video data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  🕒 Packetization Time (a.k.a. ptime)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is packetization time?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s the &lt;strong&gt;duration of audio in each RTP packet&lt;/strong&gt;, often advertised in SDP using &lt;code&gt;a=ptime:20&lt;/code&gt; (means 20 ms per packet).&lt;/p&gt;

&lt;p&gt;Common values:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Codec&lt;/th&gt;
&lt;th&gt;Typical ptime&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PCMU&lt;/td&gt;
&lt;td&gt;20 ms&lt;/td&gt;
&lt;td&gt;50 packets/sec&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Opus&lt;/td&gt;
&lt;td&gt;Variable&lt;/td&gt;
&lt;td&gt;Can do 20–60 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;G.729&lt;/td&gt;
&lt;td&gt;20 ms&lt;/td&gt;
&lt;td&gt;Small, compressed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  🧮 Frequency of RTP Transmission
&lt;/h3&gt;

&lt;p&gt;The number of &lt;strong&gt;RTP packets per second&lt;/strong&gt; depends on the codec’s ptime.&lt;/p&gt;

&lt;p&gt;Example:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If ptime is &lt;strong&gt;20ms&lt;/strong&gt;, that’s &lt;strong&gt;50 packets/second&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;If it’s &lt;strong&gt;30ms&lt;/strong&gt;, ~33.3 packets/sec
&lt;/li&gt;
&lt;li&gt;Higher ptime = fewer packets = less overhead
&lt;/li&gt;
&lt;li&gt;Lower ptime = smoother audio but more packets&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Why Do I Care?
&lt;/h2&gt;

&lt;p&gt;If you're &lt;strong&gt;implementing RTP&lt;/strong&gt; or trying to debug call quality:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Jitter?&lt;/strong&gt; Check packet arrival times and timestamps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audio out of sync?&lt;/strong&gt; Sequence or timestamp mismatch&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Silence or gaps?&lt;/strong&gt; Packets lost or arriving too late&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong codec?&lt;/strong&gt; Check the Payload Type (&lt;code&gt;PT&lt;/code&gt;) field&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RTP is everywhere in VoIP — and understanding this header lets you trace, debug, and build your own media streamers.&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ Example: A Real RTP Packet (with G.711)
&lt;/h3&gt;

&lt;p&gt;Let’s say we're using G.711 with 20ms ptime.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Payload Type: &lt;code&gt;0&lt;/code&gt; (PCMU)&lt;/li&gt;
&lt;li&gt;Sequence Number: &lt;code&gt;10567&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Timestamp: &lt;code&gt;160000&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;SSRC: &lt;code&gt;0x789ABC&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Payload: 160 bytes of G.711 data (8-bit PCM at 8000 Hz)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s &lt;strong&gt;160 samples × 8 kHz × 20ms = 160 bytes&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎮 TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RTP&lt;/strong&gt; carries media after SIP/SDP sets things up&lt;/li&gt;
&lt;li&gt;Each RTP packet has headers: version, PT, seq, timestamp, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ptime&lt;/strong&gt; defines how much media is in each packet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frequency&lt;/strong&gt; of packets is based on ptime&lt;/li&gt;
&lt;li&gt;Use RTP headers to debug and analyze VoIP issues&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 Up Next in SIP GAMES:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;“Spy Tools for VoIP Agents”&lt;/strong&gt; 🕵️‍♂️&lt;br&gt;&lt;br&gt;
We’ll break down the best open-source tools like &lt;strong&gt;Wireshark&lt;/strong&gt;, &lt;strong&gt;sipp&lt;/strong&gt;, and &lt;strong&gt;rtpengine&lt;/strong&gt;, and show you how to capture, simulate, and troubleshoot your VoIP calls like a pro.&lt;/p&gt;

&lt;p&gt;Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt; to keep leveling up your VoIP game.&lt;/p&gt;

</description>
      <category>voip</category>
      <category>rtp</category>
      <category>sip</category>
      <category>sdp</category>
    </item>
    <item>
      <title>📦 What’s in the SIP Envelope? (A Peek at SDP)</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Mon, 23 Jun 2025 10:17:12 +0000</pubDate>
      <link>https://dev.to/sip_games/whats-in-the-sip-envelope-a-peek-at-sdp-4mim</link>
      <guid>https://dev.to/sip_games/whats-in-the-sip-envelope-a-peek-at-sdp-4mim</guid>
      <description>&lt;p&gt;&lt;em&gt;“SDP: The tiny contract that decides how we talk.”&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Remember that SIP message we saw last time? It was polite. It said “Hi, want to talk?” But it also had a little payload, tucked inside like a secret note in a game invitation. That note was &lt;strong&gt;SDP&lt;/strong&gt; — &lt;strong&gt;Session Description Protocol&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let’s unpack it, casually.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What Is SDP?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SDP is not a protocol that sends media — it’s just a description.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
It tells the other side things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What IP and port to send media to&lt;/li&gt;
&lt;li&gt;What kind of media we support (audio, video, fax, etc.)&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;codecs&lt;/strong&gt; we can use&lt;/li&gt;
&lt;li&gt;How many media streams we want&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of SDP as the cheat sheet you give your opponent before a Squid Game round. It says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“We’ll play audio only. You send it to this IP, this port. Here are the rules (codecs) I speak.”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📃 A Sample SDP Offer
&lt;/h2&gt;

&lt;p&gt;Here’s a simplified version of what might be inside the body of an &lt;code&gt;INVITE&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;v=0&lt;br&gt;
o=alice 2890844526 2890844526 IN IP4 192.168.1.10&lt;br&gt;
s=-&lt;br&gt;
c=IN IP4 192.168.1.10&lt;br&gt;
t=0 0&lt;br&gt;
m=audio 49170 RTP/AVP 0 96&lt;br&gt;
a=rtpmap:0 PCMU/8000&lt;br&gt;
a=rtpmap:96 opus/48000/2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s decode this bit by bit.&lt;/p&gt;




&lt;h3&gt;
  
  
  ✏️ Mandatory Fields in SDP
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;What It Means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;v=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Version&lt;/strong&gt; — always 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;o=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Origin&lt;/strong&gt; — username, session ID, IP of sender&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Session Name&lt;/strong&gt; — can be &lt;code&gt;-&lt;/code&gt; if not used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;c=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Connection Info&lt;/strong&gt; — IP address to send media&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;t=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Timing&lt;/strong&gt; — start and stop time (0 0 = forever)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;m=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Media Description&lt;/strong&gt; — media type, port, transport, codecs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;a=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Attributes&lt;/strong&gt; — like codec details, encryption, etc.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  🎙 What Are Codecs?
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;codec&lt;/strong&gt; (short for &lt;em&gt;coder-decoder&lt;/em&gt;) compresses and decompresses media like voice or video. In VoIP, we use codecs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save bandwidth (fewer bits = faster calls)&lt;/li&gt;
&lt;li&gt;Improve audio quality&lt;/li&gt;
&lt;li&gt;Handle different devices and network conditions&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔊 Common Audio Codecs
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Codec&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Bandwidth&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PCMU (G.711 µ-law)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Classic PSTN quality&lt;/td&gt;
&lt;td&gt;~64 kbps&lt;/td&gt;
&lt;td&gt;Good quality, high bandwidth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PCMA (G.711 A-law)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;EU version of µ-law&lt;/td&gt;
&lt;td&gt;~64 kbps&lt;/td&gt;
&lt;td&gt;Similar to PCMU&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;G.729&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Compressed voice&lt;/td&gt;
&lt;td&gt;~8 kbps&lt;/td&gt;
&lt;td&gt;Low bandwidth, licensed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Opus&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modern, flexible&lt;/td&gt;
&lt;td&gt;6–510 kbps&lt;/td&gt;
&lt;td&gt;Great quality, dynamic bitrate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;G.722&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;HD voice&lt;/td&gt;
&lt;td&gt;~64 kbps&lt;/td&gt;
&lt;td&gt;Wideband audio&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  📹 Common Video Codecs
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Codec&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H.264&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Standard for video calls&lt;/td&gt;
&lt;td&gt;Widely used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VP8 / VP9&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Open-source codecs&lt;/td&gt;
&lt;td&gt;Used in WebRTC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;H.265 (HEVC)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Next-gen, better compression&lt;/td&gt;
&lt;td&gt;Not always supported&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🎮 SIP + SDP: Setting the Game Rules
&lt;/h2&gt;

&lt;p&gt;Let’s update our SIP message to imagine it has the voice rules included:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;INVITE sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt; SIP/2.0&lt;br&gt;
...&lt;br&gt;
Content-Type: application/sdp&lt;br&gt;
Content-Length: 151&lt;/p&gt;

&lt;p&gt;v=0&lt;br&gt;
o=alice 2890844526 2890844526 IN IP4 192.168.1.10&lt;br&gt;
s=-&lt;br&gt;
c=IN IP4 192.168.1.10&lt;br&gt;
t=0 0&lt;br&gt;
m=audio 49170 RTP/AVP 0 96&lt;br&gt;
a=rtpmap:0 PCMU/8000&lt;br&gt;
a=rtpmap:96 opus/48000/2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It’s saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Hey Bob, send me voice on 192.168.1.10:49170. I speak PCMU and Opus. You pick.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bob can then reply with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Cool, I speak Opus too” (and use &lt;code&gt;a=rtpmap:96 opus/48000/2&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Or “Let’s just stick with PCMU.”&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SDP&lt;/strong&gt; is metadata — it tells the other side how to stream media&lt;/li&gt;
&lt;li&gt;SIP uses SDP to offer codecs, IPs, and ports&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audio codecs&lt;/strong&gt; like PCMU, Opus, G.729 define voice quality + size&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video codecs&lt;/strong&gt; like H.264 and VP8 make video calls possible&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDP doesn’t send media&lt;/strong&gt; — it just describes it&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Up Next in SIP GAMES:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;“The Real MVP — RTP: The Voice Inside the Wires”&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Now that SIP + SDP agreed on &lt;em&gt;how&lt;/em&gt; we’ll talk, it’s time to learn how your voice actually hops across the internet in real time.&lt;/p&gt;

&lt;p&gt;Stay tuned for packet magic!&lt;/p&gt;

&lt;p&gt;🎮 Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt; for more VoIP fun with less RFC-induced stress.&lt;/p&gt;

</description>
      <category>voip</category>
      <category>sdp</category>
      <category>codecs</category>
      <category>media</category>
    </item>
    <item>
      <title>📡 You’re Invited… to the Session! (What Even is SIP?)</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Mon, 16 Jun 2025 11:22:39 +0000</pubDate>
      <link>https://dev.to/sip_games/youre-invited-to-the-session-what-even-is-sip-1ilh</link>
      <guid>https://dev.to/sip_games/youre-invited-to-the-session-what-even-is-sip-1ilh</guid>
      <description>&lt;p&gt;&lt;em&gt;“SIP sets up the game. RTP plays it.”&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 So... What is SIP?
&lt;/h2&gt;

&lt;p&gt;SIP (Session Initiation Protocol) is the VoIP equivalent of the &lt;strong&gt;game master&lt;/strong&gt; — it sets the rules, gets the players into the arena, and then steps back once the game (the voice conversation) begins.&lt;/p&gt;

&lt;p&gt;In plain terms:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;SIP handles call setup, ringing, answering, and tear-down.&lt;/strong&gt; It does &lt;em&gt;not&lt;/em&gt; carry your voice — that’s RTP’s job.  &lt;/p&gt;

&lt;p&gt;Think of SIP like sending someone a party invite. It tells them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who’s calling&lt;/li&gt;
&lt;li&gt;Where the call should happen&lt;/li&gt;
&lt;li&gt;How they can reach you&lt;/li&gt;
&lt;li&gt;And whether they want to accept it or ghost you&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  ☎️ The Call Flow (Simplified)
&lt;/h2&gt;

&lt;p&gt;Here’s how a basic SIP call between two softphones works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User A            SIP Server            User B
  |                   |                   |
  |--- INVITE -------&amp;gt;|                   |
  |                   |--- INVITE -------&amp;gt;|
  |                   |&amp;lt;-- 180 RINGING ---|
  |&amp;lt;-- 180 RINGING ---|                   |
  |                   |&amp;lt;-- 200 OK --------|
  |&amp;lt;-- 200 OK --------|                   |
  |--- ACK ----------&amp;gt;|                   |
  |                   |--- ACK ----------&amp;gt;|
  |                   |                   |
  |&amp;lt;==== RTP Media Stream (Voice) ======&amp;gt;|
  |                   |                   |
  |--- BYE ----------&amp;gt;|                   |
  |                   |--- BYE ----------&amp;gt;|
  |                   |&amp;lt;-- 200 OK --------|
  |&amp;lt;-- 200 OK --------|                   |

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🧠 Key SIP Messages
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Message&lt;/th&gt;
&lt;th&gt;What it Means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;INVITE&lt;/td&gt;
&lt;td&gt;“Hey, want to talk?”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;180 RINGING&lt;/td&gt;
&lt;td&gt;“They’re being notified”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;200 OK&lt;/td&gt;
&lt;td&gt;“They picked up!”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ACK&lt;/td&gt;
&lt;td&gt;“Cool, let’s connect”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BYE&lt;/td&gt;
&lt;td&gt;“Gotta go, bye!”&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🎯 SIP in Action — What You See in Logs
&lt;/h2&gt;

&lt;p&gt;If you’ve ever looked at SIP logs (Wireshark, anyone?), you’ll see something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;INVITE sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt; SIP/2.0&lt;br&gt;
From: "Alice" sip:&lt;a href="mailto:alice@example.net"&gt;alice@example.net&lt;/a&gt;&lt;br&gt;
To: sip:&lt;a href="mailto:bob@example.com"&gt;bob@example.com&lt;/a&gt;&lt;br&gt;
Call-ID: &lt;a href="mailto:789abc123@example.net"&gt;789abc123@example.net&lt;/a&gt;&lt;br&gt;
CSeq: 1 INVITE&lt;br&gt;
Contact: sip:&lt;a href="mailto:alice@192.168.1.10"&gt;alice@192.168.1.10&lt;/a&gt;:5060&lt;br&gt;
Content-Type: application/sdp&lt;br&gt;
Content-Length: 151&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Notice that last part? &lt;strong&gt;&lt;code&gt;Content-Type: application/sdp&lt;/code&gt;&lt;/strong&gt; 👀&lt;br&gt;&lt;br&gt;
Yup — SIP includes something called &lt;strong&gt;SDP&lt;/strong&gt; inside it. It’s like the fine print in your call invitation — it lists what codecs you'll use, what port to send media to, and more.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 SIP ≠ Voice
&lt;/h2&gt;

&lt;p&gt;SIP doesn’t carry your voice.&lt;/p&gt;

&lt;p&gt;Instead, once the SIP call is accepted, &lt;strong&gt;RTP (Real-time Transport Protocol)&lt;/strong&gt; takes over to actually move the media (voice, video, etc.) between endpoints.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SIP&lt;/strong&gt; = The call setup (the RSVP)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RTP&lt;/strong&gt; = The actual voice (the conversation)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔁 What Happens When You Hang Up?
&lt;/h2&gt;

&lt;p&gt;A typical SIP BYE exchange:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;User A --&amp;gt; BYE --&amp;gt; SIP Server --&amp;gt; BYE --&amp;gt; User B&lt;br&gt;
User B --&amp;gt; 200 OK --&amp;gt; SIP Server --&amp;gt; 200 OK --&amp;gt; User A&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Simple. Fast. And very polite.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SIP is a signaling protocol&lt;/strong&gt;, not a media protocol&lt;/li&gt;
&lt;li&gt;It helps set up, modify, and end VoIP calls&lt;/li&gt;
&lt;li&gt;It uses messages like &lt;code&gt;INVITE&lt;/code&gt;, &lt;code&gt;RINGING&lt;/code&gt;, &lt;code&gt;ACK&lt;/code&gt;, and &lt;code&gt;BYE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It wraps media setup details using &lt;strong&gt;SDP&lt;/strong&gt; (coming next)&lt;/li&gt;
&lt;li&gt;After the call setup, &lt;strong&gt;RTP&lt;/strong&gt; moves the actual voice packets&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Up Next in SIP GAMES:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;“What’s in the Envelope? Unpacking SDP”&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
SDP (Session Description Protocol) tells your devices what media codecs to use, how to send the audio, and more — it’s like the secret note inside your SIP envelope.&lt;/p&gt;

&lt;p&gt;Stay tuned as we dive into how a voice call actually finds its voice.&lt;/p&gt;

&lt;p&gt;🕹 Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt; for more VoIP magic — minus the RFC migraines.&lt;/p&gt;

</description>
      <category>voip</category>
      <category>sip</category>
      <category>telephony</category>
      <category>beginners</category>
    </item>
    <item>
      <title>📟 From Switchboards to Softswitches: The Players Behind the Voice</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Tue, 10 Jun 2025 16:28:45 +0000</pubDate>
      <link>https://dev.to/sip_games/from-switchboards-to-softswitches-the-players-behind-the-voice-4ml2</link>
      <guid>https://dev.to/sip_games/from-switchboards-to-softswitches-the-players-behind-the-voice-4ml2</guid>
      <description>&lt;p&gt;&lt;em&gt;“Know your environment. Understand who’s running the game.”&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ☎️ Let’s Rewind
&lt;/h2&gt;

&lt;p&gt;Once upon a time, calling someone meant a person &lt;em&gt;literally&lt;/em&gt; plugged cables into a board to connect your voice to theirs.&lt;/p&gt;

&lt;p&gt;Those were the &lt;strong&gt;manual switchboards&lt;/strong&gt;, followed by &lt;strong&gt;automated telephone exchanges&lt;/strong&gt;. That era used &lt;strong&gt;circuit-switched networks&lt;/strong&gt; — where a dedicated line was held for your entire call.&lt;/p&gt;

&lt;p&gt;Fast forward ⏩ — and now your voice zips through &lt;strong&gt;packet-switched networks&lt;/strong&gt;, hopping across routers, firewalls, clouds, and code.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠 The Game Board: Old vs New
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;Circuit-Switched World&lt;/th&gt;
&lt;th&gt;Packet-Switched (VoIP) World&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Call Routing&lt;/td&gt;
&lt;td&gt;PSTN (Public Switched Telephone Network)&lt;/td&gt;
&lt;td&gt;Internet (IP networks)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Central Device&lt;/td&gt;
&lt;td&gt;PBX / Exchange&lt;/td&gt;
&lt;td&gt;IP-PBX / Softswitch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Physical Wiring&lt;/td&gt;
&lt;td&gt;Dedicated copper circuits&lt;/td&gt;
&lt;td&gt;IP network, Ethernet, Wi-Fi&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Call Setup/Teardown&lt;/td&gt;
&lt;td&gt;Controlled by Telco systems&lt;/td&gt;
&lt;td&gt;Controlled by SIP or similar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Call Audio Path&lt;/td&gt;
&lt;td&gt;Fixed voice circuit&lt;/td&gt;
&lt;td&gt;Dynamic RTP media stream&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  🧠 Circuit vs Packet Switching — The Core Shift
&lt;/h3&gt;

&lt;h4&gt;
  
  
  🎚 Circuit Switching (Old School)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Like renting an entire highway just for your car
&lt;/li&gt;
&lt;li&gt;Fixed bandwidth, reliable, expensive
&lt;/li&gt;
&lt;li&gt;Example: Landline call from your grandma’s rotary phone&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  📦 Packet Switching (Modern VoIP)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Your voice is chopped into chunks (packets), each taking the best route
&lt;/li&gt;
&lt;li&gt;More efficient, shared bandwidth
&lt;/li&gt;
&lt;li&gt;Like a backpacker using public transport
&lt;/li&gt;
&lt;li&gt;Example: WhatsApp call on patchy airport Wi-Fi&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔄 Enter the VoIP Equivalents
&lt;/h3&gt;

&lt;p&gt;Let’s meet the &lt;strong&gt;players behind modern voice traffic&lt;/strong&gt;:&lt;/p&gt;

&lt;h4&gt;
  
  
  🏢 IP-PBX (Internet Protocol Private Branch Exchange)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The VoIP version of a PBX (Private Branch Exchange)&lt;/li&gt;
&lt;li&gt;Manages internal extensions, call routing, voicemail, IVR
&lt;/li&gt;
&lt;li&gt;Runs on software, sometimes even cloud-based (like FreePBX or 3CX)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ⚙️ Softswitch
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Software-powered switchboard&lt;/li&gt;
&lt;li&gt;Routes calls between networks — VoIP ↔ PSTN or VoIP ↔ VoIP
&lt;/li&gt;
&lt;li&gt;Used by telcos and service providers (FreeSWITCH, Kamailio, OpenSIPS)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  📱 SIP Endpoints
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Devices or apps that speak SIP (VoIP protocol)
&lt;/li&gt;
&lt;li&gt;Can be a softphone app, VoIP desk phone, or even a smart fridge (yep)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 Visual Time
&lt;/h2&gt;

&lt;h3&gt;
  
  
  📈 Circuit Switched Call Flow
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;User A ---[Analog Signal]---&amp;gt; PBX ---[TDM Circuit]---&amp;gt; Telco Switch ---[TDM Circuit]---&amp;gt; User B&lt;/p&gt;

&lt;p&gt;|&amp;lt;------Dedicated voice circuit maintained throughout------&amp;gt;| &lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🌐 VoIP / Packet Switched Call Flow (SIP + RTP)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;User A (Softphone)&lt;br&gt;
    |&lt;br&gt;
    |---[SIP INVITE (Signaling)]---&amp;gt; SIP Server&lt;br&gt;
    |&lt;br&gt;
    |&amp;lt;--[SIP 200 OK / ACK]----------|&lt;br&gt;
   |&lt;br&gt;
   |---[RTP Media Stream]----------&amp;gt; User B (Softphone)&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧠 Why This Matters
&lt;/h2&gt;

&lt;p&gt;Knowing &lt;strong&gt;who's doing what&lt;/strong&gt; behind the scenes helps you debug, design, and build better voice applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bad call quality? Might be RTP path or NAT issue
&lt;/li&gt;
&lt;li&gt;Can’t make internal calls? Could be IP-PBX config
&lt;/li&gt;
&lt;li&gt;Confused by latency? Maybe your packets are playing hopscotch through the cloud&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🏁 TL;DR – Survived Another Round?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Circuit-switched&lt;/strong&gt; = old-school dedicated lines
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packet-switched&lt;/strong&gt; = modern, flexible, efficient
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP-PBX&lt;/strong&gt; = the office call controller
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Softswitch&lt;/strong&gt; = the telecom traffic cop
&lt;/li&gt;
&lt;li&gt;You’re not just making a call — you’re crossing systems, formats, and protocols&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⏭️ Up Next in SIP GAMES:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;"You’re Invited… to the Session"&lt;/strong&gt; – A deep dive into SIP and how calls are actually set up.&lt;/p&gt;




&lt;p&gt;🕹 Follow &lt;a href="https://dev.to/sip_games"&gt;@sip_games&lt;/a&gt; to learn SIP without reading the RFCs.&lt;/p&gt;

</description>
      <category>voip</category>
      <category>telephony</category>
      <category>sip</category>
      <category>beginners</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>SIP GAMES</dc:creator>
      <pubDate>Tue, 10 Jun 2025 12:36:26 +0000</pubDate>
      <link>https://dev.to/sip_games/-2eb6</link>
      <guid>https://dev.to/sip_games/-2eb6</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/sip_games/what-even-is-voip-368a" class="crayons-story__hidden-navigation-link"&gt;🎭 What Even Is VoIP?&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/sip_games" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3254680%2F38716dd8-865f-49d7-b16b-f172c87b4a4a.png" alt="sip_games profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/sip_games" class="crayons-story__secondary fw-medium m:hidden"&gt;
              SIP GAMES
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                SIP GAMES
                
              
              &lt;div id="story-author-preview-content-2580132" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/sip_games" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3254680%2F38716dd8-865f-49d7-b16b-f172c87b4a4a.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;SIP GAMES&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/sip_games/what-even-is-voip-368a" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 10 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/sip_games/what-even-is-voip-368a" id="article-link-2580132"&gt;
          🎭 What Even Is VoIP?
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/voip"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;voip&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/sip"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;sip&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/telephony"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;telephony&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/sip_games/what-even-is-voip-368a#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              3&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>voip</category>
      <category>sip</category>
      <category>beginners</category>
      <category>telephony</category>
    </item>
  </channel>
</rss>
