[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] capture the time before Answer of call in dialplan
From:       Ludovic Gasc <gmludo () gmail ! com>
Date:       2015-05-19 16:22:55
Message-ID: CAON-fpFgbP+Tw=bz5UyVEk46e-pBYs_FQg6zgUdziCucXV+N1g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


You can follow AMI events with linkedid. you have a newchannel event for
that.

Ludovic Gasc (GMLudo)
http://www.gmludo.eu/
On 18 May 2015 08:09, "Muteesa Fred" <fred.muteesa@infocom.ug> wrote:

> Thanks Ludovic,
>
> I have tried the AMI,
>
> But I only see the variables I need after the call has ended. Look below.
> I want to capture AnswerTime, and Starttime as soon as the call has been
> answered.
>
>
>
>
>
> Event: Cdr
>
> Privilege: cdr,all
>
> AccountCode:
>
> Source: asterisk
>
> Destination: 123456
>
> DestinationContext: from_talklite
>
> CallerID: "asterisk" <asterisk>
>
> Channel: SIP/sip_virtual-00000001
>
> DestinationChannel:
>
> LastApplication: Playback
>
> LastData: custom/0414-holdmusic6
>
> StartTime: 2015-05-18 08:48:59
>
> AnswerTime: 2015-05-18 08:49:04
>
> EndTime: 2015-05-18 08:49:25
>
> Duration: 26
>
> BillableSeconds: 21
>
> Disposition: ANSWERED
>
> AMAFlags: DOCUMENTATION
>
> UniqueID: 1431928139.2
>
> UserField:
>
>
>
>
>
> Thanks and regards,
>
> Fred
>
>
>
> *From:* asterisk-dev-bounces@lists.digium.com [mailto:
> asterisk-dev-bounces@lists.digium.com] *On Behalf Of *Ludovic Gasc
> *Sent:* Friday, May 15, 2015 1:37 PM
> *To:* Asterisk Developers Mailing List
> *Subject:* Re: [asterisk-dev] capture the time before Answer of call in
> dialplan
>
>
>
> Hi,
>
> I've no idea to do that with pure dialplan, however you can do that via a
> daemon that talks AMI protocol, I already do that. Via AGI/FastAGI it may
> be possible, I'm not really sure. ARI should also usable for this use case,
> never tested yet.
>
> For the AMI daemon, you can use the programming language you want,
> Personally, I use Python for that.
>
> BTW, I recommend you to use an external daemon instead of to write a C
> module because if your business logic crashes, it's less grave outside of
> Asterisk instead of inside, it should crash all of your telephony.
>
> However, apparently it's possible via dialplan, it's better to use that
> with an external daemon.
>
> Regards.
>
> Ludovic Gasc (GMLudo)
> http://www.gmludo.eu/
>
> Hello Everyone,
>
> I apologise this might look like a user mailing list question but it's more
> of a developers question. I think this is the only forum that can help me.
>
> I have spent a week trying to achieve this. I realize I might have to write
> a C or PERL extension to achieve it but I don't know where to start. Or
> might need to rebuild the dial funtion.
> Objective:
> I want to dial a number in asterisk via a sip-trunk, and when the other
> party answers the call, I want to test if the call was answered before 5
> seconds, or after 5 seconds.
> If it was answered in less than 5 seconds I want to cancel the call,
> otherwise the call should continue.
>
> Your guidance will highly be appreciated.
>
> Regards,
> Fred Muteesa
>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>

