Jsawyer
Jsawyer

Reputation: 73

Using jsSIP in A Project

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.

enter image description here

In the above image, i want to take "1004" telephone number. How can i do that?

Upvotes: 0

Views: 2542

Answers (3)

Junior Mena
Junior Mena

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

Max Kirillov
Max Kirillov

Reputation: 51

You can also use

session.remote_identity.display_name

for incoming calls

Upvotes: 2

Sasi Varunan
Sasi Varunan

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

Related Questions