[Asterisk-Dev] ENUM Lookup REGEXP Size
Andy Paumann
andy at internic.at
Wed Aug 10 08:45:37 MST 2005
Hi!
I have explored a problem, when having big regular expressions (using Asterisk CVS and stable versions):
The expressions where cut after 80 characters.
I have change the file enum.c to allow bigger REGEXPs…
Original version:
===========================================================================================
/*--- parse_naptr: Parse DNS NAPTR record used in ENUM ---*/
static int parse_naptr(unsigned char *dst, int dstsize, char *tech, int techsize, unsigned char *answer, int len, char *napt
rinput)
{
unsigned char *oanswer = answer;
unsigned char flags[80] = "";
unsigned char services[80] = "";
unsigned char regexp[80] = "";
unsigned char repl[80] = "";
unsigned char temp[80] = "";
unsigned char delim;
unsigned char *delim2;
unsigned char *pattern, *subst, *d;
int res;
int regexp_len, size, backref;
int d_len = sizeof(temp) - 1;
regex_t preg;
regmatch_t pmatch[9];
===========================================================================================
Changed version:
===========================================================================================
/*--- parse_naptr: Parse DNS NAPTR record used in ENUM ---*/
static int parse_naptr(unsigned char *dst, int dstsize, char *tech, int techsize, unsigned char *answer, int len, char *napt
rinput)
{
unsigned char *oanswer = answer;
unsigned char flags[256] = "";
unsigned char services[256] = "";
unsigned char regexp[256] = "";
unsigned char repl[256] = "";
unsigned char temp[256] = "";
unsigned char delim;
unsigned char *delim2;
unsigned char *pattern, *subst, *d;
int res;
int regexp_len, size, backref;
int d_len = sizeof(temp) - 1;
regex_t preg;
regmatch_t pmatch[9];
===========================================================================================
Now it works…but the main problem is, that there are many customers out there, using Asterisk with the limit of 80 characters…is there a plan to change this limitation, as 80 sounds a little bit too low to me (There is only a limit for the UDP Packet of the Nameserver query itself, which (as I think) is around 512 bytes)?
mit freundlichen Grüssen / with best regards
Andreas Paumann
CEO internic Datenkommunikations GmbH.
CEO globedom Datenkommunikations GmbH.
Donaucitystr. 1, A-1220 Vienna, Austria
Web: http://www.internic.at/ and http://www.globedom.com/
Why driving a 4WD? 'Cause the earth ain't flat!
You can go fast…I can go everywhere!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050810/a381647c/attachment.htm
More information about the asterisk-dev
mailing list