<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">hello,<div class=""><br class=""></div><div class="">thanks Kevin, I use ast_check_hangup(chan_peer) and I can get the user CANCEL. </div><div class=""><br class=""></div><div class="">for now my APP work ok, I’ll test in production. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 30 Jan 2020, at 16:04, <a href="mailto:info@magnussolution.com" class="">info@magnussolution.com</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Kevin, thanks for your help<div class=""><br class=""></div><div class="">I’ll to try your recommendation and send you the feedback.</div><div class=""><br class=""></div><div class="">There is any existent method to execute AMD on the 183? </div><div class=""><br class=""></div><div class="">best regards</div><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 30 Jan 2020, at 14:21, Kevin Harwell <<a href="mailto:kharwell@digium.com" class="">kharwell@digium.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Wed, Jan 29, 2020 at 3:07 PM<span class="Apple-converted-space"> </span><a href="mailto:info@magnussolution.com" class="">info@magnussolution.com</a><span class="Apple-converted-space"> </span><<a href="mailto:info@magnussolution.com" class="">info@magnussolution.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Hello<br class=""><br class="">I’m to try execute AMD on the 183 signalisation, to detect audio on early media.<br class=""><br class=""><br class="">I’m work in  app_dial.c and it work ok when the audio start on the beginner, but when keep ringing I need to continue analyse until receive the 200 OK or some error. I already do it<br class=""><br class="">but, always there a but, when the call is canceled I need to stop the whatfor() method.<br class=""><br class=""><br class="">while ((res = ast_waitfor(chan, 2 * maxWaitTimeForFrame)) > -1) {<br class="">       <span class="Apple-converted-space"> </span>//here is where I analise the 183<span class="Apple-converted-space"> </span><br class=""><br class="">       <span class="Apple-converted-space"> </span>/* this code check the chan status to break the while()*/<br class="">       <span class="Apple-converted-space"> </span>if (ast_channel_state(chan) != 5) {<span class="Apple-converted-space"> </span><br class="">                 ast_verb(1,"status channel answere %d \n",ast_channel_state(chan));<br class="">                 ast_frfree(f);<span class="Apple-converted-space"> </span><br class="">               <span class="Apple-converted-space"> </span>break;<span class="Apple-converted-space"> </span><br class="">         }<br class=""><br class="">}<br class=""><br class=""><br class="">there are any method to check if the originate channel CANCEL the call?<br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">Looking through the app_dial code it looks like the peerflags gets set upon hangup. If you can get access to that (not sure where your code is located) then you should be able to check the OPT_CALLER_HANGUP value for that.</div><div class=""><br class=""></div><div class="">Another alternative maybe is the hangupcause as it gets set on the channel too when hung up so you might be able to retrieve that and check it for some value, but not sure if the causes will give you what you need.</div><div class=""><br class=""></div><div class="">A third way is to check if the channel hung up using the "ast_check_hangup" or "ast_check_hangup_locked" function (maybe the best option?).</div></div><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class="">Kevin Harwell<div class="">Senior Software Developer</div><div class="">Sangoma Technologies<br class=""><div class="">Check us out at: <a href="https://sangoma.com/" target="_blank" class="">https://sangoma.com</a> &<span class="Apple-converted-space"> </span><a href="https://asterisk.org/" target="_blank" class="">https://asterisk.org</a></div></div></div></div></div></div></div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_____________________________________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">-- Bandwidth and Colocation Provided by<span class="Apple-converted-space"> </span></span><a href="http://www.api-digital.com/" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://www.api-digital.com</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>--</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">asterisk-dev mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">To UNSUBSCRIBE or update options visit:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">  </span><a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>