}
// TODO: Verify that alias does not collide with existing SIP-adress
+ if ( is_kamailio_domain( $alias_domain) && is_kamailio_subscriber($alias_username, $alias_domain) )
+ {
+ print json_encode ( array( 'response' => 'failed', 'cause' => 'exists', 'detail' => 'The desired alias collides with an existing non-alias.' ));
+ break;
+ }
list ( $dest_username, $dest_domain ) = split_sipaddress( $_GET['destination']);