[Attachment #5 (text/html)]

<p dir="ltr">You can follow AMI events with linkedid. you have a newchannel event for \
that.</p> <p dir="ltr">Ludovic Gasc (GMLudo)<br>
<a href="http://www.gmludo.eu/">http://www.gmludo.eu/</a></p>
<div class="gmail_quote">On 18 May 2015 08:09, &quot;Muteesa Fred&quot; &lt;<a \
href="mailto:fred.muteesa@infocom.ug">fred.muteesa@infocom.ug</a>&gt; wrote:<br \
type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" \
vlink="purple"><div><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Thanks \
Ludovic,<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I \
have tried the AMI,<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">But \
I only see the variables I need after the call has ended. Look below. I want to \
capture AnswerTime, and Starttime as soon as the call has been \
answered.<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Event: \
Cdr<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Privilege: \
cdr,all<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">AccountCode:<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Source: \
asterisk<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Destination: \
123456<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">DestinationContext: \
from_talklite<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">CallerID: \
&quot;asterisk&quot; &lt;asterisk&gt;<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Channel: \
SIP/sip_virtual-00000001<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">DestinationChannel:<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">LastApplication: \
Playback<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">LastData: \
custom/0414-holdmusic6<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">StartTime: \
2015-05-18 08:48:59<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">AnswerTime: \
2015-05-18 08:49:04<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">EndTime: \
2015-05-18 08:49:25<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Duration: \
26<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">BillableSeconds: \
21<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Disposition: \
ANSWERED<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">AMAFlags: \
DOCUMENTATION<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">UniqueID: \
1431928139.2<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">UserField:<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Thanks \
and regards,<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Fred<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><b><span lang="EN-US" \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span \
lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> \
<a href="mailto:asterisk-dev-bounces@lists.digium.com" \
target="_blank">asterisk-dev-bounces@lists.digium.com</a> [mailto:<a \
href="mailto:asterisk-dev-bounces@lists.digium.com" \
target="_blank">asterisk-dev-bounces@lists.digium.com</a>] <b>On Behalf Of \
</b>Ludovic Gasc<br><b>Sent:</b> Friday, May 15, 2015 1:37 PM<br><b>To:</b> Asterisk \
Developers Mailing List<br><b>Subject:</b> Re: [asterisk-dev] capture the time before \
Answer of call in dialplan<u></u><u></u></span></p><p class="MsoNormal"><u></u>  \
<u></u></p><p>Hi,<u></u><u></u></p><p>I&#39;ve no idea to do that with pure dialplan, \
however you can do that via a daemon that talks AMI protocol, I already do that. Via \
AGI/FastAGI it may be possible, I&#39;m not really sure. ARI should also usable for \
this use case, never tested yet.<u></u><u></u></p><p>For the AMI daemon, you can use \
the programming language you want, Personally, I use Python for \
that.<u></u><u></u></p><p>BTW, I recommend you to use an external daemon instead of \
to write a C module because if your business logic crashes, it&#39;s less grave \
outside of Asterisk instead of inside, it should crash all of your \
telephony.<u></u><u></u></p><p>However, apparently it&#39;s possible via dialplan, \
it&#39;s better to use that with an external daemon.<u></u><u></u></p><p>Regards. \
<u></u><u></u></p><p>Ludovic Gasc (GMLudo)<br><a href="http://www.gmludo.eu/" \
target="_blank">http://www.gmludo.eu/</a><u></u><u></u></p><div \
style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in \
6.0pt;margin-left:4.8pt"><p class="MsoNormal">Hello Everyone,<br><br>I apologise this \
might look like a user mailing list question but it&#39;s more<br>of a developers \
question. I think this is the only forum that can help me.<br><br>I have spent a week \
trying to achieve this. I realize I might have to write<br>a C or PERL extension to \
achieve it but I don&#39;t know where to start. Or<br>might need to rebuild the dial \
funtion.<br>Objective:<br>I want to dial a number in asterisk via a sip-trunk, and \
when the other<br>party answers the call, I want to test if the call was answered \
before 5<br>seconds, or after 5 seconds.<br>If it was answered in less than 5 seconds \
I want to cancel the call,<br>otherwise the call should continue.<br><br>Your \
guidance will highly be appreciated.<br><br>Regards,<br>Fred \
Muteesa<br><br><br><br>--<br>_____________________________________________________________________<br>-- \
Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" \
target="_blank">http://www.api-digital.com</a> --<br><br>asterisk-dev mailing \
list<br>To UNSUBSCRIBE or update options visit:<br>     <a \
href="http://lists.digium.com/mailman/listinfo/asterisk-dev" \
target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><u></u><u></u></p></div></div></div><br>--<br>
 _____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" \
target="_blank">http://www.api-digital.com</a> --<br> <br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
     <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" \
target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div>




-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic