con = ast_context_create(NULL, parking_con, registrar);
if (!con) /* Still no context? Bad */
ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con);
- else { /* Add extension to context */
- if (!ast_add_extension2(con, 1, pu->parkingexten, 1, NULL, NULL, parkedcall, ast_strdup(pu->parkingexten), ast_free, registrar))
- notify_metermaids(pu->parkingexten, parking_con);
- }
/* Tell the peer channel the number of the parking space */
if (peer && pu->parkingnum != -1) /* Only say number if it's a number */
ast_say_digits(peer, pu->parkingnum, "", peer->language);
+ if (con) {
+ if (!ast_add_extension2(con, 1, pu->parkingexten, 1, NULL, NULL, parkedcall, ast_strdup(pu->parkingexten), ast_free, registrar))
+ notify_metermaids(pu->parkingexten, parking_con);
+ }
if (pu->notquiteyet) {
/* Wake up parking thread if we're really done */
ast_indicate_data(pu->chan, AST_CONTROL_HOLD,