[Asterisk-Users] executing an agi script after a successful Dial

Jeremy McNamara jj at indie.org
Wed Jul 23 16:12:30 MST 2003


You need to learn more about asterisk before trying to build a calling 
card system.   What you have described is not even close to being the 
right way.


Jeremy McNamara




Dan Fernandez wrote:

>I just want to run a script to calculate the cost of a call to a cell
>phone,long distance, etc. right after I execute a Dial app. and the call is
>complete.
>
>I gathered from your response that it would be possible to execute the dial
>from inside the agi but this is probably not the way to go.
>Aside from coding in c, or running a script with cron, what other
>alternatives are there?  Someone must have done something on this regard
>(calculating call costs)
>
>----- Original Message -----
>From: "Tilghman Lesher" <tilghman at mail.jeffandtilghman.com>
>To: <asterisk-users at lists.digium.com>
>Sent: Wednesday, July 23, 2003 7:18 PM
>Subject: Re: [Asterisk-Users] executing an agi script after a successful
>Dial
>
>
>  
>
>>On Wednesday 23 July 2003 05:04 pm, Dan Fernandez wrote:
>>    
>>
>>>I would like to run an agi script (to calculate the cost of a long
>>>distance or international call) right after I execute a Dial app.
>>>Can this be configured in extensions.conf? It seems the entries
>>>      
>>>
>>It cannot.  If the Dial app succeeds in getting a connected channel,
>>it will ALWAYS return -1, which signals a hangup to Asterisk.  The
>>only time Dial will ever return control to the dialplan is if either
>>the channel is not available or if the channel does not get connected.
>>
>>    
>>
>>>right after a Dial app get executed only if the Dial app was
>>>executed unsucessfully. Would I have to execute the dial app from
>>>the agi script?
>>>      
>>>
>>No, again, the Dial app won't return control to the AGI script until
>>after the call is complete.  You're pretty much going to have to do
>>whatever you want to do prior to executing Dial or after the call is
>>complete.  Of course, you could create a separate thread which
>>runs parallel to the channel thread and does various monitoring
>>tasks, but that would require some C programming skills.
>>
>>-Tilghman
>>
>>_______________________________________________
>>Asterisk-Users mailing list
>>Asterisk-Users at lists.digium.com
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>    
>>
>_______________________________________________
>Asterisk-Users mailing list
>Asterisk-Users at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-users
>  
>





More information about the asterisk-users mailing list