<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
snacktime wrote:<br>
<pre wrap=""><div class="moz-txt-sig">On 11/23/05, Bill Michaelson <a
class="moz-txt-link-rfc2396E" href="mailto:bill@cosi.com"><bill@cosi.com></a> wrote:
</div></pre>
<blockquote type="cite">
<pre wrap=""><span class="moz-txt-citetags">> </span>I'm working on a manager client that I designed to hold open TCP
<span class="moz-txt-citetags">> </span>connection to asterisk while it is running for varoius purposes. After
<span class="moz-txt-citetags">> </span>being puzzled by unexpected behavior, I realized that the server closes
<span class="moz-txt-citetags">> </span>the connection after it completes an "originate" action - or at least it
<span class="moz-txt-citetags">> </span>does in the case of my test transactions.
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>I solicit opinions: is this a feature or a bug?
</pre>
</blockquote>
<pre wrap=""><!---->
I've never seen that behavior and I've written several clients for the
manager api. I guess it's possible that a particular combination of
variables in the request could trigger an error that makes asterisk do
that. I would try issuing the same originate by telneting in
manually and see what happens. That way you can positively rule out
your client being the one that's disconnecting.
</pre>
to which I reply:<br>
<br>
That's the first thing I did, and it confirmed the behavior (see
below). To be precise, the disconnect occurs after the Newchannel
report. So I infer that you think it is inappropriate. I've recoded
the client so that it immediately reconnects. Anybody actually tried
this? I can imagine that the developer might have assumed that such a
request would likely come from a transient client, and that it would be
helpful to terminate the connection. But if so, I don't think it's the
right decision. Maybe it's just an oversight. Any other opinions?
I'm too lazy to read the server side code.<br>
<br>
<tt>bill@phex:~> telnet hack.cosi.com 5038<br>
Trying 192.168.10.26...<br>
Connected to hack.cosi.com.<br>
Escape character is '^]'.<br>
Asterisk Call Manager/1.0<br>
action: login<br>
username: bill<br>
secret: dontell<br>
<br>
Response: Success<br>
Message: Authentication accepted<br>
<br>
action: originate<br>
callerid: 0000000000<br>
context: default<br>
priority: 1<br>
exten: 212<br>
channel: Local/762<br>
<br>
Response: Success<br>
Message: Originate successfully queued<br>
<br>
Event: Newchannel<br>
Privilege: call,all<br>
Channel: Local/762@default-b315,2<br>
State: Ring<br>
CallerID: <unknown><br>
CallerIDName: <unknown><br>
Uniqueid: 1132773921.72<br>
<br>
Connection closed by foreign host.<br>
bill@phex:~> </tt><br>
</body>
</html>