IVR is an extension so it has the extension id. You can compare the extensionId in the parties object to identify if the call is being made to the IVR or not. You can also subscribe for only IVR extension using the extensionId in the event filter.
eventFilters: [
'/restapi/v1.0/account/~/extension/6224242xxxx/telephony/sessions',
'/restapi/v1.0/account/~/extension/6235322xxxx/telephony/sessions'
],
...
//
{
"uuid": "4124906327025488283",
"timestamp": "2023-02-03T18:36:14.556Z",
"subscriptionId": "xxxxx",
"ownerId": "6228832xxxx",
"body": {
"sequence": 3,
"sessionId": "75883371xxxx",
"telephonySessionId": "...",
"serverId": "10.14.123.119.TAM",
"eventTime": "2023-02-03T18:36:14.516Z",
"parties": [
{
"accountId": "80964xxxx",
"extensionId": "6224242xxxx",
"id": "...",
"direction": "Inbound",
"to": {
"phoneNumber": "+1720386xxxx",
"name": "IVR Menu 1001",
"extensionId": "6224242xxxx"
},
"from": {
"phoneNumber": "+1650224xxxx",
"name": "WIRELESS CALLER"
},
...
}
],
"origin": {
"type": "Call"
}
}
}