| Previous | Next |
| RTC_E_INVALID_LISTEN_SOCKET | RTC_E_SECURITY_LEVEL_ALREADY_SET |
RTC_E_PORT_MANAGER_ALREADY_SET
Operational meaning: RTC_E_PORT_MANAGER_ALREADY_SET
This result marks a specific boundary in registering listening sockets and supplying internal/external media mappings before session establishment: the session already has a port-manager callback and RTC forbids replacing it at this stage; treating it as a generic RTC failure loses the state needed to choose a safe next action.
For correlation, retain 0x80EE007C in the RTC interface facility 0xEE together with this result; for this HRESULT, generic HRESULT text can otherwise hide the protocol family and the exact RTC branch.
The quickest way to localize this result is to record session generation, current manager identity, set timing, and whether participant addition began; the important the boundary is that the result protects mapping consistency; it is not confirmation that the current manager returned valid mappings.
Signals worth preserving
The earliest callback or return site is the most valuable; later this result cleanup can replace the original state, so correlate the code with the object generation that produced it.
- Code-specific proof for this HRESULT: record session generation, current manager identity, set timing, and whether participant addition began.
- Correlation key for this HRESULT:
SDPaddress derived from mapping. - Protocol or object snapshot for this HRESULT: local and external address/port.
- Last completed transition for this HRESULT: port type and allowed range.
- Expected output for this HRESULT: mapping owner and lifetime.
Sanitize the result evidence before storage: secrets and user content should disappear, while framing, domains, sizes, hashes, timing, and object-state changes remain available for reproduction.
Protocol and object boundary
| RTC area | RTC listening and NAT port-mapping boundary |
|---|---|
| Condition to prove | the session already has a port-manager callback and RTC forbids replacing it at this stage |
| Objects to correlate | IRTCClientPortManagement, IRTCSessionPortManagement, IRTCPortManager, address/port range and mapping lifetime |
| Safe corrective direction | reuse the installed manager or create a new session before initiation if a different mapping owner is required |
Two RTC rules frame it: first, For outgoing sessions the port manager must be set before adding the participant; for incoming sessions it must be set before acceptance; second, for this HRESULT, The address advertised in SDP and the local socket receiving media are different values when NAT mapping is involved.
Verification workflow
- Record it and
0x80EE007Cat the first RTC method or event that returns it. - Identify the client, profile, session, participant, presence object, terminal, or port manager that owns this it occurrence.
- Place it in its exact phase: parsing, discovery, transport, authentication, profile validation, dialog control, media, roaming, registration, redirection, or final response handling.
- prove the condition by ensuring the trace can record session generation, current manager identity, set timing, and whether participant addition began.
- Apply one controlled change for this HRESULT: reuse the installed manager or create a new session before initiation if a different mapping owner is required; then verify the result return value and resulting RTC state.
A SIP capture without RTC callback state cannot show which local object accepted or rejected the transition; for this HRESULT, an HRESULT-only log has the opposite weakness: it cannot show whether the result was generated before transmission or mapped from the peer.
Do not confuse it with
It is tied to the condition “the session already has a port-manager callback and RTC forbids replacing it at this stage”; preserve that producing boundary before choosing recovery; for this HRESULT, the neighboring results below require different control-flow decisions.
RTC_E_PORT_MAPPING_UNAVAILABLE | the port manager cannot provide a usable internal/external mapping for the requested media flow |
|---|---|
RTC_E_LISTENING_SOCKET_NOT_EXIST | code attempted to stop or use a listening address/port registration that is not active |
RTC_E_PORT_MAPPING_FAILED | the port manager returned a concrete failure while creating or retrieving a mapping |
Keeping it separate from these neighbors improves both user messaging and automated retry policy.
Recovery and control flow
The appropriate response to it is not a blanket reconnect. Instead, reuse the installed manager or create a new session before initiation if a different mapping owner is required, while preserving ownership of cleanup and any bounded retry.
Before retrying it, classify the previous operation as definitely failed, definitely completed, or remotely uncertain; for this HRESULT, that distinction prevents duplicate dialogs, bindings, transfers, or roaming mutations.
Example for this HRESULT: Two NAT modules both call SetPortManager on the same outgoing session.
Actions that do not address this condition
- An investigation should not do not advertise an external mapping before confirming that it belongs to the current local socket.
- Another non-solution for this HRESULT is to do not set or replace the port manager after session initiation has consumed the mapping.
- Do not discard the result facility and state boundary when converting the result into application telemetry.
Verification after a fix
A useful it regression does more than expect an exception; the result test constructs “the session already has a port-manager callback and RTC forbids replacing it at this stage”, checks the exact HRESULT at the producing RTC boundary, and verifies state ownership before and after the targeted correction.
Technical references
- IRTCClientPortManagement — authoritative context for the boundary.
- RTC address mapping — definitions relevant when reproducing it.
- Microsoft RTC return constants — API or protocol rules used to interpret it.
- SDP syntax — authoritative context for the boundary.
Looking for a different code? Search another status or error code.