ast_queue_hangup_with_cause(ast, AST_CAUSE_PROTOCOL_ERROR);
}
- tmp = pbx_builtin_getvar_helper(p->ast, "CRYPT_KEY");
+ ast_channel_lock(ast);
+ tmp = pbx_builtin_getvar_helper(ast, "CRYPT_KEY");
if (!ast_strlen_zero(tmp)) {
chan_misdn_log(1, p->bc->port, " --> Connection will be BF crypted\n");
ast_copy_string(p->bc->crypt_key, tmp, sizeof(p->bc->crypt_key));
p->bc->hdlc = 0;
p->bc->nojitter = 1;
}
+ ast_channel_unlock(ast);
p->state = MISDN_CONNECTED;
stop_indicate(p);
bc = p->bc;
if (bc) {
- const char *tmp=pbx_builtin_getvar_helper(ast,"MISDN_USERUSER");
- if (tmp) {
+ const char *tmp;
+ ast_channel_lock(ast);
+ if ((tmp = pbx_builtin_getvar_helper(ast, "MISDN_USERUSER"))) {
ast_log(LOG_NOTICE, "MISDN_USERUSER: %s\n", tmp);
strcpy(bc->uu, tmp);
bc->uulen=strlen(bc->uu);
}
+ ast_channel_unlock(ast);
}
MISDN_ASTERISK_TECH_PVT(ast) = NULL;
bc->out_cause = ast->hangupcause ? ast->hangupcause : AST_CAUSE_NORMAL_CLEARING;
+ ast_channel_lock(ast);
if ((varcause = pbx_builtin_getvar_helper(ast, "HANGUPCAUSE")) ||
(varcause = pbx_builtin_getvar_helper(ast, "PRI_CAUSE"))) {
int tmpcause = atoi(varcause);
bc->out_cause = tmpcause ? tmpcause : AST_CAUSE_NORMAL_CLEARING;
}
+ ast_channel_unlock(ast);
chan_misdn_log(1, bc->port, "* IND : HANGUP\tpid:%d ctx:%s dad:%s oad:%s State:%s\n", p->bc ? p->bc->pid : -1, ast->context, ast->exten, ast->cid.cid_num, misdn_get_ch_state(p));
chan_misdn_log(3, bc->port, " --> l3id:%x\n", p->l3id);
{
const char *tmp;
+ ast_channel_lock(chan);
tmp = pbx_builtin_getvar_helper(chan, "MISDN_PID");
if (tmp) {
ch->other_pid = atoi(tmp);
if (tmp) {
ast_copy_string(bc->keypad, tmp, sizeof(bc->keypad));
}
+ ast_channel_unlock(chan);
}
/*! \brief Export parameters to the dialplan environment variables */