Aasterisk ODBC simultaneously calls is mixing

i have kinda problem i am using odbc to connect sql server
in res_odbc i have this one :

enabled => yes
dsn =>MSSQL
username =>asterisk
password =>****
limit => 20
pooling => yes
max_connections => 20
forcecommit => yes
pre-connect => yes
idlecheck => 300
sanitysql => select 1

for getting rout i am using func_odbc Select i am selecting rout from sql server table and getting it in extensions.conf where i have dialplan and some func_odbc names for getting variables soo i have kinda problem if there is simultaneous call this variables are mixing and i am getting wrong call can you help me
beacouse i am stuck with this problem

my extensions.conf:

exten => _X.,1,Set(GLOBAL(Numberi)=${EXTEN})

same => n,NoOp(${CALLERID(number)})
same => n,NoOp(${Numberi:5})
same => n,Set(${EXTEN}=${Numberi:5})
same => n,Set(GLOBAL(NUMB2)=${Numberi:5})
same => n,Set(CDR(bnumb)=${Numberi:5})
same => n,Set(GLOBAL(NUMB3)=${ODBC_SecondsCity(${CALLERID(number)})})
same => n,Set(GLOBAL(NUMB)=${ODBC_PRESENCE(${Numberi:5})})
same => n,Set(CDR(destbnumb)=${NUMB}${Numberi:5})
same => n,NoOp(${NUMB})
same => n,Set(GLOBAL(Srv)=${ODBC_srv(${Numberi:5})})

same => n,Dial(SIP/${NUMB}${Numberi:5}@${Srv},S(${NUMB3}))
same => n,Hangup()

Global variables are just that, global. Setting it sets it for all channels. If you want channel specific variables then you shouldn’t make them global.

1 Like

it is working 100x thanks