Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

res_pjsip_path.c: Fix path when dialing using PJSIP_DIAL_CONTACTS() #732

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IgorrG
Copy link
Contributor

@IgorrG IgorrG commented May 12, 2024

When using the PJSIP_DIAL_CONTACTS() function for use in the Dial()
command, the contacts are returned in text form, so the input to
the path_outgoing_request() function is a contact value of NULL.
The issue was reported in ASTERISK-28211, but was not actually fixed
in ASTERISK-30100. This fix brings back the code that was previously
removed and adds code to search for a contact to extract the path
value from it.

Copy link

REMINDER: If this PR applies to other branches, please add a comment with the appropriate "cherry-pick-to" headers as per the Create a Pull Request process.

If you don't want it cherry-picked, please add a comment with cherry-pick-to: none so we don't keep asking.

If, after adding "cherry-pick-to" comments, you change your mind, please edit the comment to DELETE the header lines and add cherry-pick-to: none.

The currently active branches are now 18, 20, 21 and master.

@asteriskteam asteriskteam requested a review from a team May 12, 2024 09:15
@IgorrG
Copy link
Contributor Author

IgorrG commented May 12, 2024

cherry-pick-to: 21
cherry-pick-to: 20
cherry-pick-to: 18

@gtjoseph
Copy link
Member

res/res_pjsip_path.c Show resolved Hide resolved
char *username;
RAII_VAR(struct ao2_container *, contacts, NULL, ao2_cleanup);

uri_hostname = ast_sip_pjsip_uri_get_hostname(uri);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the uri is getting passed in and used to build these names, was that to compare against the contact when iterating?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this, I have figured out yesterday that some old patch uploaded. I'll update patch, correct way is to compare exact URI, without host/username extraction.

res/res_pjsip_path.c Show resolved Hide resolved
When using the PJSIP_DIAL_CONTACTS() function for use in the Dial()
command, the contacts are returned in text form, so the input to
the path_outgoing_request() function is a contact value of NULL.
The issue was reported in ASTERISK-28211, but was not actually fixed
in ASTERISK-30100. This fix brings back the code that was previously
removed and adds code to search for a contact to extract the path
value from it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants