jitsi / jibri

Jitsi BRoadcasting Infrastructure
Apache License 2.0
607 stars 313 forks source link

feat: add the optional contact parameter for pjsua #504

Closed emrahcom closed 1 year ago

emrahcom commented 1 year ago

This commit adds an optional --contact parameter for pjsua client.

When video-sip-gateway client is behind a NAT, it may be needed to set --contact to inform invitee for the accessible endpoint which is not always the same with inviter's SIP address.

This commit allows to set contact through jitsi-component-selector API.

A sample request may be like the following

{
  "callParams": {
    "callUrlInfo": {
      "baseUrl": "$JITSI_HOST",
      "callName": "$JITSI_ROOM"
    }
  },
  "componentParams": {
    "type": "SIP-JIBRI",
    "region": "default-region",
    "environment": "default-env"
  },
  "metadata": {
    "sipClientParams": {
      "userName": "$INVITER_USERNAME",
      "password": "$INVITER_PASSWORD",
      "contact": "$INVITER_CONTACT",
      "sipAddress": "$INVITEE",
      "displayName": "Caller",
      "autoAnswer": true
    }
  },
  "callLoginParams": {
    "domain": "sip.jitsi.mydomain.com",
    "username": "sip",
    "password": "$PROSODY_SIP_PASSWD"
  }
}
jitsi-jenkins commented 1 year ago

Hi, thanks for your contribution! If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

codecov[bot] commented 1 year ago

Codecov Report

Merging #504 (ba71c1c) into master (9b9afdd) will decrease coverage by 0.03%. The diff coverage is 50.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/jitsi/jibri/pull/504/graphs/tree.svg?width=650&height=150&src=pr&token=P6jrfpYsWM&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi)](https://codecov.io/gh/jitsi/jibri/pull/504?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi) ```diff @@ Coverage Diff @@ ## master #504 +/- ## ============================================ - Coverage 48.12% 48.10% -0.03% Complexity 174 174 ============================================ Files 73 73 Lines 2103 2106 +3 Branches 199 200 +1 ============================================ + Hits 1012 1013 +1 - Misses 1021 1023 +2 Partials 70 70 ``` | [Impacted Files](https://codecov.io/gh/jitsi/jibri/pull/504?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi) | Coverage Δ | | |---|---|---| | [...in/org/jitsi/jibri/sipgateway/pjsua/PjsuaClient.kt](https://codecov.io/gh/jitsi/jibri/pull/504?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi#diff-c3JjL21haW4va290bGluL29yZy9qaXRzaS9qaWJyaS9zaXBnYXRld2F5L3Bqc3VhL1Bqc3VhQ2xpZW50Lmt0) | `2.12% <0.00%> (-0.10%)` | :arrow_down: | | [...ain/kotlin/org/jitsi/jibri/sipgateway/SipClient.kt](https://codecov.io/gh/jitsi/jibri/pull/504?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi#diff-c3JjL21haW4va290bGluL29yZy9qaXRzaS9qaWJyaS9zaXBnYXRld2F5L1NpcENsaWVudC5rdA==) | `62.50% <100.00%> (+2.50%)` | :arrow_up: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/jitsi/jibri/pull/504?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/jitsi/jibri/pull/504?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi). Last update [9b9afdd...ba71c1c](https://codecov.io/gh/jitsi/jibri/pull/504?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jitsi).