When routing traffic for numerous gateways, the username field may sometimes be various values or omitted altogether. Also, without domain support, a wildcard/catchall username may be used for a "default" route. This *ugly* patch makes this possible by using '%' for the username in dr_groups.
The patch moves the matching pattern off of sql and into drouting.c which should not impact the speed.
# patch -p1 opensips-1.6.1-tls/modules/drouting/drouting.c < drouting.patch