Showing results for 
Search instead for 
Did you mean: 

how to get CallID in Macro?

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

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: ""
*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: ""
*s Call 8 Status: Connected
*s Call 8 TransmitCallRate: 2500
** end


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.