Re: Per endpoint SQL config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sure, you're right. Thanks for pointing this out!

----- Original Message ----- 
From: "Farid Adigamov" <lde4dl@xxxxxxxxx>
Sent: Friday, June 16, 2006 8:29 PM


>I start to looking at the sources and found out that at debug level
> number 6 there is a lot of
> information about SQL config loading data.
> So I get this stuff:
> 
> 2006/06/17 02:02:04.679 5        gksql_pgsql.cxx(476)   SQLCONF PgSQL
> connection to postgres@localhost[voipdb] established successfully
> 2006/06/17 02:02:04.680 3              gksql.cxx(177)   SQLCONF
> Database connection pool created: postgres@localhost[voipdb]
> 2006/06/17 02:02:04.680 5              gksql.cxx(181)   SQLCONF
> Connection pool: 1 SQL connections created, 0 failed
> 2006/06/17 02:02:04.680 3            Toolkit.cxx(829)   SQLCONF SQL
> config connection established
> 2006/06/17 02:02:04.680 4            Toolkit.cxx(836)   SQLCONF
> Loading config key=>value pairs from SQL database
> 2006/06/17 02:02:04.680 5              gksql.cxx(358)   SQLCONF
> Executing query: SELECT * FROM get_gkcfg_ep()
> 2006/06/17 02:02:04.690 6            Toolkit.cxx(864)   SQLCONF Config
> entry read: '[[EP::t56]] Capacity=5'
> 2006/06/17 02:02:04.690 6            Toolkit.cxx(864)   SQLCONF Config
> entry read: '[[EP::t56]] GatewayPriority=1'
> 2006/06/17 02:02:04.690 6            Toolkit.cxx(864)   SQLCONF Config
> entry read: '[[EP::t57]] Capacity=30'
> 2006/06/17 02:02:04.690 6            Toolkit.cxx(864)   SQLCONF Config
> entry read: '[[EP::t57]] GatewayPriority=2'
> 2006/06/17 02:02:04.691 4            Toolkit.cxx(867)   SQLCONF 4
> config key=>value pairs loaded from SQL database
> 2006/06/17 02:02:04.691 4            Toolkit.cxx(964)   SQLCONF
> Loading permanent endpoints from SQL database
> 2006/06/17 02:02:04.691 5              gksql.cxx(358)   SQLCONF
> Executing query: SELECT * FROM get_gkcfg_pendpoints()
> 2006/06/17 02:02:04.701 6            Toolkit.cxx(999)   SQLCONF
> Permanent endpoint read: '192.168.0.56:1720=t56;9945,666'
> 2006/06/17 02:02:04.701 6            Toolkit.cxx(999)   SQLCONF
> Permanent endpoint read: '192.168.0.57:1720=t57;666'
> 2006/06/17 02:02:04.701 4            Toolkit.cxx(1004)  SQLCONF 2
> permanent endpoints loaded from SQL database
> 2006/06/17 02:02:04.701 5              gksql.cxx(217)   SQLCONF
> Database connection (id 0) closed
> 2006/06/17 02:02:04.701 5              gksql.cxx(223)   SQLCONF
> Connection pool cleanup finished
> 2006/06/17 02:02:04.701 3            Toolkit.cxx(1053)  SQLCONF SQL
> config connection closed
> 
> Do you see the double squre breakets? =)
> Ok, looking to the gnugk documentation manual, at the page of Advanced
> Config, section [SQLConfig]:
> http://www.gnugk.org/gnugk-manual-12.html
> 
> ....
> Sample query strings:
> 
> ConfigQuery=SELECT secname, seckey, secval FROM sqlconfig WHERE gk = '%1'
> ConfigQuery=SELECT '[RasSrv::RRQAuth]', alias, rule FROM rrqauth WHERE gk = '%1'
> ...
> 
> So, as it says, that the query results must contain the brackets in
> section name( i mean the first value in the row ).
> 
> When I drop 'em out, I got what I want - the priority and capacity
> works fine for me. The result of my query now is looking like this:
> 
> voipdb=# select * from get_gkcfg_ep();
>  secname  |     optname     | optvalue
> -----------+-----------------+----------
>  EP::t56 | Capacity        |        5
>  EP::t56 | GatewayPriority |        1
>  EP::t57 | Capacity        |       30
>  EP::t57 | GatewayPriority |        2
> (rows: 4)
> 
> 
> So, check the row in docs, it has to be
> "ConfigQuery=SELECT 'RasSrv::RRQAuth', alias, rule FROM rrqauth WHERE gk = '%1'"
> in doc manual, as I see ( without brackets ).
> 
> 
> Farid Adigamov.
> 
> 
>> Message: 2
>> Date: Thu, 15 Jun 2006 07:46:35 +0400
>> From: "Farid Adigamov" <lde4dl@xxxxxxxxx>
>> Subject:  Per endpoint SQL config
>> To: openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
>> Message-ID:
>>         <5d73a9e00606142046q37610222j36cecea14396ddba@xxxxxxxxxxxxxx>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Hello!
>> I'm confused a little about per endpoint configuration by sql config queries.
>>
>> My gnugk.ini:
>>
>> ...
>>
>> [SQLConfig]
>> Driver=PostgreSQL
>> Database=voipdb
>> Username=postgres
>> PermanentEndpointsQuery=SELECT * FROM get_gkcfg_pendpoints()
>> ConfigQuery=SELECT * FROM get_gkcfg_ep()
>>
>> ....
>>
>> Result sets of this PL/SQL functions :
>>
>> voipdb=# select * from get_gkcfg_ep();
>>   secname  |     optname     | optvalue
>> -----------+-----------------+----------
>>  [EP::t56] | Capacity        |        5
>>  [EP::t56] | GatewayPriority |        1
>>  [EP::t57] | Capacity        |       30
>>  [EP::t57] | GatewayPriority |        2
>> (rows: 4)
>>
>> voipdb=# select * from get_gkcfg_pendpoints();
>>       ip      | port | _alias | prefixes
>> --------------+------+--------+----------
>>  192.168.0.56 | 1720 | t56    | 9945,777
>>  192.168.0.57 | 1720 | t57    | 777
>> (rows: 2)
>>
>> So, when I flood N concurrent calls with prefix 777 I get as result a
>> half of terminated calls on one gw ( t56 ), and other half on another.
>> As documentation says, in my case only 5 concurrent calls must be
>> terminated on gw t56.
>>
>> Farid.



_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux