mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-15 06:18:38 +00:00
fixed the crypt_keys stuff
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@58850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4531,16 +4531,22 @@ static int misdn_set_opt_exec(struct ast_channel *chan, void *data)
|
|||||||
case 'c':
|
case 'c':
|
||||||
keyidx=atoi(++tok);
|
keyidx=atoi(++tok);
|
||||||
|
|
||||||
if (keyidx > misdn_key_vector_size || keyidx < 0 ) {
|
char keys[4096];
|
||||||
ast_log(LOG_WARNING, "You entered the keyidx: %d but we have only %d keys\n",keyidx, misdn_key_vector_size );
|
char *key=NULL, *tmp;
|
||||||
continue;
|
int i;
|
||||||
|
misdn_cfg_get( 0, MISDN_GEN_CRYPT_KEYS, keys, sizeof(keys));
|
||||||
|
|
||||||
|
tmp=keys;
|
||||||
|
|
||||||
|
for (i=0; i<keyidx; i++) {
|
||||||
|
key=strsep(&tmp,",");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (key) {
|
||||||
ast_copy_string(ch->bc->crypt_key, misdn_key_vector[keyidx], sizeof(ch->bc->crypt_key));
|
ast_copy_string(ch->bc->crypt_key, key, sizeof(ch->bc->crypt_key));
|
||||||
}
|
}
|
||||||
|
|
||||||
chan_misdn_log(0, ch->bc->port, "SETOPT: crypt with key:%s\n",misdn_key_vector[keyidx]);
|
chan_misdn_log(0, ch->bc->port, "SETOPT: crypt with key:%s\n",ch->bc->crypt_key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
|
|||||||
Reference in New Issue
Block a user