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

How to set the user agent? #233

Open
dariomalfatti-centropaghe opened this issue Apr 2, 2021 · 1 comment
Open

How to set the user agent? #233

dariomalfatti-centropaghe opened this issue Apr 2, 2021 · 1 comment

Comments

@dariomalfatti-centropaghe

I'm trying to set the user agent but I cannot figure out how to do that.
I tryed to set the header in the makeCall method like this:

const call = await endpoint.makeCall(a, n, {
  'X-UA': 'My app (v0.0.6 Android)'
});

and in the configuration of the createAccount method like this:

const configuration = {
	name: accountInfo.account.sipName,
	username: accountInfo.account.sipUserName,
	password: accountInfo.account.sipPassword,
	domain: accountInfo.account.sipDomain,
	transport: accountInfo.account.sipTransport,
	proxy: accountInfo.account.sipProxy,
	regHeaders: {
		'user-agent': 'My app (v0.0.6 Android)',
	},
};

I take a look at the source code where it set the user agent:

if (mServiceConfiguration.isUserAgentNotEmpty()) {
    epConfig.getUaConfig().setUserAgent(mServiceConfiguration.getUserAgent());
} else {
    epConfig.getUaConfig().setUserAgent("React Native PjSip ("+ mEndpoint.libVersion().getFull() +")");
}

I cannot configure mServiceConfiguration.getUserAgent() from my react native app. Is there any way to set it up?

@dariomalfatti-centropaghe
Copy link
Author

Anyone can help me please? Thanks

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

No branches or pull requests

1 participant