Different Contexts, Same Extension

Let’s say I have two different contexts defined on one asterisk server: [first] and [second]. Both of which have a “Park” extension defined as 701. Are these going to interfere with each other? Or are they mutually exclusive?

i believe they will interfere with each other but test it out and let us know.

If you have two contexts and both of them include => parkedcalls (or whatever it’s called, I don’t remember off hand) I don’t see how you could have a problem with it. If you park a call from [context1] it would go to the first available parking space. Same thing would happen if you park a call from [context2]. Parking isn’t context specific at this time so you need to include the parking context itself in each of the other contexts you’re using for your phones. Shouldn’t be a problem.

Tom

Well it looks like they interfere. When I park a call on 701, both flash panels show someone on hold for extension 701, that is unless I’m doing something wrong. Below are excerpts from my config files:

[code]op_buttons_second.cfg:
;;
; Park ;
;
;
[PARK/701]
Position=22
Icon=3
Extension=701
Label="Park 701"
Context=second
Panel_context=second

op_buttons.cfg:
;;
; This “PARK” works ;
;
;
[PARK/701]
Position=22
Icon=3
Extension=701
Label="Park 701"
Context=default
Panel_context=first

extensions_second.conf:
[second]
include => parkedcalls
… bunch of stuff …
; Park a call
exten => 701,1,Park()
exten => 701,2,Hangup()

extensions.conf
[default]
include => parkedcalls
… bunch of stuff …
; Park a call (701 - 702)
exten => 701,1,Park()
exten => 701,2,Hangup()
[/code]

Take out all that Park() stuff you’ve got. When you include => parkedcalls in your contexts the system handles that for you. Make sure you have the parking set up the way you want it in features.conf and then try sending a few calls to the parking lot from each context. I’m betting you’ll find that it works correctly.

Tom

When I remove the Park() stuff from my extensions files, parking doesn’t work at all and I get this error in my Asterisk console:

== Spawn extension (default, 701, 0) exited non-zero on 'SIP/3877-cec6' -- Sent into invalid extension '701' in context 'default' on SIP/3877-cec6 -- Executing Playback("SIP/3877-cec6", "tt-weasels") in new stack -- Playing 'tt-weasels' (language 'en') Aug 7 08:46:25 WARNING[14999]: pbx.c:2415 __ast_pbx_run: Timeout, but no rule 't' in context 'default'

Here is my features.conf

[code];
; Sample Parking configuration
;

[general]
parkext => 700 ; What extension to dial to park
parkpos => 701-720 ; What extensions to park calls on. These needs to be
; numeric, as Asterisk starts from the start position
; and increments with one for the next parked call.
context => parkedcalls ; Which context parked calls are in
;parkingtime => 45 ; Number of seconds a call can be parked for
; (default is 45 seconds)
;transferdigittimeout => 3 ; Number of seconds to wait between digits when transfering a call
;courtesytone = beep ; Sound file to play to the parked caller
; when someone dials a parked call
;xfersound = beep ; to indicate an attended transfer is complete
;xferfailsound = beeperr ; to indicate a failed transfer
;adsipark = yes ; if you want ADSI parking announcements
;findslot => next ; Continue to the ‘next’ free parking space.
; Defaults to ‘first’ available
;pickupexten = *8 ; Configure the pickup extension. Default is *8
;featuredigittimeout = 500 ; Max time (ms) between digits for
; feature activation. Default is 500

[featuremap]
;blindxfer => #1 ; Blind transfer
;disconnect => *0 ; Disconnect
;automon => *1 ; One Touch Record
;atxfer => *2 ; Attended transfer

[applicationmap]
; Note that the DYNAMIC_FEATURES channel variable must be set to use the features
; defined here. The value of DYNAMIC_FEATURES should be the names of the features
; to allow the channel to use separated by ‘#’. For example:
; Set(DYNAMIC_FEATURES=myfeature1#myfeature2#myfeature3)
;
;testfeature => #9,callee,Playback,tt-monkeys ;Play tt-monkeys to
;callee if #9 was pressed

[/code]

You need to transfer the call to 700 to park it. In your features.conf 700 is defined as the number you dial to park a call and 701-720 are the slots the call will be parked in. Try calling 700 and see what happens.

Tom

Alright, setting it as ‘700’ does park the call in 701-720, but it looks like you can’t do seperate contexts for parked calls. Even after making the changes, it still shows a parked call in 701 for both panels. If you read the “Notes” section from the below link, it explains it:

voip-info.org/wiki/view/Aste … ll+parking

That is of course unless someone out there has found a way around this?

I’m going to set this up on my system when I’m off the phone. You should be able to park a call from [contexta] (which will go into 701 if it’s the first call being parked) and then park a call from [contextb] (which should go into 702 if there’s a call currently parked on 701) and not have any problems. The real problem comes into play when you dial the wrong parking slot and pick up a call that isn’t meant to be for you. :smile:

Give me a few and I’ll let you know if it works for me.

BTW: I’m on 1.2.10.

Tom

Actually I’m trying to do something a little different. Let’s assume I have 2 companies (company A and company B) completely separate running on one Asterisk server. What I’m trying to do is allow each company to have their own parking lot, conference rooms, etc withou interfering with each other. Meaning company A and company B should have their own 701-720 parking lot, their own 1001-1010 conference rooms, etc…

The way it works now when company A parks a call and it goes to 701, both company A and company B can reach the parked call on 701. Then if company B parks a call it goes to 702 since 701 is being used by company A. I want when company B parks a call for it to go to its own 701, then company A and company B cannot pick up each other’s 701 parked call.

From what I understand you can’t give them seperate parking lots. I just tried the seperate contexts thing and it worked exactly as I thought it would - if I park a call from my [internal] context and then park a call from my [test] context they both go into seperate parking slots (701 and 702). The problem is that I can pick up calls parked from the other context.

I just checked out the Park command and I’m sure this is something that has to be added internally. There might be a way to add it to your dialplan using variables to keep track of where you’re parking but I’m not sure off hand. I might have to take some time later and look into it.

Tom

if you really need to seperate parked calls, try this app: loligo.com/asterisk/misc/app … ing.README

it’s a 3rd party app that i don’t think it is maintained any longer. and you’ll need to search the internet for a patched version since the code i’ve linked to does not actually compile on version 1.2 of asterisk.

but if you’re willing to go to the trouble, app_valetparking will do the trick for you.