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

Add support of out-of-dialog SIP transactions #4155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wosrediinanatour
Copy link
Contributor

@wosrediinanatour wosrediinanatour commented Nov 13, 2024

This commit adds support of out-of-dialog transactions to PJSUA and PJSUA2. The requests are sent in the context of an account. The API is similar to that of an in-dialog transaction.

Example: The new interface can be used to send SIP OPTIONS.

Issue: #4156

This commit adds support of out-of-dialog transactions to
PJSUA and PJSUA2. The requests are sent in the context of an account.
The API is similar to that of an in-dialog transaction.
pjsip/include/pjsua-lib/pjsua.h Outdated Show resolved Hide resolved
pjsip/include/pjsua-lib/pjsua.h Show resolved Hide resolved
pjsip/include/pjsua-lib/pjsua.h Outdated Show resolved Hide resolved
pjsip/include/pjsua2/account.hpp Outdated Show resolved Hide resolved
pjsip/src/pjsip/sip_transaction.c Outdated Show resolved Hide resolved
PJ_DECL(pj_status_t) pjsua_acc_send_request(pjsua_acc_id acc_id,
const pj_str_t *dest_uri,
const pj_str_t *method_str,
const pjsua_msg_data *msg_data);
Copy link
Member

Choose a reason for hiding this comment

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

Add few params which perhaps can be useful in the future:

  • app user-data/token (void *),
  • generic options/settings (void *): for now perhaps must be NULL, for extensibility in the future, so we don't need to create pjsua_acc_send_request2() :)

Copy link
Member

Choose a reason for hiding this comment

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

Looks like only token/user-data was added and it is specified as "unused" while it should be usable (as opposed to must-be-NULL :)

Actually user-data/token and settings are actually different:

  • user-data/token, basically it needs to be passed back in the callback, so app can correspond the tsx to something, just check pjsip_endpt_send_request() or pjsua_call_make_call() for reference.
  • settings, it is for future use, must be NULL for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry..I misunderstood.

So you are saying that the token should already work and shouldn't be for future use cases, i e. that an object is allocated in the pool, which stores the acc_id and the token (a pointer). (In current PR only acc_id is stored).

Copy link
Member

Choose a reason for hiding this comment

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

Yes, correct.

pjsip/include/pjsua-lib/pjsua.h Outdated Show resolved Hide resolved
@wosrediinanatour
Copy link
Contributor Author

Incorporated feedback in a fixup commit. PTAL.

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.

3 participants