Asterisk Loose Connection Sql server

i have asterisk Core and i have connected this to sql server with odbc and using func_odbc .
this func odbc executing stored procedure there is only 1 value return but sometimes not always i get this

[Feb 16 12:07:12] WARNING[16437]: func_odbc.c:191 generic_execute: SQL Execute returned an error -1: 24000: [FreeTDS][SQL Server]Invalid cursor state (41)
[Feb 16 12:07:12] WARNING[16437]: func_odbc.c:199 generic_execute: SQL Exec Direct failed (-1)![Exec dbo.Main_Dest @bnumb = ‘XXXXXXXXX’]
[Feb 16 12:07:12] WARNING[16437]: res_odbc.c:604 ast_odbc_direct_execute: SQL Execute error! Verifying connection to MSSQL [MSSQL]…

so i have searched too many solutions but there is nothing about sql server i have tried some changes in db and in odbc.conf timeouts and stuff but it’s not working to me but mby there is some timeout time that must be plz help me solve this problem

I cant add too much here as I dont use func_odbc , I use ODBC connection for MSSQL but using AGI and PHP, but this error doesnt seems to be func_odbc related it seems more with the FreeDTS connection and MSSQL