pjproject icon indicating copy to clipboard operation
pjproject copied to clipboard

Feature Request: per-call credentials for pjsua calls

Open mscdex opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

Currently in pjsua/pjsua2 credentials are tied to accounts. However, since I just have a dummy account that I use for all calls, I need to have a way to provide per-call credentials. Additionally, having one account per call is not feasible not only for performance/resource reasons, but also because there would be no way for pjsip to know which credentials to choose if there are multiple sets of auth credentials with the same realm that would differ only in username/password.

Describe the solution you'd like

Have some way in the client digest auth callback (pjsip_cred_cb) to get at the pjsua call's user data so I can get at the specific call's credentials.

This could be solved in at least two different ways that I can think of offhand.

At the bare minimum the underlying pjsip_tx_data would be passed to the pjsip_cred_cb (or probably a new pjsip_cred_cb2). This alone would at least allow the possibility of having per-call credentials solution by having to implement a custom pjsip module that stores credentials for each call and is then accessible via tx_data.mod_data[...]. Not an ideal solution, but it'd be something.

However to make this feature nicer, there could additionally be support for a pjsua-specific wrapper (e.g. pjsua_cred_cb) around pjsip_cred_cb that has the same parameters except it also passes the underlying call's user data (by looking it up via tx_data.mod_data presumably).

Describe alternatives you've considered

Unfortunately there are none.

Additional context

mscdex avatar Jun 07 '22 18:06 mscdex