react-native-pjsip
react-native-pjsip copied to clipboard
SIP/2.0 401 Unauthorized
Hi,
I have the error to create an account.
pjsua_core.c .RX 499 bytes Response msg 401/REGISTER/cseq=39923 (rdata0x11c08e228) from UDP 131.191.161.131:5060: SIP/2.0 401 Unauthorized
My Account configuration :
let configuration = {
"name": "John1",
"username": "0662505070",
"domain": "131.191.161.131",
"password": "******",
"proxy": null,
"transport": "UDP", // Default TCP
"regServer": null, // Default wildcard
"regTimeout": 3600 // Default 3600
};
Please help me.
Thanks.
I think you forgot to add the port, your domain should be look like this "131.191.161.131:5161"
I think you forgot to add the port, your domain should be look like this "131.191.161.131:5161"
I have added port inside domain like you say, I got message "Invalid Domain". I think domain is right because account is successfully created use of the domain.
about your username, i don't think you can use a number from trunk, try something local, like "something#123", also make sure you configured for PJSIP
about your username, i don't think you can use a number from trunk, try something local, like "something#123", also make sure you configured for PJSIP
Can you send me full configuration you set for PJSIP.
let configuration = { "name": "something#extension", "username": "something#extension", "transport": "UDP", "domain": "address:port", "password": "password" }; Did you configure PJSIP at asterisk side ?
@yunhanxia
I set as your configure but i don't create account.
PJSIP at asterisk side ? I don't know.
your server I mean
okay. Can you send me server setting for it.
Can you send the full code of creating account and make call ?
Can you send the full code of creating account and make call ?
I send some code.
import { Endpoint } from 'react-native-pjsip'
let endpoint = new Endpoint();
let configuration = {
"name": "name",
"username": "username",
"domain": "domain",
"password": "password",
"proxy": null,
"transport": "UDP", // Default TCP
"regServer": null, // Default wildcard
"regTimeout": 3600 // Default 3600
};
endpoint.createAccount(configuration).then((account) => {
console.log("Account created", account);
if (account !== null) {
let call = await endpoint.makeCall(this.state.account, +9157665544);
}
});
As Above code for creating Account and for make a call after successfully creating account.
let options = { headers: { 'P-Asserted-Identity': 'Header Example', 'X-UA': 'React native' } }; let call = await endpoint.makeCall(account, "sip:" + number + "@" + domain, options); thats my makecall
The Header value is fixed.
'P-Asserted-Identity': 'Header Example',
'X-UA': 'React native'
I check on LinePhone App with all setting. In this app account created successfully but there is not calling inside the app.
App : https://play.google.com/store/apps/details?id=org.linphone&hl=en_IN
Can you say what's issue. and what's server side integration.
I don't have access to my server's source config (asterisk), but we have an admin platform that i can update an extension on PJSIP or SIP. In my App, I did a local config with username as "something#extension" (myhome#500 for example) and domain as "myipaddress:port" (192.168.1.25:5161 for example).
For make call, my destination : "sip:" + number + "@" + domain", the number could be local and external (sip:[email protected]:5161 or sip:[email protected]:5161)
Hey, I've the same problem. I started the officeSIP server (windows 10) and am trying to connect to an existing user and pass following configuration:
const configuration = {
name: "Oleg",
username: "oleg",
domain: '192.168.4.179:5060',
password: "123",
proxy: null,
};
Versions: react-native: 0.59.9 react-native-pjsip: 2.7.4
How did you manage to successfully install this? When I run npm i react-native-pjsip
I am getting version ^2.7.4 but there is a podspec issue that prevents me from using it. 2.8.0 appears to have resolved this issue but npm is not installing 2.8.0.
@Amaan630
"react-native-pjsip": "git+https://github.com/datso/react-native-pjsip.git"
this will install 2.8.0
Hi, @yunhanxia I am facing this issue
Title: pjsua_call_make_call(acc.getId(), &pj_dst_uri, param.p_opt, this, param.p_msg_data, &id) Code: 171039 Description: Invalid URI (PJSIP_EINVALIDURI) Location: ../src/pjsua2/call.cpp:566
Thanks in advance.
Hi @marufMunshi I am facing the same issue, have you find out the solution ?? Thanks in advance.
No, I did not find the solution, we eventually ended up using Linphone. @Sulbha-Mishra29
Okay thanks for reply, But Linphone is only available for Android project, So have you created interface for react native application ??
On Sun, Feb 20, 2022, 12:30 PM Maruf Hasan @.***> wrote:
No, I did not find the solution, we eventually ended up using Linphone. @Sulbha-Mishra29 https://github.com/Sulbha-Mishra29
— Reply to this email directly, view it on GitHub https://github.com/datso/react-native-pjsip/issues/182#issuecomment-1046176044, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASWEYLHBH37YZZMKA2LKKGTU4CGQ5ANCNFSM4HNI2Z6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
Yes, but not by me. I don't have any experience with Android. This is done by another developer in my company. @Sulbha-Mishra29