Asterisk 16.23.0 strange issue where Answer request succeeds and able to perform actions but Asterisk never sent 200 OK to answer call

Dan Cropp <[email protected]> Thu, 7 Sep 2023 17:30:16 +0000
Newsgroups gmane.comp.telephony.pbx.asterisk.user
Message-ID <DM6PR13MB3116A4013757DC4BA76A2AA2D2EEA@DM6PR13MB3116.namprd13.prod.outlook.com>
--===============8666716612555035753==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DM6PR13MB3116A4013757DC4BA76A2AA2D2EEADM6PR13MB3116namp_"

--_000_DM6PR13MB3116A4013757DC4BA76A2AA2D2EEADM6PR13MB3116namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Some background...
We use AMI and AsyncAGI to be able to receive events about calls (and other=
 Asterisk details) and control it from our application.
Works great and have about 100 sites (some newer, some older) without issue=
s.


I was notified this morning about a customer who had something strange happ=
en and I can't explain it.

Asterisk 16.23.0 and PJSIP.

Call comes into Asterisk.
Asterisk sends the Trying.
Via AMI, notified of the call and dial plan has it go to AsyncAGI for our a=
pplication to be able to control the call.
Via AMI, we tell Asterisk to Answer.
Asterisk processes it and indicates it was answered.
The Asterisk AMI/AGI indicates call was answered successfully, call state i=
s Up, etc.
Everything appears to be normal.
We perform various actions on the call, example play a file, music, tones, =
etc.

However, Asterisk never sent the 200 OK to answer the call.
Seems as though Asterisk is in a bizarre state where it thinks it is handli=
ng the call, but it really isn't.


Reports are this happened to several calls.

Eventually, they restarted the entire VM and everything started working wel=
l.


We think this may be caused by something their switch is doing.
Through the grapevine, heard they had some network issue but don't know the=
 details of their switches and architecture for calls coming into Asterisk.

We noticed we are seeing two INVITEs happen with the same Call-ID, but 2 ad=
ditional Record-Route header/value pairs and 3 additional Via header/value =
pairs.  At least in first glance, the rest seems to be the same.  I see Ast=
erisk created two different PJSIP calls for each despite same Call-ID, but =
I am guessing that's because of the additional Via or Record-Route pairs.

Is it possible multiple of these double INVITEs could cause Asterisk or PJS=
IP on this older software to get into a bad state to cause the issues with =
AMI and Asterisk state?

Dan

--_000_DM6PR13MB3116A4013757DC4BA76A2AA2D2EEADM6PR13MB3116namp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-ligatures:standardcontextual;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Some background&#8230;<o:p></o:p></p>
<p class=3D"MsoNormal">We use AMI and AsyncAGI to be able to receive events=
 about calls (and other Asterisk details) and control it from our applicati=
on.<o:p></o:p></p>
<p class=3D"MsoNormal">Works great and have about 100 sites (some newer, so=
me older) without issues.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I was notified this morning about a customer who had=
 something strange happen and I can&#8217;t explain it.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Asterisk 16.23.0 and PJSIP.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Call comes into Asterisk.<o:p></o:p></p>
<p class=3D"MsoNormal">Asterisk sends the Trying.<o:p></o:p></p>
<p class=3D"MsoNormal">Via AMI, notified of the call and dial plan has it g=
o to AsyncAGI for our application to be able to control the call.<o:p></o:p=
></p>
<p class=3D"MsoNormal">Via AMI, we tell Asterisk to Answer.<o:p></o:p></p>
<p class=3D"MsoNormal">Asterisk processes it and indicates it was answered.=
<o:p></o:p></p>
<p class=3D"MsoNormal">The Asterisk AMI/AGI indicates call was answered suc=
cessfully, call state is Up, etc.<o:p></o:p></p>
<p class=3D"MsoNormal">Everything appears to be normal.<o:p></o:p></p>
<p class=3D"MsoNormal">We perform various actions on the call, example play=
 a file, music, tones, etc.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">However, Asterisk never sent the 200 OK to answer th=
e call.<o:p></o:p></p>
<p class=3D"MsoNormal">Seems as though Asterisk is in a bizarre state where=
 it thinks it is handling the call, but it really isn&#8217;t.&nbsp;
<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Reports are this happened to several calls.<o:p></o:=
p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Eventually, they restarted the entire VM and everyth=
ing started working well.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">We think this may be caused by something their switc=
h is doing.<o:p></o:p></p>
<p class=3D"MsoNormal">Through the grapevine, heard they had some network i=
ssue but don&#8217;t know the details of their switches and architecture fo=
r calls coming into Asterisk.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">We noticed we are seeing two INVITEs happen with the=
 same Call-ID, but 2 additional Record-Route header/value pairs and 3 addit=
ional Via header/value pairs.&nbsp; At least in first glance, the rest seem=
s to be the same.&nbsp; I see Asterisk created
 two different PJSIP calls for each despite same Call-ID, but I am guessing=
 that&#8217;s because of the additional Via or Record-Route pairs.<o:p></o:=
p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Is it possible multiple of these double INVITEs coul=
d cause Asterisk or PJSIP on this older software to get into a bad state to=
 cause the issues with AMI and Asterisk state?<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Dan<o:p></o:p></p>
</div>
</body>
</html>

--_000_DM6PR13MB3116A4013757DC4BA76A2AA2D2EEADM6PR13MB3116namp_--


--===============8666716612555035753==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

LS0gCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fXwotLSBCYW5kd2lkdGggYW5kIENvbG9jYXRpb24gUHJvdmlkZWQgYnkg
aHR0cDovL3d3dy5hcGktZGlnaXRhbC5jb20gLS0KCkNoZWNrIG91dCB0aGUgbmV3IEFzdGVyaXNr
IGNvbW11bml0eSBmb3J1bSBhdDogaHR0cHM6Ly9jb21tdW5pdHkuYXN0ZXJpc2sub3JnLwoKTmV3
IHRvIEFzdGVyaXNrPyBTdGFydCBoZXJlOgogICAgICBodHRwczovL3dpa2kuYXN0ZXJpc2sub3Jn
L3dpa2kvZGlzcGxheS9BU1QvR2V0dGluZytTdGFydGVkCgphc3Rlcmlzay11c2VycyBtYWlsaW5n
IGxpc3QKVG8gVU5TVUJTQ1JJQkUgb3IgdXBkYXRlIG9wdGlvbnMgdmlzaXQ6CiAgIGh0dHA6Ly9s
aXN0cy5kaWdpdW0uY29tL21haWxtYW4vbGlzdGluZm8vYXN0ZXJpc2stdXNlcnM=

--===============8666716612555035753==--