login | register
Fri 04 of Jul, 2008 [20:36 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Samuel, Thu 03 of Jul, 2008 [13:41 UTC]: ok thank you
  • Mats Karlsson, Thu 03 of Jul, 2008 [13:37 UTC]: Nice Samuel, will look forward to rad it.
  • bwl_fernstudent, Thu 03 of Jul, 2008 [09:08 UTC]: Your blog shows some usefull code
  • Samuel, Thu 03 of Jul, 2008 [08:04 UTC]: I'll translate it, for sure
  • Mats Karlsson, Wed 02 of Jul, 2008 [20:46 UTC]: LOL, in french! Translate it to English and I will read it.
  • Samuel, Wed 02 of Jul, 2008 [08:07 UTC]: Hello, i wrote a blog about Asterisk, speaking about installation,programming and more http://sambranche.blogspot.com/
  • Nick Barnes, Tue 01 of Jul, 2008 [17:46 UTC]: Steve - Asterisk doesn't 'fit into linux' - it's an application which runs on top of Linux.
  • Steve, Mon 30 of Jun, 2008 [18:07 UTC]: anyone know where I can find a block diagram of how asterisk fits into linux. my f'ing bosses want me to draw something up.. ugh.
  • akbar, Fri 27 of Jun, 2008 [10:37 UTC]: marley_boyz@yahoo.com how to configure call forward, call back, call pick up using TDM and asterisk 1.2.13... please help me.. thx...
  • Matthew Williams, Tue 24 of Jun, 2008 [22:37 UTC]: We are looking for Tier II VoIP Support Technicians in St Louis. Send resumes to mwilliams AT voxitas DOT com.
Server Stats
  • Execution time: 0.43s
  • Memory usage: 2.62MB
  • Database queries: 33
  • GZIP: Disabled
  • Server load: 0.99

Asterisk cmd Pickup

Pickup

Asterisk now comes with its own directed Pickup application, see bug 4865. This will conflict with the bristuff app_pickup. Therefore the current version of bristuff (0.3) changed the name of this application to DPickup.

Synopsis

 Pickup(extension[@context])

Description

This dialplan command allows you to pick up calls that are ringing a specific extension. The device which is ringing need not have callgroup or pickupgroup set, you just need to know the extension.
This application also allows you to specify partial extensions. For example, you have block 200 to 209 and you want to pick up any calls that my be ringing on those 10 phones, you just pickup 20 and it'll pick up the most recent ringing one. Another side effect is that you can pickup a call that a person might be making for an outbound call... rather cool :-)
An example for the dialplan is below, and installation can be accomplished by using astxs or manually modifying the Makefile.


New in Asterisk v1.4

If you use the special string "PICKUPMARK" for the context parameter, for example 10@PICKUPMARK, this application tries to find a channel which has defined a channel variable name PICKUPMARK with the same content as "extension".

So, if you a SET(GLOBAL(PICKUPMARK)=1234) in extension 123, the PickUp(1234@PICKUPMARK) will try to pick extension 123.

See bug/patch 5694:
Modified the Pickup application to accept multiple extensions pickup syntax,like

 Pickup(extension1&extension2&...)

For example,

 Pickup(601&602&603)

will try to pickup extension 601, 602, 603 sequentially, if one of them is in ringing state.

Example

 exten => _7.,1,Pickup(${EXTEN:1}@default)

 If phone with number 42 rings you can catch the call by dialing 742. You don't need to use the context, 
 exten => _7.,1,Pickup(${EXTEN:1}) works for all contexts.

Example using PICKUPMARK

 ; This configuration uses *8xxx to pickup extension xxx, so need to strip the first two digits of the extension
 exten => _*8.,1,SET(GLOBAL(PICKUPMARK)=${EXTEN:2})
 exten => _*8.,n,Pickup(${EXTEN:2}@PICKUPMARK)

Bristuff

Bristuff introduced its own Pickup application before Asterisk had its own (see Asterisk cmd BristuffPickup ). The Asterisk Pickup version is therefore renamed to DPickup in Bristuff >= 0.3.

Remark:

This command pickups up the dialed EXTENSION, not the ringing channel/device.
So when the dialplan says;

 200,1,Dial(SIP/100&SIP/101)

And someone calls extension 200
The call cannot be picked up by using Pickup(100@default) or Pickup(101@default)
But needs to be picked up using Pickup(200@default)

The context however is NOT mandatory

Multiple context pickup


If you have multiple contextes where calls are incomming,
for example external (for calls from outside) and internal (for internal calls),
you can use following pickup setup to get the pickup working:

 exten => _71XXX,1,Pickup(${EXTEN:2}@external)
 exten => _71XXX,2,Pickup(${EXTEN:2}@internal)

In the example above, you can pickup a caller from outside,
who is calling an extension (and going into the context external),
and also you can pickup a caller from internal call.

Troubleshooting


See also



Go back to Asterisk - documentation of application commands

Created by JustRumours, Last modification by Adam Luker on Fri 18 of Apr, 2008 [15:45 UTC]

Comments Filter

Pickup() return value?

by BT on Thursday 12 of July, 2007 [20:08:09 UTC]
Is there any kind of state that can be detected and acted upon if Pickup() fails? (i.e., the channel wasn't ringing) I've tried adding an n+101 priority, an i priority, and an n+1 priority, but none of them are ever reached.

Pickup bug has Mantis number ?

by Olivier on Tuesday 12 of September, 2006 [16:45:02 UTC]
Hi Roberto,
Is your bug referenced in Mantis ?

Pickup bug

by Roberto on Thursday 26 of January, 2006 [17:45:12 UTC]
Hy Henrik. I also tried to use the Pickup command and after strugglying a little bit in the source code. I found that is an error, please edit the app_directed_pickup.c and search for the following line:
===>>> if (target && (!target->pbx) && ((target->_state == AST_STATE_RINGING) || (target->_state == AST_STATE_RING))) {
Then replace the whole line with:
===>>> if (target && (!target->pbx)) {
I don't know why but the target->_state is always 0 causing the code ((target->_state == AST_STATE_RINGING) || (target->_state == AST_STATE_RING)) to always return 0 and never pickup the call.
And recompíle the Asterisk source.

Another comment, whe the command description says that it matches partial extensions this is not true. Searching in the code I saw that it uses the function: ast_get_channel_by_exten_locked and this function calls another function channel_find_locked(NULL, NULL, 0, context, exten), this parameters dictates that this function will match only by context and extension using the strcasecmp. The strcasecmp will return 0 only if the exact extension matches.

Please change your extensions.conf to:
exten => _*8.,1,Pickup(${EXTEN:2}@incoming)

And now dial *8xxxx (xxxx is the exact extension number that is ringing).

I hope this helps .

Re: Using Pickup extension

by Roberto on Thursday 05 of January, 2006 [17:39:14 UTC]
Please read my Pickup bug and try it. Thanks.

Using Pickup extension

by Henrik Østergaard on Sunday 09 of October, 2005 [18:59:43 UTC]
I'm trying to use the Pickup application using CVS HEAD:


exten => _*8XXX,1,Pickup(${EXTEN:2}1@incoming)


but I'm not able to pickup anything..:
   — Executing Pickup("OH323/sb...@192.168.2.5-ea9329af", 
"011@incoming") in new stack
 == Spawn extension (from-internal, *8011, 1) exited non-zero on 
'OH323/sb...@192.168.2.5-ea9329af'
   — Hungup 'OH323/sb...@192.168.2.5-ea9329af' 


The incomming call I try to pickup is on extension 011 calling 0111 on
a H323 device (using the OH323 driver). The H323 works otherwise fine,
in and outgoing, incl transfer.


I have tried both picking up extension 011 and 0111, with and without
the context incoming, which is the context the incoming call should be
in... No luck.


I'm running CVS HEAD of today on a Debian Sarge stable.


By the way, when I get it to work, how do I pick up a call when I dont
know the extension? Can I search possible extesions for one which
should be possible to pickup or can I use wildcards (_01.)?

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver