[asterisk-users] Rejecting transfers to in-use parking spaces

Richard Mudgett rmudgett at digium.com
Thu Feb 23 16:54:11 CST 2012


> >> exten => _*70[123],1,NoOp(parking in ${EXTEN:1})
> >>    same => n,Set(PARKINGEXTEN=${EXTEN:1})
> >>    same =>
> >>    n,GotoIf(${DEVICE_STATE(park:${PARKINGEXTEN}@parkedcalls)}=INUSE?busy)
> >>    same => n,Park()
> >>    same => n(busy),Busy()
> >> 
> >> What I'm hoping to
> >> accomplish is have Asterisk respond to the Sip REFER to *701 with
> >> a
> >> 404 or similar response; if Asterisk can do this, then the Snom
> >> will
> >> say "transfer failed!".
> 
> > The dialplan device state check above is not always going to work
> > because another call could park in that space between the check
> > and the actual park. [...]
> > 
> > Please note that for Asterisk to detect an extension as a parking
> > extension, the first priority of the extension must be the park
> > application.  If the park application is not the first priority of
> > the extension, then the transfer is treated as a normal transfer.
> 
> 
> Hmm. Well, I could live with that race condition. Our call volume is
> low enough that the odds of hitting it acceptably low.

The next sentence also tried to point out that the check is not even
needed because if Park fails for whatever reason, it continues executing
dialplan.  With that dialplan, it is mainly going to fail if the parking
space is already in use.

> I'm not entirely sure what it means for Asterisk to detect an
> extension as a parking extension. Can you please explain how a
> parking transfer is different than a normal transfer?

If Asterisk detects the extension as a parking extension:
exten => 700,1,Park()
Asterisk can perform special processing dealing with parking the
call that may be needed for the channel driver.  Also note that the
dialplan extension is *not* actually executed in this case.

For SIP, blind transferring to parking, the parking is done as part
of the transfer.  If the park attempt fails, the transfer fails.  A
normal blind transfer would complete the transfer and then execute
the dialplan extension on the transferred channel.

For DTMF transfers (features.conf), attended and blind transferring
to parking are identical.  You will always hear the parking space
assigned.  If the park attempt fails, the interrupted bridge will be
resumed.

Richard



More information about the asterisk-users mailing list