--- ../hest/asterisk-1.6.1.6/channels/chan_sip.c.orig 2009-08-10 21:30:55.000000000 +0200 +++ channels/chan_sip.c 2009-10-06 22:16:12.000000000 +0200 @@ -4137,17 +4137,7 @@ } for (tmp = var; tmp; tmp = tmp->next) { - /* If this is type=user, then skip this object. */ - if (!strcasecmp(tmp->name, "type") && - !strcasecmp(tmp->value, "user")) { - if(peerlist) - ast_config_destroy(peerlist); - else { - ast_variables_destroy(var); - ast_variables_destroy(varregs); - } - return NULL; - } else if (!newpeername && !strcasecmp(tmp->name, "name")) { + if (!newpeername && !strcasecmp(tmp->name, "name")) { newpeername = tmp->value; } } @@ -4278,8 +4268,25 @@ } } - if (!p && (realtime || devstate_only)) + if (!p && (realtime || devstate_only)) { p = realtime_peer(peer, sin, devstate_only); + if (p) { + switch (which_objects) { + case FINDUSERS: + if (!(p->type & SIP_TYPE_USER)) { + return 0; + } + break; + case FINDPEERS: + if (!(p->type & SIP_TYPE_PEER)) { + return 0; + } + break; + case FINDALLDEVICES: + break; + } + } + } return p; }