//parameters names as in the config
$phone = &$params['extension'];
$channel = explode('/', $params['channel']);
'custom-context-1' => array(161, 162, 163),
'custom-context-2' => array(141, 140),
foreach($contexts as $context => $phones){
if(in_array($channel[1], $phones)){
$params['context'] = $context;