<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Let's see what I'm talking about:</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Phone<span style="mso-spacerun: yes"> </span>Asterisk<span style="mso-spacerun: yes">
</span>Outbound provider</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="mso-spacerun: yes"> </span>-------</span></font><font face="Wingdings" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-char-type: symbol; mso-symbol-font-family: Wingdings">
<span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">à</span></span></font><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="mso-spacerun: yes">
</span>------</span></font><font face="Wingdings" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-char-type: symbol; mso-symbol-font-family: Wingdings">
<span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">à</span></span></font><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="mso-spacerun: yes"> </span>Inbound channel<span style="mso-spacerun: yes">
</span>outbound channel</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In general let's call the inbound channel the channel between the originator(source) and asterisk and outbound channel the channel between asterisk and the destination.
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">My discussion will about when and why should a channel (inbound or outbound) be hanged up (terminated, killed, suspended, canceled call this process as you like).
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I want to present you the current state of this matter in asterisk 1.2 (and I belive so in 1.4).</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">When using the Dial application according to the options you are useing and the hangup reason you may get one of the results:
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">1) Outbound channel is canceled and inbound channel is active</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">2) Outbound channel is canceled and inbound channel is canceled too.</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The problem is when you wish to end in a certain case all the time and you can't control it.</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="mso-spacerun: yes"> </span>If you arrive sometimes, or all the time in case 1 you can simply put a hangup after that dial and problem is fixed. If you arrive in case 2 and still want to use it there is not to mutch to do, after the channel is hanged up you can't really play a message on it (belive me I've tried it
</span></font><font face="Wingdings" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-char-type: symbol; mso-symbol-font-family: Wingdings">
<span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings">J</span></span></font><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> ), and start . </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The next question you might ask yourself is when and how did I got in that situation so here it goes:</span></font>
</p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Answer</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Saynumber(1234)</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Dial(SIP/number@provider||S(20)g)</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Saynumber(4321)</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hangup</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">S option terminates the call x seconds after the called party picked up.</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">g </span></font><font face="Verdana" size="1"><span lang="HU" style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">When the called party hangs up, exit to execute more commands in the current context.
</span></font><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If the call is haned up by the called party the caller can hear the 4321, if the call times out (the called party didn't hang up in x seconds) the caller cannot hear the Saynumber(4321) giving a warning or notice depending on how is this application succession implemented.
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">A previous discussion on this manner can be found at <a title="blocked::http://bugs.digium.com/view.php?id=9888" href="http://bugs.digium.com/view.php?id=9888">
<font color="#800080">http://bugs.digium.com/view.php?id=9888</font></a> starting from post </span></font><span class="small2"><font face="Verdana" color="black" size="1"><span lang="HU" style="FONT-SIZE: 8pt; COLOR: black">
0064808</span></font></span><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> . If I'm not too clear in this email you may find additional details posted there.</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I used DeadAGI and AGI to run this sequence it is not this that is important, the bigger picture is.</span></font>
</p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So we got a case (others may have found other cases) where after a dial the inbound channel is no longer up, and there is no option to avoid this. In order to make asterisk better and suitable for a wider range of problems, and easyer to work with, we need to organise the cases when an inbound channel is hanged up, so that all the combinations of applications will work.
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I think if the following set of rules would be implemented, the problem mentioned above and many others would be solved.
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Verdana" color="black" size="2"><span lang="HU" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">Rule 1) The inbound channel can be hanged up only by the Hangup application or the hanging up event of the inbound party
<br><br>Rule 2) The outbound channel can be hanged up by:<br>-> Inbound party hanging up<br>-> Outbound party hanging up<br>-> A timeout option being set up -> Options L and S from app Dial<br><br>Rule 3) All aplications that work with channels can be categorized into:
<br>a) Applications working on the inbound channel: Playback, saynumber, getdigit Do not hang up any channel.<br>b) Applications for creating/mixing/tieing channels: Dial/conference/Queue<br>Hang up only the outbound channel that they might created.
<br><br>Rule 4) The functionality is not conditioned by the way the applications are being called: Dialplan(Realtime or not) or Agi (Deadagi)<br><br>Rule 5) Sip reinvites being sent out or not will not effect the hangup of inbound or outbound channels, they will be transparent
<br><br>Effect 1) An explicit hangup is required for each inbound call<br>Effect 2) After a dial the inbound channel can always be used (not being conditioned by the outbound channel hangup reason -> kind of logical asumption I think)
<br>Effect 3) Sip reinvites can be sent out in a greater number of cases, optimizeing the codec used and the RTP path of a call. Lower delay and less transcoding, better call quality and lower load on the server, better performace are just some of the reasons why.
</span></font><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">About the implementation I think that adding a parameter to the dial application that will force this behavior would solve it and be backwards compatible too.
</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Please give me your opinion on this, pointing out where I might be wrong.</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks</span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span lang="HU" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Gaspar Zoltan</span></font><span lang="HU" style="mso-no-proof: yes"></span></p>