Asterisk 13 call parking in realtime database

Hi All,

I was trying to use call parking from realtime database.
in sorcery.conf i added


in extconfig.conf

parking_lots => odbc,asterisk,parking_lots

and created a parking_lots table. It does not seem to work.

Question: is it possible to achieve? if yes, can you please explain.


Parking does not use sorcery, so it can not be configured that way. It also has no built in realtime support so the closest you could do is storing the configuration file contents itself in the database and calling reload to refresh when appropriate. This is referred to as static realtime. This is mentioned in the sample extconfig.conf file in general detail.

1 Like

I’ve never been a fan of the default parking functionality. For larger systems, you’ll want to explicitly park a call on a specific space. Then you can set the blf on your phone(s) to monitor that.

Here’s what I have in anyone else would like it…

Context of extensions:
exten => _10XXX,1,Goto(hints,${EXTEN},1)
same => n,Hangup()

in extensions.conf:
exten => _ZXXXX,hint,SIP/${EXTEN}

exten    => _10XXX,hint,Custom:${EXTEN}@hints
exten    => _7XXXX,hint,Custom:${EXTEN}@hints

exten    => _10XXX,1,NoOp(Parking for ${EXTEN} State: ${DEVICE_STATE(Custom:${pos}@hints)})
same    => n,Set(lot=locallot)
same    => n,Set(pos=${EXTEN})
same    => n,Set(PARKINGEXTEN=${pos})

same    => n,GotoIf($["${DEVICE_STATE(Custom:${pos}@hints)}"="RINGING"]?pickup:park)

same    => n(park),Set(DEVICE_STATE(Custom:${EXTEN}@hints)=RINGING)
same    => n,Park(${lot})
same    => n,Hangup()

same    => n(pickup),Set(DEVICE_STATE(Custom:${pos}@hints)=NOT_INUSE)
same    => n,ParkedCall(${lot},${pos})
same    => n,Hangup()

exten    => i,1,Hangup()
exten    => t,1,Hangup()
exten    => h,1,NoOp(POS ${pos} EXTEN ${EXTEN} PICKUPMARK ${__PICKUPMARK})
same    => n,Set(DEVICE_STATE(Custom:${pos}@hints)=NOT_INUSE)
same    => n,Set(DEVICE_STATE(Custom:${ARG1}@hints)=NOT_INUSE)
same    => n,Hangup()

findslot => first
parkingtime => 300
comebacktoorigin => yes
parkedcalltransfers => both
parkedcallreparking => both
context => parkedcalls
parkext => 100000
parkpos => 10000-10999

Cisco phone button:


Thanks for the reply. what is the reload command for parking?

is it ‘module reload’? or is there something better?

That is the correct CLI command to reload it.

while asterisk starts perfectly with my configured parking lots, if i execute the ‘module reload’ asterisk generates this error code and fails to load parking completely.

ERROR[4450]: res_parking.c:700 extension_is_compatible: Parking lot ‘my_parking’ – Needs an extension ‘_X.@custom’, but that extension is already owned by pbx_config.

any idea why parking needs ‘_X.’?

in res_parking.conf
context => custom
parkext => 7000
parkpos => 7001-7010

in extensions.conf
exten => _X.,1,Answer()
exten => _X.,n,Playback(welcome)
exten => _X.,n,Hangup()

NOTE: same config does not have any problem during asterisk restart.

UPDATE: same thing happens when i changed my dialplan from ‘_X.’ to ‘_XX.’. please help.
What am i doing wrong? why parking needs _X. as i have declared parkext to be 7000.

What I found out:
Because I have declared four digit parkext ‘7000’ and _X. or _XX. or _XXXX all matches any four digit extension, it is considering as taken.

But my question is, having an extension declared 7000 will be chosen over general patterns that matches four digit extension; why does it consider it taken??

Asterisk tries to match within the current context before considering included contexts, so _X. in default will override the 7000 in the included context for parked calls (I assume you did include it).

You will need to use Goto to cut holes.


I like your solution, it’s working great, but what is this line for?
For some reason you are matching extension that begins with 7?

exten => _7XXXX,hint,Custom:${EXTEN}@hints