Re: [asterisk-users] Error When Using Postgresql Schema With Realtime Sip

2009-09-24 Thread Tilghman Lesher
On Thursday 24 September 2009 05:06:02 stephen.hindma...@bt.com wrote:
> I have investigated further and found that it is a bug in ODBC, not
> Asterisk. The SQLColumns function, which asterisk uses to describe the
> table, does not return any columns when the table name includes the
> schema specification. You can show this by using isql to do "help table"
> which returns info about all the columns, and then "help public.table"
> which returns nothing. As chan_sip seems to be the only application that
> tests the structure of the table before writing to it this is why
> REGISTER fails.
>
> When I have time I will chase up ODBC and see if the issue is tracked
> there. Do you still want me to raise it as an issue on bugtracker?

Yes, I want you to raise this on the bugtracker, and no, this is not a bug
in ODBC, but a deficiency in my code.  Since you tracked this down to the
code in res_odbc.c, I might as well tell you that the first two NULL sets of
arguments (NULL, 0) are for specifying the catalog and schema, respectively,
of the database table, and it is because I never bothered parsing the schema
out of the tablename that this does not work.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Error When Using Postgresql Schema With Realtime Sip

2009-09-24 Thread stephen.hindmarch
I have investigated further and found that it is a bug in ODBC, not
Asterisk. The SQLColumns function, which asterisk uses to describe the
table, does not return any columns when the table name includes the
schema specification. You can show this by using isql to do "help table"
which returns info about all the columns, and then "help public.table"
which returns nothing. As chan_sip seems to be the only application that
tests the structure of the table before writing to it this is why
REGISTER fails.

When I have time I will chase up ODBC and see if the issue is tracked
there. Do you still want me to raise it as an issue on bugtracker?

The problem manifests itself in res_odbc.c inside the
ast_odbc_find_table function, around line 176 in my copy of the code.

>Tilghman Lesher wrote:
>> Yep, I never bothered to include support for specifying either the
>catalog or
>> the schema, since I've never had reason to use either one.  Please
report this
>> issue on the bugtracker (https://issues.asterisk.org) and I'll get a
patch up
>> straightaway, but I'll need your testing to ensure the patch works.
>
>++  But I won't be able to test for awhile.
>
>Stephen.  As a test/work-around/option you could try setting the 
>search_path for the user connecting to the database.
>
>This has worked for me with RT and LedgerSMB.
>

Steve Hindmarch
BT Design


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Error When Using Postgresql Schema With Realtime Sip

2009-09-23 Thread Roderick A. Anderson
Tilghman Lesher wrote:
> On Wednesday 23 September 2009 05:49:54 stephen.hindma...@bt.com wrote:
>> I am using asterisk 1.6.1.6 and have been setting up a system to use a
>> Postgresql database as the realtime DB via the ODBC route. I have got
>> extensions and voicemail working but am having trouble with SIP
>>
>> The problem seems to be with using a schema. If I put the table "sip" in
>> the schema "foo" then I add this entry to extconfig.conf
>>
>> sippeers => odbc,psqldb,foo.sip
>>
>> Restart everything and then try to register a client. The registration
>> fails and I get this set of messages in the log
> 
> 
> 
>> So it seems to be something to do with having the schema name in the
>> table name. But as I say I have already got extensions and voicemail
>> working, and they both uses schemas, so it seems to be peculiar to SIP.
>>
>> Does anybody have any ideas about what it might be?
> 
> Yep, I never bothered to include support for specifying either the catalog or
> the schema, since I've never had reason to use either one.  Please report this
> issue on the bugtracker (https://issues.asterisk.org) and I'll get a patch up
> straightaway, but I'll need your testing to ensure the patch works.

++  But I won't be able to test for awhile.

Stephen.  As a test/work-around/option you could try setting the 
search_path for the user connecting to the database.

This has worked for me with RT and LedgerSMB.


\\||/
Rod
-- 


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Error When Using Postgresql Schema With Realtime Sip

2009-09-23 Thread Tilghman Lesher
On Wednesday 23 September 2009 05:49:54 stephen.hindma...@bt.com wrote:
> I am using asterisk 1.6.1.6 and have been setting up a system to use a
> Postgresql database as the realtime DB via the ODBC route. I have got
> extensions and voicemail working but am having trouble with SIP
>
> The problem seems to be with using a schema. If I put the table "sip" in
> the schema "foo" then I add this entry to extconfig.conf
>
> sippeers => odbc,psqldb,foo.sip
>
> Restart everything and then try to register a client. The registration
> fails and I get this set of messages in the log



> So it seems to be something to do with having the schema name in the
> table name. But as I say I have already got extensions and voicemail
> working, and they both uses schemas, so it seems to be peculiar to SIP.
>
> Does anybody have any ideas about what it might be?

Yep, I never bothered to include support for specifying either the catalog or
the schema, since I've never had reason to use either one.  Please report this
issue on the bugtracker (https://issues.asterisk.org) and I'll get a patch up
straightaway, but I'll need your testing to ensure the patch works.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users