[asterisk-users] Realtime with "rtcachefriends=no" problems...

Atis Lezdins atis at iq-labs.net
Wed Aug 26 05:04:32 CDT 2009


On Wed, Aug 26, 2009 at 12:11 AM, Mauro Sergio Ferreira
Brasil<mauro.brasil at tqi.com.br> wrote:
> Hello there!
>
> Problem found.
>
> For some reason, the update statement below is generated with an invalid
> atribution of empty value '' to field "port" that is an integer.
> Because of that, this record keeps with prior "fullcontact" information
> that was updated by another client (which uses a different port) what
> leads to wrong client rtp packets routing... wow... that was weird... :-)
>
> [Aug 25 17:57:43] DEBUG[20801] res_config_mysql.c: MySQL RealTime:
> Query: UPDATE sip_buddies SET fullcontact = '', ipaddr = '', port = '',
> regseconds = '0', username = '', regserver = '' WHERE name = '101'
> [Aug 25 17:57:43] DEBUG[20801] res_config_mysql.c: MySQL RealTime: Query
> Failed because: Incorrect integer value: '' for column 'port' at row 1
>
> First of all... my appologies by the false alarm.
> But now I need your help to identify why is this update statement being
> generated wrongly.
>
> Does someone have any idea ?

Asterisk Realtime Architecutre currently treats all fields as strings.
I wish too that it would take into account actual field type retrieved
from DESCRIBE statement and add the quotes only if it's string.

You can safely do

ALTER TABLE sip_buddies CHANGE COLUMN port port VARCHAR(5);

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
IQ Labs Inc,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-users mailing list