[Home]

Summary:ASTERISK-10215: Application Pickup() "PICKUPMARK" string is not working!
Reporter:Ygor Lemos (ygor)Labels:
Date Opened:2007-08-31 16:58:24Date Closed:2011-06-07 14:02:42
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_directed_pickup
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I have several trunks, each one directed to a context in my PBX.

When I execute Pickup(${EXTEN:2}@CONTEXT-XXX) to te right context ( in which the call has been received ), the Pickup() works.

When I execute the Pickup(${EXTEN:2}) without any context or Pickup(${EXTEN:2}@PICKUPMARK), I get the error message:

[Aug 31 18:52:56] NOTICE[6694]: app_directed_pickup.c:159 pickup_exec: No target channel found for 2102.

I think that PICKUPMARK should scan the channels for one or the first context in which this extension is active and Pickup this extension on the matched context.

The same flaw has been reproduced on Asterisk 1.4.10.1
Comments:By: Jason Parker (jparker) 2007-08-31 17:22:00

Do you have any channels with the PICKUPMARK variable set to 2102?

By: Ygor Lemos (ygor) 2007-09-01 15:21:08

2102 is one extension...

The entry call contexts are: callin, zap-in, sip-in & disa-in, they are related with the call source so PICKUPMARK should assume one of those CONTEXT names as described on the Pickup() documentation ( show application PICKUPMARK ), the PICKUPMARK string is a wildcard that scans for the current ringing channels searching for a ocurrence of the EXTEN and then gets the first channel and assumes it...

When I do a "show channels" @ Asterisk CLI, I have currently two channels with the 2102 extension one on Ringing state and another on ring state... it simply enters from PSTN (zap) or SIP or IAX2 in different contexts and then they dial to a internal extension depending from the entry route wich is searched on a database... so on show channels I have a Ringing state channel with the Application(data): Dial(SIP/1202@internal) and Location: 01692037158@zap-in:2 so PICKUPMARK string should of course assume the "zap-in" value and then it correctly picks the call from PSTN.

I have tested it with hardcoded extensions, one after another, like this:

[pickup-app]
exten = _55.,1,Pickup(${EXTEN:2}@zap-in)
exten = _55.,n,Pickup(${EXTEN:2}@sip-in)
exten = _55.,n,Pickup(${EXTEN:2}@iax-in)
exten = _55.,n,Pickup(${EXTEN:2}@internal)
exten = _55.,n,Hangup

exten = h,1,Hangup

and then it worked but if for example the call enters from iax-in it fails zap-in and sip-in Pickups and then picks the call up on the iax-in pickup.

So, my whole point is... I want to write the context pickup-app as this:

[pickup-app]
exten = _55.,1,Pickup(${EXTEN:2}@PICKUPMARK)
exten = _55.,1,Hangup

And then it automatically does the scan job for me.

Of course, for my tiny application on this case it should not be hard to hardcode the extensions, but I have applications with lots of call-entry contexts for example and it should be painful to write a Pickup() for each entry context on my dialplan.

By: Tilghman Lesher (tilghman) 2007-09-01 17:18:15

Okay, it's fairly obvious that you don't understand how PICKUPMARK works.  Each channel that you want to be able to pickup, you must Set(PICKUPMARK=1234) on and then you can Pickup(1234@PICKUPMARK) from another channel.  If you want that behavior, that's what you have to do, but this is not a bug, just because it doesn't work the way you want.  It DOES work the way it's documented.