Manager: Pickup incoming call


#1

I’m trying to figure out the correct Manager action or command to use when an incoming call is coming in, to pick it up.

So incoming call from say 100->101, I make a manager action and 101 answers, and they are connected.

Any ideas?

Thanks!


#2

I suspect you are asking how you force a phone to go off hook. If that is the case, you need the management interface for the phone, not for Asterisk.


#3

If you can force a phone to call another (I’ve done it), it should be possible to have an extension perform the Answer() that the dial plan would do.

We had an old asterisk system way back when, where you could click a link on a website for a specific incoming call, and it’d ring your phone; when you picked up, you’d be on the line with the incoming caller.


#4

You need to describe what you are doing much more clearly.

Note that dialplans shouldn’t normally call Answer().

You are also confusing extensions and devices.

If SIP/abc calls extension 123, that can immediately ring SIP/def. If that is answered the call will be answered end to end.

Extension 123, could actually be a call Musiconhold(), with a long timeout. You could then redirect the call from SIP/abc to extension 456, using AMI. Extension 456 might call device SIP/def.

Extension 123 could be the Park application, and you could then use AMI to originate a cal from device SIP/def to the corresponding parking lot.

There are things you could do with the Pickup() application, etc., etc.


#5

[quote=“david55”]You need to describe what you are doing much more clearly.

…You could then redirect the call from SIP/abc to extension 456, using AMI. Extension 456 might call device SIP/def.
[/quote]

What about my question was not clear? I stated I want to use the manager (AMI) to pickup a specific incoming call.

Ok, if I could do this redirect method you speak of, how?


#6

The first thing that made it unclear was that you referred to pickup. Pickup has a specific meaning in Asterisk which requires three devices and one extension. You had two extensions, although the first pretty much had to be a device, and it wasn’t clear whether the second one was. You didn’t explicitly mention any devices, and, at most, it is only possible to infer the presence of two, but Pickup() needs three - the incoming channel device, its original destination and the device that is picking it up instead of its being answered by the original destination device.

To use redirect, when the incoming call is parked on a musiconhold application call:

Monitor the events to detect when the incoming call gets stuck on the musiconhold. Issue an AMI Redirect command that specifies the incoming channel and an extension which runs a Dial to the required destination device.


#7

[quote=“david55”]The first thing that made it unclear was that you referred to pickup. Pickup has a specific meaning in Asterisk which requires three devices and one extension. You had two extensions, although the first pretty much had to be a device, and it wasn’t clear whether the second one was. You didn’t explicitly mention any devices, and, at most, it is only possible to infer the presence of two, but Pickup() needs three - the incoming channel device, its original destination and the device that is picking it up instead of its being answered by the original destination device.

To use redirect, when the incoming call is parked on a musiconhold application call:

Monitor the events to detect when the incoming call gets stuck on the musiconhold. Issue an AMI Redirect command that specifies the incoming channel and an extension which runs a Dial to the required destination device.[/quote]

Thanks for the info. I’ll look into Redirect and get back to you.


#8

Looking at voip-info.org/wiki/view/Aste … n+Redirect

it says

Action: Redirect Channel: Zap/73-1 ExtraChannel: SIP/199testphone-1f3c Exten: 8600029 Context: default Priority: 1

What would I use for Channel? I have a very defaultish setup, I’m using normal classes, nothing custom really. Most of my stuff is under the [default] tag and my contexts are all “default”

Would I set ExtraChannel to “SIP/100” and Exten to “101”?


#9

I added a meetme to my extensions.conf:

[meetme] exten => h,1,Hangup exten => _X.,1,Answer exten => _X.,n,Wait(1) exten => _X.,n,MeetMe(${EXTEN}|1dFqAx) exten => _X.,n,Hangup

Not sure if this is how I should go about it. Also still unsure on my above post.


#10

Channel should be the channel for the incoming call, and for SIP will be of the form SIP/xxxxxx-yyyyyyyy. You need to get this from the AMI events.

Channel2 is not needed. It is used if you want to redirect both sides of a call, typically to the meetme application.

I still don’t think you have really explained what you want to do.


#11

[quote=“david55”]Channel should be the channel for the incoming call, and for SIP will be of the form SIP/xxxxxx-yyyyyyyy. You need to get this from the AMI events.

Channel2 is not needed. It is used if you want to redirect both sides of a call, typically to the meetme application.

I still don’t think you have really explained what you want to do.[/quote]

OK, re-edit. Here’s a better way to phrase it. If Ext 100 calls in, someone answers, they put him on hold. He’s now on hold. What AMI action/command could I use to have ext 101’s phone ring, and when he picks up, he’s connected to ext 100?


#12

Originate with the application being Bridge, and the data being the channel (instance) name of the channel to the device you call “Ext 100”. Note that the incoming call will not be from an extension, but from a device. 101 can be specified as an extension, by making the Channel parameter of the Originate be local/101@context, for a context which has that extension mapping to the right device. However, if you know the device address, you can use that directly.

However, you should look into the possibility of using Park rather than Hold. (For most purposes, a held call is still an answered and connected call.)


#13

[quote=“david55”]Originate with the application being Bridge, and the data being the channel (instance) name of the channel to the device you call “Ext 100”. Note that the incoming call will not be from an extension, but from a device. 101 can be specified as an extension, by making the Channel parameter of the Originate be local/101@context, for a context which has that extension mapping to the right device. However, if you know the device address, you can use that directly.

However, you should look into the possibility of using Park rather than Hold. (For most purposes, a held call is still an answered and connected call.)[/quote]

I was talking to some people in #asterisk, they recommended simply getting the Channel name from a “Status” action, and using “Redirect” to send them to a MOH extension. Then when ready, use “Redirect” again, to send that channel to ext 101. I’m playing with this idea right now.


#14

You would have needed to do that before the Bridge application was introduced. That is basically the process that I described up thread.

I almost included that as an alternative in my latest reply, but realised that it was more complex than the Bridge method.


#15

Actually, that version doesn’t work as it presumes the call to 101 will always succeed, whereas your requirement was to establish the call to 101 first.