Reputation: 73
We're using jsSIP in our project and I'm trying to get phone number of the caller when receiving an incoming call. I could't find the answer in the jsSIP documentation.
In the above image, i want to take "1004" telephone number. How can i do that?
Upvotes: 0
Views: 2542
Reputation: 57
You can try this for incoming and outgoing calls and you will get the user that is calling you or you are calling
session.remote_identity.uri.user
You can try this for incoming and outgoing calls and you will get the user call-id name
session.remote_identity.display_name
Upvotes: 2
Reputation: 51
You can also use
session.remote_identity.display_name
for incoming calls
Upvotes: 2
Reputation: 2864
In newRTCSession
Event you will get a session object.
session.request.header
.
Use session.request.getHeader('From')
to get From number
coolPhone.on('newRTCSession',function(session){
console.log(session.request);
console.log('call Id',session.request.getHeader('From'));
})
Upvotes: 1