cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1487
Views
0
Helpful
2
Replies

how to get CallID in Macro?

xujf
Level 1
Level 1

I want to get CallID information in Macro, but I can not run xEvent command in Macro.

 

How to get Call information in Macro?

 

 

xEvent CallSuccessful
*es Event CallSuccessful CallId
*es Event CallSuccessful CallRate
*es Event CallSuccessful Direction
*es Event CallSuccessful EncryptionIn
*es Event CallSuccessful EncryptionOut
*es Event CallSuccessful Protocol
*es Event CallSuccessful RemoteURI
** end

2 Replies 2

xujf
Level 1
Level 1
resolved. I use xStatus to get call information that contain remote number and dialback number.

xStatus Call
*s Call 8 AnswerState: Answered
*s Call 8 CallType: Video
*s Call 8 CallbackNumber: "sip:66688800000@1table.cn"
*s Call 8 DeviceType: MCU
*s Call 8 Direction: Outgoing
*s Call 8 DisplayName: "66688800000"
*s Call 8 Duration: 10
*s Call 8 Encryption Type: "AES-128"
*s Call 8 FacilityServiceId: 0
*s Call 8 HoldReason: None
*s Call 8 PlacedOnHold: False
*s Call 8 Protocol: SIP
*s Call 8 ReceiveCallRate: 2500
*s Call 8 RemoteNumber: "66688800000@1table.cn"
*s Call 8 Status: Connected
*s Call 8 TransmitCallRate: 2500
** end

Hi,

The CallId can be fetched on the callsuccessful event, incomingcallindication and outgoingcallindication. When you have the ID you can get the specific call from xStatus as you are doing right now.

function callEvent() {                                          
  xapi.event.on('OutgoingCallIndication', (event) => {  //Listen for outgoing calls
    xapi.status.get('Call ' + event.CallId).then(verifyCall);
  });

If you do not have the CallId you may get the wrong call in certain scenarios, but if you know its only in one call your method will work as well.

 

/Magnus

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: