1 like 0 dislike
466 views

How Can we execute a Agi script after hangup ,Actually i am using queue with local channel, I m trying with "h,1,AGI()".but it is executing two times after hangup but i want to execute it one time after hangup of both channels

asked Sep 15, 2014 in Computers & Internet by Mohit Mishra (30 points) | 466 views
    

2 Answers

0 like 0 dislike

You can simply do like this

exten => _X.,1,Answer
exten => _X.,2,Set(CDR(accountcode}=CODE123)
exten => _X.,3,Hangup()
exten => h,n,AGI(any.php,${UNIQUEID})

Or you can write your code here for further assistance..

Thanks..

answered Sep 15, 2014 by Sam (1,380 points)
Thanks for Reply..
Your dialplan is absolute fine for single number but i want to use it in queue as you know that if we used queue with local channels(outside mobile numbers) it takes two channel for a single call so. on the hangup two channels goes down then h extension is executing two times..but i want to execute it one time after hangup of both channel.
are you bridging the 2 calls?
yes i m bridging the incoming call to executives.
exten => _X.,1,Answer();
exten => _X.,2,Queue(test);
exten => _X.,3,Hangup();

[test]

member => local/XXXXXXXXXX@outgoing-extension;
member => local/YYYYYYYYYY@outgoing-extension;
so where r u writing ur AGI..in queues.conf?
Actually i want to send a  sms to caller and executive.So i want to execute AGI file after hangup..

   
exten => _X.,1,Answer();
exten => _X.,2,Queue(test);
exten => _X.,3,Hangup();

exten => h,1,AGI(abcd.php);
As what I am seeing in your Queue "test" you have defined member and I guess you cannot do bridging like this....
I can suggest you one thing as I have done the same thing you can do by callfile in asterisk..and send sms by AGI which will run only 1 time
Hello Sam,
Can you give me a example for it?

Thanks
0 like 0 dislike

I can suggest you one thing as I have done the same thing you can do by callfile in asterisk..and send sms by AGI which will run only 1 time

answered Sep 16, 2014 by Sam (1,380 points)
reshown Sep 16, 2014 by Sam
Sam,
Can you give me an example for it.

Thanks
I think callfile concept not suitable for my project.

thanks sam
the same concept I had already implemented with sms...and it will work..you need to create a callfile from PHP and other leg was generated in extensions.conf and after that call will bridge and you can call AGI for sending SMS...

Related questions

0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

Mathe Forum Schule und Studenten
1,164 questions
1,304 answers
275 comments
1,590 users