Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello guys i am using asterisk and func_odbc so i have problems on stored procedure plz help me out so the problem is like this

so this is my func_odbc:
[PRESENCE]

dsn=concon

EXEC dbo.[Check] @Bnum = '${SQL_ESC(${ARG1})}',    @Anum = '${SQL_ESC(${ARG2})}'


and here is my stored procedure
[dbo].[Check]
( @Bnum VARCHAR(250),@Anum VARCHAR(250)
)
AS
BEGIN

select TOP 1 Exten from dbo.Des where @Bnum like '%' + LEFT(Num,3)+'%' ORDER BY LEN(LEFT(Num,3)) DESC
select TOP 1 [Se(City)] from dbo.Num where @Anum like '%' + LEFT(Num,3) + '%' ORDER BY LEN(LEFT(Num,3)) DESC
select Pern from dbo.Num where Num=@Anum



problem is that extentions.conf don't gets this 2 argument he is only geting 1
if i execute this procedure local in database with values inputed by hand it is working but from
Extention.conf
not

What I have tried:

so i have trired this code in Extention.conf
exten => mobiles,1,NoOp(${ODBC_PRESENCE(${ARG1}=${NUMMOB})})})
same => n,NoOp(${ARG1})
same => n,NoOp(${CALLERID(number)})
same => n,NoOp(${NUMMOB})
same => n,Set(${EXTEN}=${NUMMOB})
same => n,Set(NUMB2=${NUMMOB})
same => n,Set(CDR(bnumb)=${NUMMOB})
same => n,Set(NUMB3=${ODBC_PRESENCE(${ARG2}=${CALLERID(number)})})
same => n,Set(NUMB=${ODBC_PRESENCE(${ARG1}=${NUMB2})})
same => n,Dial(SIP/${NUMB}${NUMMOB}@pss,,S(${NUMB3}))
same => n,Hangup()
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900