Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] How to Hangup after DIAL is completed


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
tony at softins.clara....
Guest





PostPosted: Wed Apr 02, 2008 3:39 am    Post subject: [asterisk-users] How to Hangup after DIAL is completed Reply with quote

In article <7aa8bd9d0804020003r6f9b9417v87fa93209d883166 at mail.gmail.com>,
Pete Kay <petedao at gmail.com> wrote:
Quote:
I have a problem with DIAL.
The scenario is this:

1. Asterisk will dial a number in a call list
2. called party picks up the call and hears a prompt asking if they want to
pick up ( this is done through M(marco) option in DIAL)
3. if called party does not want to pick up, go to the next number (this is
done through SET MARCO_RESULT= CONTINUE)
4. if called party decides to take the call, make some conversion, then the
call is completed and hanged up by the called party.

For 4, when the called party hangs up, I want to hang up on the calling
party as well.

This works if I use the dialplan by not including the "g" option in DIAL.
However, when I do the DIAL in AGI, the calling party does not get hangup
automatically at (4). So, it continues to execute the next line in the AGI,
which is not what I want.

The problem is that the result I can when executing the DIAL command within
AGI does not tell me whether the call was picked up or not. So, I have no
way of knowing whether to continue executing the AGI program or to issue a
HAGNGUP explicitly.

When you have returned from the Dial command, check the DIALSTATUS channel
variable. If the call was picked up, ${DIALSTATUS} will contain ANSWER.

Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
Back to top
petedao at gmail.com
Guest





PostPosted: Wed Apr 02, 2008 5:28 am    Post subject: [asterisk-users] How to Hangup after DIAL is completed Reply with quote

Dear Tony,

Thank you very much for your suggestion.
The thing is that ${DIALSTATUS} returns ANSWER regardless of whether the
called party hangs up or not.
For instance, when called party is being asked by Asterisk whether he/she
wants to pick the call, ${DIALSTATUS} returns ANSWER.

In the case where the called party accepts to take the call and then hangs
up after finishing the conversion, I want to stop AGI from jumping to call
the next number. On the other hand, if the called party decides not to take
the call, I want to let AGI to jump to the next number.

It seems like ${DIALSTATUS} does not give me the info that I need.

Thank you very much. Is there any other ways you may think of?

Thanks,
Pete
On Wed, Apr 2, 2008 at 3:03 PM, Pete Kay <petedao at gmail.com> wrote:

Quote:
Hi,

I have a problem with DIAL.
The scenario is this:

1. Asterisk will dial a number in a call list
2. called party picks up the call and hears a prompt asking if they want
to pick up ( this is done through M(marco) option in DIAL)
3. if called party does not want to pick up, go to the next number (this
is done through SET MARCO_RESULT= CONTINUE)
4. if called party decides to take the call, make some conversion, then
the call is completed and hanged up by the called party.

For 4, when the called party hangs up, I want to hang up on the calling
party as well.

This works if I use the dialplan by not including the "g" option in DIAL.
However, when I do the DIAL in AGI, the calling party does not get hangup
automatically at (4). So, it continues to execute the next line in the AGI,
which is not what I want.

The problem is that the result I can when executing the DIAL command
within AGI does not tell me whether the call was picked up or not. So, I
have no way of knowing whether to continue executing the AGI program or to
issue a HAGNGUP explicitly.

Can anyone please help me ?

Any suggestion will be greatly appreciated.

Thanks,
Pete
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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




On Wed, Apr 2, 2008 at 4:39 PM, Tony Mountifield <tony at softins.clara.co.uk>
wrote:

Quote:
In article <7aa8bd9d0804020003r6f9b9417v87fa93209d883166 at mail.gmail.com>,
Pete Kay <petedao at gmail.com> wrote:
Quote:
I have a problem with DIAL.
The scenario is this:

1. Asterisk will dial a number in a call list
2. called party picks up the call and hears a prompt asking if they want
to
Quote:
pick up ( this is done through M(marco) option in DIAL)
3. if called party does not want to pick up, go to the next number (this
is
Quote:
done through SET MARCO_RESULT= CONTINUE)
4. if called party decides to take the call, make some conversion, then
the
Quote:
call is completed and hanged up by the called party.

For 4, when the called party hangs up, I want to hang up on the calling
party as well.

This works if I use the dialplan by not including the "g" option in
DIAL.
Quote:
However, when I do the DIAL in AGI, the calling party does not get
hangup
Quote:
automatically at (4). So, it continues to execute the next line in the
AGI,
Quote:
which is not what I want.

The problem is that the result I can when executing the DIAL command
within
Quote:
AGI does not tell me whether the call was picked up or not. So, I have
no
Quote:
way of knowing whether to continue executing the AGI program or to issue
a
Quote:
HAGNGUP explicitly.

When you have returned from the Dial command, check the DIALSTATUS channel
variable. If the call was picked up, ${DIALSTATUS} will contain ANSWER.

Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

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

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/20080402/2a6b716b/attachment-0001.htm
Back to top
tony at softins.clara....
Guest





PostPosted: Wed Apr 02, 2008 9:14 am    Post subject: [asterisk-users] How to Hangup after DIAL is completed Reply with quote

