Hello,
I have a fairly simple dialplan:
[createcdr]
exten => s,1,Verbose(1,${STRFTIME(${EPOCH},GMT+4,%C%y-%m-%d %H:%M:%S)} - Ctx: ${CONTEXT} - Exten: ${EXTEN} - Clid: ${CALLERID(all)} -- ${ARG1} -- ${ARG2})
same => n,Set(accntid=${ODBC_GETACCNTID(${ARG1})})
same => n,Verbose(2,Account id: ${accntid})
same => n,Set(ODBC_CREATECDR()=${accntid},${ARG2})
it is called from the dialplan:
same => n,Gosub(createcdr,s,1(${CALLERID(num)},${EXTEN}))
and the odbc is:
[CREATECDR]
dsn=mydb
; works: writesql=insert into call (dest, agent, ) values (’${ARG2}’, ${accntid}, 0)
writesql=insert into call (dest, agent, ) values (’${ARG2}’, ${ARG1}, 0)
Well, if I run the non commented statement, I get the ARG1 & ARG2 from the GOSUB, and NOT the one from the Set(ODBC_… statement, while if I run the commented statement, I get the expected values - in both cases, I see the same line in verbose:
– Executing [s@createcdr:4] Set(“SIP/13579-0000000d”, “ODBC_CREATECDR()=1,1000”) in new stack
Is this normal ?