Skip to content

INT-8910: Add SRV resolutions callback to pjsua2, app uses to add iptables entry to allow outbound TCP traffic on resolved port#12

Merged
darshan-verkada merged 1 commit into
intercom/release-2-15from
feature/INT-8910-srv-resolved-callback
Apr 3, 2026
Merged

INT-8910: Add SRV resolutions callback to pjsua2, app uses to add iptables entry to allow outbound TCP traffic on resolved port#12
darshan-verkada merged 1 commit into
intercom/release-2-15from
feature/INT-8910-srv-resolved-callback

Conversation

@darshan-verkada
Copy link
Copy Markdown

Summary

  • Add pjsip_on_resolved_cb typedef and on_resolved field to pjsip_resolver_t
  • Add pjsip_resolver_set_on_resolved_cb() to register the callback
  • Add pjsip_endpt_get_sip_resolver() returning the correct pjsip_resolver_t* (vs pjsip_endpt_get_resolver() which returns the inner pj_dns_resolver* causing struct corruption/crash)
  • Invoke callback in srv_resolver_cb with NULL guards
  • Wire on_srv_resolved through pjsua_callback and pjsua_core.c bridge
  • Expose onSrvResolved virtual in pjsua2 Endpoint with SrvResolvedAddress / OnSrvResolvedParam types

Test plan

  • Register onSrvResolved in VEndpoint, verify it fires with resolved port/type after SIP registration
  • Verify no crash when nameserver is not configured (NULL resolver path)

🤖 Generated with Claude Code

…results

- Add pjsip_on_resolved_cb typedef and on_resolved field to pjsip_resolver_t
- Add pjsip_resolver_set_on_resolved_cb() to set the callback on the resolver
- Add pjsip_endpt_get_sip_resolver() returning the correct pjsip_resolver_t*
  (pjsip_endpt_get_resolver() returns the inner pj_dns_resolver* which caused
  struct corruption and a crash in pj_atomic_get when used incorrectly)
- Invoke the callback in srv_resolver_cb with NULL guards
- Wire on_srv_resolved through pjsua_callback and pjsua_core.c bridge
- Expose onSrvResolved virtual method in pjsua2 Endpoint with SrvResolvedAddress
  and OnSrvResolvedParam parameter types; register static bridge in libInit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented Apr 1, 2026

@darshan-verkada darshan-verkada changed the title INT-8910: Add on_srv_resolved callback to pjsua/pjsua2 for SRV resolution results INT-8910: Add on_srv_resolved callback to pjsua2 for SRV resolution results, application uses to add iptables entry to allow outbound TCP traffic on that port Apr 1, 2026
@darshan-verkada darshan-verkada changed the title INT-8910: Add on_srv_resolved callback to pjsua2 for SRV resolution results, application uses to add iptables entry to allow outbound TCP traffic on that port INT-8910: Add SRV resolutions callback to pjsua2, app uses to add iptables entry to allow outbound TCP traffic on resolved port Apr 1, 2026
@MattMacGregor MattMacGregor self-requested a review April 3, 2026 01:15
@darshan-verkada darshan-verkada merged commit f1d6905 into intercom/release-2-15 Apr 3, 2026
31 checks passed
@darshan-verkada darshan-verkada deleted the feature/INT-8910-srv-resolved-callback branch May 11, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants