[asterisk-dev] [feedback request] Allow user more control over parked callsthat expire from a one touch park

Mitch Sharp MSharp at BIGNetworks.com
Thu Sep 16 01:09:28 CDT 2010


I'm replying to my own message after a little more research... I feel
like I'm talking to myself.  :-)

First of all the documentation in TRUNK for features.conf.sample states
that if comebacktoorigin=no, the call will be returned to
"parkedcallstimeout,[flat_peer_name],1".  If that doesn't exist, the
call will be sent to "parkedcallstimeout,s,1".  After looking through
the code to see where this takes place, it appears there is not code
that checks for extension existence... it just jumps.

If it did jump to the s,1 dialplan as the documentation says, the user
would still not know what device parked the call because they couldn't
reconstruct it from the flattened extension that doesn't exist. (I plan
on submitting code to fix this)

I have reconfigured my test asterisk switch (currently running 1.6.2.11)
to use comebacktoorigin=no, which sends timed out parked calls to
"parkedcallstimeout,flat_peer_name,1".  The dial plan below shows the
code required to reconstruct the channel that parked the call and then
dial it, plus a little extra code just in case the return call went
unanswered:

[parkedcallstimeout]
exten => s,1,NoOp()
exten => s,n,DumpChan()
exten => s,n,Dial(${PARKER},30,TKtwk)
exten => s,n,ExecIf($["${DIALSTATUS}" = "ANSWER"]?Hangup())
exten => s,n,Goto(bigincoming,s,menu)

exten => _DAHDI.,1,Set(PARKER=${EXTEN:0:5}/${EXTEN:6})
exten => _DAHDI.,n,Goto(s,1)

exten => _IAX2.,1,Set(PARKER=${EXTEN:0:4}/${EXTEN:5})
exten => _IAX2.,n,Goto(s,1)

exten => _SIP.,1,Set(PARKER=${EXTEN:0:3}/${EXTEN:4})
exten => _SIP.,n,Goto(s,1)

exten => _Zap.,1,Set(PARKER=${EXTEN:0:3}/${EXTEN:4})
exten => _Zap.,n,Goto(s,1)



If we add the PARKER channel variable to the Park application, the code
below is all that is needed:

[parkedcallstimeout]
exten => s,1,Dial(${PARKER},30,TKtwk)
exten => s,n,ExecIf($["${DIALSTATUS}" = "ANSWER"]?Hangup())
exten => s,n,Goto(incoming,s,reception)

exten => _DAHDI.,1,Goto(s,1)
exten => _IAX2.,1,Goto(s,1)
exten => _SIP.,1,Goto(s,1)
exten => _Zap.,1,Goto(s,1)



If we add the check to verify the existence of the flat_peer_name
extension and send the call to s,1 if it doesn't, it get's even shorter:

[parkedcallstimeout]
exten => s,1,Dial(${PARKER},30,TKtwk)
exten => s,n,ExecIf($["${DIALSTATUS}" = "ANSWER"]?Hangup())
exten => s,n,Goto(incoming,s,reception)



The code I added with comebacktocustom essentially does all this, plus
gives each parking lot it's own context to handle calls in.  Currently,
in the instance of handling timed out calls from multiple parking lots,
you would have to have dial plan code that checks for specific channel
variables and jumps out to other contexts/extensions appropriately.
With comebacktocustom, this is handled separately in a known context as
long as the user configures it.  If they don't, we fall back to the
default behavior.

I would love to hear some feedback.  Thanks!

Mitch Sharp
BIG Networks
5647 Galeria Drive, Suite D
Baton Rouge, LA 70816
tel: 225.214.1444 x101
fax: 225.214.1443
email: msharp at bignetworks.com
web: www.bignetworks.com


-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Mitch Sharp
Sent: Tuesday, September 14, 2010 12:12 PM
To: asterisk-dev at lists.digium.com
Subject: [asterisk-dev] [patch] Allow user more control over parked
callsthat expire from a one touch park

https://issues.asterisk.org/view.php?id=17947

I created and posted the above patch to issues a little while ago.  I
had originally created the patch against 1.6.2.11, re-wrote it for trunk
and posted it.  I did not realize that it was similar in nature to some
existing behavior, namely comebacktoorigin.  Russell pointed this out.
(Thanks!)

Here is my response, which I posted to issues and it should have been
posted here:

[quote]

It looks like I completely missed that. I developed this code to fill a
need in the 1.6.2 code base for a customer and then submitted the patch
against trunk. It looks like I developed very similar functionality. It
was fun though! :-)

The only thing that I can see that comebacktocustom does different is
this. comebacktoorigin sends all calls to the same context,
parkedcallstimeout. comebacktocustom sends calls to the parking lot
context at s,1. I live in a multitenant world, so some tenants will want
to handle timed out calls differently (some want a particular callerid,
some a particular ring tone, some both).

I could emulate that behavior by setting a channel variable that tells
me where to jump out of parkedcallstimeout to handle things differently
per customer.

I also added two channel variables when the call times out, PARKER and
PARKINGSLOT. PARKER is the device that originally parked the call so the
dialplan can know who to call back. Technically, that was not previously
available to the dialplan unless you took the flat extension and tried
to tweak it back to a channel name. PARKINGSLOT was previously only set
if comebacktoorigin was set to no.

So it looks like comebacktocustom just allows the user using multiple
parking lots more flexibility in that the timeout context can be custom
per parking lot, plus a few other options.

Thoughts?

[/quote]

I have just recently noticed and wrapped my head around the
peername_flat concept and realized how I could reconstruct the channel
that parked me: I have to create extensions for _SIP0., _IAX2., and any
other technology that is used, in the parkedcallstimeout.

Thankfully the documentation in 1.8 and trunk is much clearer on this
feature, and it looks like in 1.8 and trunk the replacement of the "/"
to a "0" is being changed to an "_" character.

I guess my question is is this patch something that has any merit, or
should I scrap the thing and write a new one that adds the following:
- Keep the comebackdialtime for the default comeback procedure
- Set channel variable PARKER to the channel that parked me, that way
all the "lazy" people out there don't have to rebuild it based on the
extension.
- Add another per-parking lot option that allows the user to specify the
context that an unparked call is going to go to
- Add another per-parking lot option that allows the user to return to
the s,1 extension,priority instead of building peername_flat extensions.

Is this making it easier for people to wrap their heads around handling
timeout out parked calls, or am I just creating un-needed options?

Thanks!

Mitch Sharp
BIG Networks
5647 Galeria Drive, Suite D
Baton Rouge, LA 70816
tel: 225.214.1444 x101
fax: 225.214.1443
email: msharp at bignetworks.com
web: www.bignetworks.com




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

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



More information about the asterisk-dev mailing list