Sorry to ask. Is the LCR module in the CVS? Thanks!
Ricardo.-
-----Mensaje original----- De: Java Rockx [mailto:javarockx@gmail.com] Enviado el: Jueves, 17 de Febrero de 2005 15:30 Para: serusers@lists.iptel.org Asunto: [Serusers] LCR Module Question
Hi All.
I've got a question about the new LCR module that Juha commited to CVS.
We're located in the US so this question may pertain only to ser installations that follow the North American Numbering Plan.
For us to _really_ perform LCR decisions we need to look at the NPA and NXX (ie, the first 6 digits of a 10-digit phone number) of the origination and termination numbers. This this we would decide where to route the call.
The reason is that it matters here we get DIDs from (sometimes they're provided by 3rd party PSTN gateway operators) and where our softswitch(s) are physically located.
So at a high level the matrix of routing decisions would look something like this:
Orig NPANXX Term NPANXX PSTN Gateway
407566 321251 10.10.0.40 814332 202442 67.93.11.31
So can the LCR module accomodate something like this?
Regards, Paul
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Ricardo Martinez writes:
Is the LCR module in the CVS?
yes it is in the HEAD, but currently it only works if the last byte of your gws' ip address is less than 128. this is due to ser db interface, which doesn't seem to support unsigned ints or then i don't know how to use it.
-- juha
yes it is in the HEAD, but currently it only works if the last byte of your gws' ip address is less than 128. this is due to ser db interface, which doesn't seem to support unsigned ints or then i don't know how to use it.
Try this, http://dev.mysql.com/doc/mysql/en/numeric-types.html
When you create the table field, you can use attribute "unsigned".
Richard
Richard writes:
When you create the table field, you can use attribute "unsigned".
sure and that is what gw table is using (ser_mysql.sh):
# # Table structure for table 'gw' #
CREATE TABLE gw ( gw_name VARCHAR(128) NOT NULL, ip_addr INT UNSIGNED NOT NULL, port SMALLINT UNSIGNED, grp_id INT UNSIGNED NOT NULL, PRIMARY KEY (gw_name), KEY (grp_id) ) $TABLE_TYPE;
the problem is that
VAL_INT(ROW_VALUES(row)
for ip_addr field produces wrong value if the first bit of the value in db is 1.
-- juha
Juha,
Can the IP be stored as a character field rather than as an int?
Paul
On Thu, 17 Feb 2005 23:46:08 +0200, Juha Heinanen jh@lohi.tutpro.com wrote:
Richard writes:
When you create the table field, you can use attribute "unsigned".
sure and that is what gw table is using (ser_mysql.sh):
# # Table structure for table 'gw' #
CREATE TABLE gw ( gw_name VARCHAR(128) NOT NULL, ip_addr INT UNSIGNED NOT NULL, port SMALLINT UNSIGNED, grp_id INT UNSIGNED NOT NULL, PRIMARY KEY (gw_name), KEY (grp_id) ) $TABLE_TYPE;
the problem is that
VAL_INT(ROW_VALUES(row)
for ip_addr field produces wrong value if the first bit of the value in db is 1.
-- juha
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
i "solved" the unsigned int db problem by the following change in modules/mysql/val.c, function str2int:
replace line
*_v = atoi(_s);
with
*_v = (int)atoll(_s);
it namely turned out that atoi does not work with large unsigned ints.
jan, since you seem to be the author of mysql module, could you commit the above change? it should not cause any trouble for signed ints, but of course using atoll must be somewhat slower than atoi.
the other option i guess is to add unsigned int as a new datatype to ser db interface, which would be lot of work.
-- juha
At 11:17 PM 2/17/2005, Juha Heinanen wrote:
the other option i guess is to add unsigned int as a new datatype to ser db interface, which would be lot of work.
Well, I think that's something we should do someday. Generally, I would prefer to see unsigned ints throught SER as opposed to signed ints. There is at least one known case when use of signed int made it easy to introduce a crash through producing a negative table hash value.
-jiri
Juha Heinanen wrote:
i "solved" the unsigned int db problem by the following change in modules/mysql/val.c, function str2int:
replace line
*_v = atoi(_s);
with
*_v = (int)atoll(_s);
it namely turned out that atoi does not work with large unsigned ints.
jan, since you seem to be the author of mysql module, could you commit the above change? it should not cause any trouble for signed ints, but of course using atoll must be somewhat slower than atoi.
the other option i guess is to add unsigned int as a new datatype to ser db interface, which would be lot of work.
Thanks Juha. That worked. We will test it over the next couple of weeks with some of our gateways and let you know the results.
-- juha
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi,
Java Rockx wrote:
Can the IP be stored as a character field rather than as an int?
I'd also prefer to handle with strings rather than ints, so one could choose between dotted ip addresses and host names, which are both much easier to maintain than ints.
Andy