ChannelHangup not received for origination from stasis app

I have originated for a number from my stasis app using ari but if the user rejects the call the hangup event not coming to asterisk
All other events like seesionProgress and ringing is reaching asterisk but why hangup is not working
I am using node-ari

const callee = await client.channels.originate({
            endpoint: endpointName,
            app: appName,
            appArgs: `outgoing-callee,${sessionId}`,
            callerId: `full_mobile_number`
        });

How to know what is going wrong

Show a log of the actual ARI events being raised by Asterisk using “ari set debug on”. Unless you mean from a SIP perspective, in which case you would need to provide “pjsip set logger on” of a failure.

<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "type": "Dial",
  "timestamp": "2025-11-26T07:18:23.691+0000",
  "dialstatus": "",
  "forward": "",
  "dialstring": "+917777777777@trunk1",
  "peer": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
    -- PJSIP/trunk1-000000d6 is making progress
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "type": "Dial",
  "timestamp": "2025-11-26T07:18:24.682+0000",
  "dialstatus": "PROGRESS",
  "forward": "",
  "dialstring": "+917777777777@trunk1",
"peer": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}


The user cuts the call as soon as it recieves the call but no event received

It takes almost the time of full ring to send these events afterwards

<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOS",
  "value": "ssrc=859601133;themssrc=521638110;lp=0;rxjitter=0.000000;rxcount=983;txjitter=0.001125;txcount=0;rlp=0;rtt=0.000000;rxmes=0.000000;txmes=88.087887",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.724+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOSJITTER",
  "value": "minrxjitter=000.000000;maxrxjitter=000.001125;avgrxjitter=000.000314;stdevrxjitter=000.000191;mintxjitter=000.000000;maxtxjitter=000.000000;avgtxjitter=000.000000;stdevtxjitter=000.000000;",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.724+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
"state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOSLOSS",
  "value": "  minrxlost=000.000000;  maxrxlost=000.000000;  avgrxlost=000.000000;  stdevrxlost=000.000000;  mintxlost=000.000000;  maxtxlost=000.000000;  avgtxlost=000.000000;  stdevtxlost=000.000000;",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.724+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
"connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOSRTT",
  "value": "     minrtt=000.000000;     maxrtt=000.000000;     avgrtt=000.000000;     stdevrtt=000.000000;",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.724+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
 "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOSMES",
  "value": "   minrxmes=088.087887;   maxrxmes=088.087887;   avgrxmes=088.087887;   stdevrxmes=000.000191;   mintxmes=000.000000;   maxtxmes=000.000000;   avgtxmes=000.000000;   stdevtxmes=000.000000;",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.724+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
"connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "cause": 31,
  "type": "ChannelHangupRequest",
  "timestamp": "2025-11-26T07:18:45.724+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },

"creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "type": "Dial",
  "timestamp": "2025-11-26T07:18:45.724+0000",
  "dialstatus": "NOANSWER",
  "forward": "",
  "dialstring": "+917777777777@trunk1",
  "peer": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": +918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
"variable": "RTPAUDIOQOS",
  "value": "ssrc=859601133;themssrc=521638110;lp=0;rxjitter=0.000000;rxcount=983;txjitter=0.001125;txcount=0;rlp=0;rtt=0.000000;rxmes=0.000000;txmes=88.087887",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.727+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOSJITTER",
  "value": "minrxjitter=000.000000;maxrxjitter=000.001125;avgrxjitter=000.000314;stdevrxjitter=000.000191;mintxjitter=000.000000;maxtxjitter=000.000000;avgtxjitter=000.000000;stdevtxjitter=000.000000;",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.727+0000",
  "channel": {

"id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOSLOSS",
  "value": "  minrxlost=000.000000;  maxrxlost=000.000000;  avgrxlost=000.000000;  stdevrxlost=000.000000;  mintxlost=000.000000;  maxtxlost=000.000000;  avgtxlost=000.000000;  stdevtxlost=000.000000;",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.727+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
"caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "accountcode": "",
    "dialplan": {
      "context": "from-twilio",
      "exten": "s",
      "priority": 1,
      "app_name": "AppDial2",
      "app_data": "(Outgoing Line)"
    },
    "creationtime": "2025-11-26T07:18:23.639+0000",
    "language": "en"
  },
  "asterisk_id": "00:22:48:cb:5a:6d",
  "application": "myapp"
}
<--- Sending ARI event to 10.0.0.5:47798 --->
{
  "variable": "RTPAUDIOQOSRTT",
  "value": "     minrtt=000.000000;     maxrtt=000.000000;     avgrtt=000.000000;     stdevrtt=000.000000;",
  "type": "ChannelVarset",
  "timestamp": "2025-11-26T07:18:45.727+0000",
  "channel": {
    "id": "1764141503.483",
    "name": "PJSIP/trunk1-000000d6",
    "state": "Down",
    "protocol_id": "517a1486-7279-4003-bf1f-df80abeba91d",
    "caller": {
      "name": "Pronnel",
      "number": "+918888888888"
    },
    "connected": {
      "name": "Pronnel",
      "number": "+918888888888"

But these events are received too late to tell that user has cut the call already.

Okay, so unlike your original complaint the events ARE sent but now you’re saying they’re sent too late?

The events occur based on the SIP signaling, so you’d need to provide that alongside the ARI so it can be seen when we get the SIP side.