[asterisk-users] Controlling calls

Adil Zaaraoui adilzeaaraoui at yahoo.fr
Mon Jun 7 09:59:55 CDT 2010


Hello,

thanks for your help and you time,

I tried your statement in my extension like this:
  exten = 777,n,                  set(TIMEOUT(absolute)=10)
  exten = 777,n,                  dial(iax2/400)
  exten = 777,n,                  hangup()

If peer (400) answers the call the call persists, no autohangup is made after 10 senconds (absolute timeout), but the if peer does not hangup, it rings for 10 seconds and stops.

"Are you saying that when you execute the dial application from your AGI 
Asterisk dials the peer and when peer answers they get dead air for 13 
seconds before being bridged with the caller?"

No, the communication is up we hear each other, but the satament System.out.println("after dial app") which is just after exec("dial.... is executed after about 13 seconds, and sometimes not, the dial blocks the script to continue.


How to set the channel variable in the AGI script??

Many thanks


 



________________________________
De : Steve Edwards <asterisk.org at sedwards.com>
À : Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Envoyé le : Lun 7 juin 2010, 0h 37min 36s
Objet : Re: [asterisk-users] Re : Controlling calls

On Sat, 5 Jun 2010, Adil Zaaraoui wrote:

> I want to write an AGI script doing this:
>
> 1-user call a number.
> 2-asterisk call the agi script
> 3-the script dial the peer
> 4-if the call is answered, let the call up for 1min
> 5-then the script hangs up the channel.

On Sun, 6 Jun 2010, Steve Edwards wrote:

> Can you lookup the peer and the remaining minutes in your AGI, set these 
> values in channel variables and then set the timeout and dial your peer 
> in your dialplan?

On Sun, 6 Jun 2010, Adil Zaaraoui wrote:

> Yes i can get the user remaining minutes from my database, the scrips 
> runs; but when i run exec("Dial","IAX2/400") then geting the 
> channelStatus if is answer it does not hangup using either 
> getChannel().hangup() or just hangup().
>
> note: when running Dial from my script, it blocks for a period about 
> 13seconds then the program continue to the next statment.

Are you saying that when you execute the dial application from your AGI 
Asterisk dials the peer and when peer answers they get dead air for 13 
seconds before being bridged with the caller?

> I think you get what i want to achieve. dialing from the script, if the 
> channel is answered, set a timer, if the caller consumed his minutes, 
> from the script i hangup.

Did you try setting channel variables in your AGI and then doing an 
absolute timeout and the dial command in the dialplan? What happened?

What happens if you try something like this:

        exten = 777,n,                  set(TIMEOUT(absolute)=30)
        exten = 777,n,                  dial(iax2/400)
        exten = 777,n,                  hangup()

What is supposed to happen if the call is not answered?

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

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



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100607/92390a61/attachment.htm 


More information about the asterisk-users mailing list