[asterisk-bugs] [JIRA] (ASTERISK-28428) app_dial incorrectly alters Hangup and DialEnd events when the c argument is passed, but app_dial didn't cancel the call.
Jonas Swiatek (JIRA)
noreply at issues.asterisk.org
Fri May 24 07:20:47 CDT 2019
Jonas Swiatek created ASTERISK-28428:
----------------------------------------
Summary: app_dial incorrectly alters Hangup and DialEnd events when the c argument is passed, but app_dial didn't cancel the call.
Key: ASTERISK-28428
URL: https://issues.asterisk.org/jira/browse/ASTERISK-28428
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Applications/app_dial
Affects Versions: 16.3.0
Environment: Amazon Linux 2 (CentOS based)
Reporter: Jonas Swiatek
Specific to chan_pjsip, chan_sip doesn't have this behavior.
I'll provide a few examples I've encountered where the AMI Events are incorrectly having their hangup cause set to 26. Answered Elsewhere.
The INVITE generated by app_dial wasn't canceled in any of the examples. Presumably app_dial would only cancel the call if timeout is reached, or if someone else answers the call. In all examples provided here, the initial invite is rejected by either 404 Not Found, 480 Temp. Unavailable or 486 Busy Here.
Following dial plan code example. Bug only presents itself when the c argument is used.
Registrar is a Kamailio server handling registration.
{code}
[dial]
exten => _.,1,DIAL(PJSIP/jonas2 at registrar, 30, c)
same => n,Hangup()
{code}
*404 Not Found*
If user *jonas2* isn't registered and kamailio responds with *SIP 404 Not Found*, the AMI hangup event is expected to have Cause *1. Unallocated (unassigned) number*, however when the c argument is provided, the event looks as follows:
{code}
{
"Event": "Hangup",
"Channel": "PJSIP/registrar-000000dd",
"ChannelState": 0,
"ChannelStateDesc": "Down",
"CallerIDNum": "jonas2",
"CallerIDName": "<unknown>",
"ConnectedLineNum": "jonas1",
"ConnectedLineName": "jonas1",
"AccountCode": "",
"Context": "dial",
"Exten": "jonas2",
"Priority": "1",
"Cause": 26,
"Causetxt": "Answered elsewhere",
"Linkedid": "ast007-1558613595.414",
"Uniqueid": "ast007-1558613595.415",
"UtcDate": "2019-05-23T12:13:15Z",
"DateReceived": "23-05-2019 12:13:15",
"Language": "en",
"Privilege": "call,all",
"SystemName": "ast007",
"KafkaPartitionId": 0,
"KafkaOffset": 0,
"_sequence": 1839,
"AdditionalAttributes": {
"Cause-txt": "Answered elsewhere",
"ApproxTimeStamp": "2019-05-23T12:13:16.628+00:00"
}
}
{code}
The issue lies with the Cause and Causetxt fields, which should read 1/Unallocated (unassigned) number, since this call was NOT answered elsewhere, and app_dial didn't cancel the call. If the c argument isn't set, then this event correctly reads 1/Unallocated (unassigned) number.
*480 Temporarily Unavailable*
This status code is typically returned by SIP Phones if they're set in DND mode. It's returned without first sending a 180 Ringing provisional response. When the c argument is passed to app_dial, the event looks as follows:
{code}
{
"Event": "Hangup",
"Channel": "PJSIP/registrar-000000e3",
"ChannelState": 0,
"ChannelStateDesc": "Down",
"CallerIDNum": "jonas2",
"CallerIDName": "<unknown>",
"ConnectedLineNum": "jonas1",
"ConnectedLineName": "jonas1",
"AccountCode": "",
"Context": "dial",
"Exten": "jonas2",
"Priority": "1",
"Cause": 26,
"Causetxt": "Answered elsewhere",
"Linkedid": "ast007-1558613775.420",
"Uniqueid": "ast007-1558613775.421",
"UtcDate": "2019-05-23T12:16:15Z",
"DateReceived": "23-05-2019 12:16:15",
"Language": "en",
"Privilege": "call,all",
"SystemName": "ast007",
"KafkaPartitionId": 0,
"KafkaOffset": 0,
"_sequence": 1863,
"AdditionalAttributes": {
"Cause-txt": "Answered elsewhere",
"ApproxTimeStamp": "2019-05-23T12:16:16.625+00:00"
}
}
{code}
Again here, the Cause and Causetxt incorrectly reads 26/Answered Elsewhere, which is not true. This call was not answered, it was rejected and should read 19/User alerting, no answer. If the c argument isn't set, then this event correctly reads cause 19.
*486 Busy Here*
Same story as the previous two cases, with the addition that the DialEnd events are also getting inadvertently altered. When the c argument is set, the DialEnd event looks as follows:
{code}
{
"Event": "DialEnd",
"Channel": "PJSIP/registrar-000000e8",
"ChannelState": 4,
"ChannelStateDesc": "Ring",
"CallerIDNum": "jonas1",
"CallerIDName": "jonas1",
"ConnectedLineNum": "jonas2",
"ConnectedLineName": "<unknown>",
"AccountCode": "",
"Context": "dial",
"Exten": "jonas2",
"Priority": "2",
"DestChannel": "PJSIP/registrar-000000e9",
"DestChannelState": 5,
"DestChannelStateDesc": "Ringing",
"DestCallerIDNum": "jonas2",
"DestCallerIDName": "<unknown>",
"DestConnectedLineNum": "jonas1",
"DestConnectedLineName": "jonas1",
"DestAccountCode": "",
"DestContext": "dial",
"DestExten": "jonas2",
"DestPriority": "1",
"DestUniqueid": "ast007-1558613944.427",
"DialStatus": "NOANSWER",
"Forward": null,
"Linkedid": "ast007-1558613944.426",
"DestLinkedid": "ast007-1558613944.426",
"Uniqueid": "ast007-1558613944.426",
"UtcDate": "2019-05-23T12:19:06Z",
"DateReceived": "23-05-2019 12:19:06",
"Language": "en",
"Privilege": "call,all",
"SystemName": "ast007",
"KafkaPartitionId": 0,
"KafkaOffset": 0,
"_sequence": 1889,
"AdditionalAttributes": {
"DestLanguage": "en",
"ApproxTimeStamp": "2019-05-23T12:19:07.609+00:00"
}
}
{code}
The DialStatus field should read "BUSY" in this case, which it also does if the c argument isn't passed.
For good measure, this is how the Hangup event looks:
{code}
{
"Event": "Hangup",
"Channel": "PJSIP/registrar-000000e9",
"ChannelState": 5,
"ChannelStateDesc": "Ringing",
"CallerIDNum": "jonas2",
"CallerIDName": "<unknown>",
"ConnectedLineNum": "jonas1",
"ConnectedLineName": "jonas1",
"AccountCode": "",
"Context": "dial",
"Exten": "jonas2",
"Priority": "1",
"Cause": 26,
"Causetxt": "Answered elsewhere",
"Linkedid": "ast007-1558613944.426",
"Uniqueid": "ast007-1558613944.427",
"UtcDate": "2019-05-23T12:19:06Z",
"DateReceived": "23-05-2019 12:19:06",
"Language": "en",
"Privilege": "call,all",
"SystemName": "ast007",
"KafkaPartitionId": 0,
"KafkaOffset": 0,
"_sequence": 1890,
"AdditionalAttributes": {
"Cause-txt": "Answered elsewhere",
"ApproxTimeStamp": "2019-05-23T12:19:07.609+00:00"
}
}
{code}
It also reads 26/Answered elsewhere, which should I believe should be 17/User busy, which it indeed is if the c argument isn't passed to app_dial
*Why is this a problem?*
Because the Hangup and DialEnd events become completely identical, it becomes impossible, or at least extremely difficult and unreliable to distingush between if a call was indeed Answered Elsewhere, the user wasn't registered, rejected the call or was DND, when the c argument is passed to app_dial.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list