Phil Frost
2012-Feb-23 19:44 UTC
[asterisk-users] Rejecting transfers to in-use parking spaces
I'm trying to emulate the functionality of our existing phone system, which is somewhat different than what Asterisk provides with a trivial parking configuration. I'd like each user to have three park buttons, park 1, park 2, park 3. The snom 870s I'm using have a "Park+Orbit" button, which best I can determine, is a shortcut to transfer someone to an extension. So, I defined some extensions: 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() As you can see, I'm calling Busy() if someone is already parked in the space, but this doesn't do what I'd like. 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!". As it is, the transfer is successful, and the caller hears a busy tone. Is there an application that has the effect of "Pretend this extension doesn't exist", or can I somehow get the caller back to the person that tried to park them in this space that's in use? Also, if anyone has specific experience with the Snoms, I'd like to improve this further. The Park+Orbit buttons seem to transfer the caller to an extension, and I can use a BLF button to monitor the spaces and unpark calls. It would be better if I could do this with just one button which parks the caller if currently on a call, or which unparks a call if I'm not on a call. Anyone have some idea how to accomplish this with the Snom 870?
Richard Mudgett
2012-Feb-23 21:32 UTC
[asterisk-users] Rejecting transfers to in-use parking spaces
> I'm trying to emulate the functionality of our existing phone system, > which is somewhat different than what Asterisk provides with a > trivial parking configuration. I'd like each user to have three park > buttons, park 1, park 2, park 3. The snom 870s I'm using have a > "Park+Orbit" button, which best I can determine, is a shortcut to > transfer someone to an extension. So, I defined some extensions: > > 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() > > As you can see, I'm calling Busy() if someone is already parked in > the space, but this doesn't do what I'd like. 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!". As it is, the transfer is successful, and > the caller hears a busy tone. Is there an application that has the > effect of "Pretend this extension doesn't exist", or can I somehow > get the caller back to the person that tried to park them in this > space that's in use?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. The device state check in this case is also unnecessary because Park will continue executing dialplan if the park fails. You could try three parkinglots with one parking space each. Each phone park button would transfer the call to a different parkinglot. Then all you need to do is include the parkinglot context(s) into your dialplan context to have access to the generated parking extensions. 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. Richard
Bryant Zimmerman
2012-Feb-23 23:44 UTC
[asterisk-users] Rejecting transfers to in-use parking spaces
---------------------------------------- From: "Phil Frost" <phil at macprofessionals.com> Sent: Thursday, February 23, 2012 4:39 PM To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com> Subject: Re: [asterisk-users] Rejecting transfers to in-use parking spaces On Feb 23, 2012, at 16:32 , Richard Mudgett wrote:>> 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. 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? -- _____________________________________________________________________ I was working on this today. I have it figured out but I don't have simple dialplan code I can share as we are doing a lot of external db and script calls to make ours work with our realtime stuff. We also are using the Dynamic Parking stuff as well I pulled that out to simplify things. [DoPark-Pickup-BlindPark] exten => s,1,NoOp(Dynamic Parking Pickup) exten => s,n,NoOp(Return Parked Call) exten => s,n,GoToIf($[${LEN(${BLINDTRANSFER})} > 0]?doParkAttempt,1) exten => s,n,ParkedCall( PLACE DIALED EXTENSION VARIABLE HERE) exten => doParkAttempt,1,NoOp(Attempt To Park) Place logic to parse the ${BLINDTRANSFER} to get the return to extension exten => doParkAttempt,n,Set(PARKINGLOT="Your Lot or var to handle the lot") exten => doParkAttempt,n,Set(PARKINGEXTEN=( PLACE DIALED EXTENSION VARIABLE HERE)) exten => doParkAttempt,n,Park(time out, return_context, return_ext, return priority, s) If park fails return the call back to your return context, exten, priotiry exten => doParkAttempt,n,Goto(return_context,return,ext, return priority) Good luck Bryant exten => doParkAttempt,n,Goto(return_context,return,ext, return priority) Good luckBryant -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120223/db3a4319/attachment.htm>