In article <7aa8bd9d0804020328y4c81cfbbud03dda647e4c0929 at mail.gmail.com>,
Pete Kay <petedao at gmail.com> wrote:
Quote:

Dear Tony,

Thank you very much for your suggestion.
The thing is that ${DIALSTATUS} returns ANSWER regardless of whether the
called party hangs up or not.
For instance, when called party is being asked by Asterisk whether he/she
wants to pick the call, ${DIALSTATUS} returns ANSWER.

In the case where the called party accepts to take the call and then hangs
up after finishing the conversion, I want to stop AGI from jumping to call
the next number. On the other hand, if the called party decides not to take
the call, I want to let AGI to jump to the next number.

It seems like ${DIALSTATUS} does not give me the info that I need.

Ah, I see. It's not just whether the call was answered, but you want what
happens on the called channel to govern future behaviour on the calling
channel.

Quote:
Thank you very much. Is there any other ways you may think of?

The only way I can think of to do that is by using the Asterisk database
as a communication mechanism, combined with channel variable inheritance.

Before calling Dial, generate a unique key. This can be based on ${UNIQUEID}
for example. Store this in a variable with inheritance to dependent
channels (invoked by adding a leading underscore): e.g.

Set(_KEY=${UNIQUEID})
or in AGI
SET VARIABLE _KEY "${UNIQUEID}"

Then write an entry to the Asterisk database with a suitable family, this key
and an arbitrary value:

Set(DB(dial/${KEY})=0)
or in AGI
SET VARIABLE DB(dial/${KEY}) "0"

In the answer macro, you should be able to read ${KEY} (due to inheritance),
and if the user accepts the call, you delete the database entry:

NoOp(${DB_DELETE(dial/${KEY})})

In the calling channel, on return from the Dial, you check to see if the entry
still exists. If it does, then either the call was not answered, or else it
was answered and not accepted. You can then either try another dial (using the
same DB entry) or give up and delete the entry at that point.

Deleting the entry in AGI would be (I think):

GET FULL VARIABLE DB_DELETE(dial/${KEY})

Or you could do GET VARIABLE if you substituted the value of ${KEY} yourself.

Quote:
Thanks,
Pete

Hope this helps (and that it works!)

Cheers
Tony

Quote:
On Wed, Apr 2, 2008 at 3:03 PM, Pete Kay <petedao at gmail.com> wrote:

Quote:
Hi,

I have a problem with DIAL.
The scenario is this:

1. Asterisk will dial a number in a call list
2. called party picks up the call and hears a prompt asking if they want
to pick up ( this is done through M(marco) option in DIAL)
3. if called party does not want to pick up, go to the next number (this
is done through SET MARCO_RESULT= CONTINUE)
4. if called party decides to take the call, make some conversion, then
the call is completed and hanged up by the called party.

For 4, when the called party hangs up, I want to hang up on the calling
party as well.

This works if I use the dialplan by not including the "g" option in DIAL.
However, when I do the DIAL in AGI, the calling party does not get hangup
automatically at (4). So, it continues to execute the next line in the AGI,
which is not what I want.

The problem is that the result I can when executing the DIAL command
within AGI does not tell me whether the call was picked up or not. So, I
have no way of knowing whether to continue executing the AGI program or to
issue a HAGNGUP explicitly.

Can anyone please help me ?

Any suggestion will be greatly appreciated.

Thanks,
Pete
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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




On Wed, Apr 2, 2008 at 4:39 PM, Tony Mountifield <tony at softins.clara.co.uk>
wrote:

Quote:
In article <7aa8bd9d0804020003r6f9b9417v87fa93209d883166 at mail.gmail.com>,
Pete Kay <petedao at gmail.com> wrote:
Quote:
I have a problem with DIAL.
The scenario is this:

1. Asterisk will dial a number in a call list
2. called party picks up the call and hears a prompt asking if they want
to
Quote:
pick up ( this is done through M(marco) option in DIAL)
3. if called party does not want to pick up, go to the next number (this
is
Quote:
done through SET MARCO_RESULT= CONTINUE)
4. if called party decides to take the call, make some conversion, then
the
Quote:
call is completed and hanged up by the called party.

For 4, when the called party hangs up, I want to hang up on the calling
party as well.

This works if I use the dialplan by not including the "g" option in
DIAL.
Quote:
However, when I do the DIAL in AGI, the calling party does not get
hangup
Quote:
automatically at (4). So, it continues to execute the next line in the
AGI,
Quote:
which is not what I want.

The problem is that the result I can when executing the DIAL command
within
Quote:
AGI does not tell me whether the call was picked up or not. So, I have
no
Quote:
way of knowing whether to continue executing the AGI program or to issue
a
Quote:
HAGNGUP explicitly.

When you have returned from the Dial command, check the DIALSTATUS channel
variable. If the call was picked up, ${DIALSTATUS} will contain ANSWER.

Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

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

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


-=-=-=-=-=-
[Alternative: text/html]
-=-=-=-=-=-
-=-=-=-=-=-

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

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-=-=-=-=-=-
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services