Confuse about inbound routes

hello guys,
firstly, sory for my bad english…

i have created extension number like “SIP/2224”. so, i want to used it in cidlookup to retrieve data from database. what i understand is, cidlookup must be set in inbound routes (cidlookup source) if i want to get data from database. am i right…??

the problem is, can i use SIP “2224” as my CID and DID number in inbound routes setting. i have read some modules, they said that :

“the CID entered in this field must exactly match the format in which the provider is sending the CID. Providers may send 7, 10, or 11 digits;they may include a country code and the plus symbol.”

if i set SIP/2224 as my CID/DID number, could inbound route going to work??

Hi, I often use the MySQL CDR database to query call history and have never had any issues.

Can you explain what you are trying to get out of the database and a brief summary of how you’ve setup your box?

From your second question about inbound route, these routes have no tie to your SIP extensions, only your trunks. CID = the inbound callers id (if any) and the DID = the trunk ID. If you use SIP for your trunks, usually the DID is the userid of the SIP provider - but this can be over-ridden.

Spence

thanks for your reply.

my CDR going ok and no problem with that.

actually, i have 2 sip number: 2224(admin) and 2223(sales).what i am trying to do is, to retrieve data about the agent that we call. example :

i use extension 2224 to make a call to extension 2223.
roughly the call flow will go like this, and it will retrieve data about the agent we called:-
,
call 100 > ivr-1(welcome) > ivr-2(menu): press 1 for admin, press 2 for sales >… user press…(1 or 2) > ivr-3(wait while get the extension) : “here process to retrive ip_address”> ring the extension.

,
yesterday i have created a context in extension_custom to make connnection with database. it look like this.

[cidlookup-custom]

exten => _X,1,MYSQL(Connect connid localhost root database_psswrd asterisk)
exten => _X,n,MYSQL(Query resultid ${connid} SELECT\ ip_address\ FROM\ calledInfo\ WHERE\ extension\ LIKE\ ‘2223’)
exten => _X,n,MYSQL(Fetch fetchid ${resultid} ip_address)
exten => _X,n,MYSQL(Clear ${resultid})
exten => _X,n,Verbose(${ip_address})
exten => _X,n,Return()
exten => _X,n,Goto(from-did-direct,2223,1)
exten => 333,1,MYSQL(Connect connid localhost root database_psswrd asterisk)
exten => 333,n,MYSQL(Query resultid ${connid} SELECT\ ip_address\ FROM\ calledInfo\ WHERE\ extension\ LIKE\ ‘2221’)
exten => 333,n,MYSQL(Fetch fetchid ${resultid} ip_address)
exten => 333,n,MYSQL(Clear ${resultid})
exten => 333,n,Verbose(${ip_address})
exten => 333,n,Return()
exten => t,n,Goto(from-did-direct,2221,1)

then i called this context from ivr-3(wait while get the extension).

exten => t,n,Goto(cidlookup-custom,333,1)
exten => t,n,Goto(cidlookup-custom,_X,1)

this is the what i get from CLI:-

,

Verbosity is at least 3
– Executing [100@from-internal:1] NoOp(“SIP/2223-00000000”, “Running miscapp 1: VoiceRecord”) in new stack
– Executing [100@from-internal:2] Goto(“SIP/2223-00000000”, “ivr-9|s|1”) in new stack
– Goto (ivr-9,s,1)
– Executing [s@ivr-9:1] Set(“SIP/2223-00000000”, “MSG=custom/Welcome”) in new stack
– Executing [s@ivr-9:2] Set(“SIP/2223-00000000”, “LOOPCOUNT=0”) in new stack
– Executing [s@ivr-9:3] Set(“SIP/2223-00000000”, “__DIR-CONTEXT=default”) in new stack
– Executing [s@ivr-9:4] Set(“SIP/2223-00000000”, “_IVR_CONTEXT_ivr-9=”) in new stack
– Executing [s@ivr-9:5] Set(“SIP/2223-00000000”, “_IVR_CONTEXT=ivr-9”) in new stack
– Executing [s@ivr-9:6] GotoIf(“SIP/2223-00000000”, “0?begin”) in new stack
– Executing [s@ivr-9:7] Answer(“SIP/2223-00000000”, “”) in new stack
– Executing [s@ivr-9:8] Wait(“SIP/2223-00000000”, “1”) in new stack
– Executing [s@ivr-9:9] Set(“SIP/2223-00000000”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing [s@ivr-9:10] Set(“SIP/2223-00000000”, “TIMEOUT(response)=2”) in new stack
– Response timeout set to 2
– Executing [s@ivr-9:11] Set(“SIP/2223-00000000”, “__IVR_RETVM=”) in new stack
– Executing [s@ivr-9:12] ExecIf(“SIP/2223-00000000”, “1|Background|custom/Welcome”) in new stack
– <SIP/2223-00000000> Playing ‘custom/Welcome’ (language ‘en’)
– Executing [s@ivr-9:13] WaitExten(“SIP/2223-00000000”, “|”) in new stack
– Timeout on SIP/2223-00000000, going to ‘t’
– Executing [t@ivr-9:1] Set(“SIP/2223-00000000”, “LOOPCOUNT=1”) in new stack
– Executing [t@ivr-9:2] GotoIf(“SIP/2223-00000000”, “0?s|begin”) in new stack
– Executing [t@ivr-9:3] DBdel(“SIP/2223-00000000”, “”) in new stack
– Executing [t@ivr-9:4] Set(“SIP/2223-00000000”, “__NODEST=”) in new stack
– Executing [t@ivr-9:5] Goto(“SIP/2223-00000000”, “ivr-20|s|1”) in new stack
– Goto (ivr-20,s,1)
– Executing [s@ivr-20:1] Set(“SIP/2223-00000000”, “MSG=custom/menu”) in new stack
– Executing [s@ivr-20:2] Set(“SIP/2223-00000000”, “LOOPCOUNT=0”) in new stack
– Executing [s@ivr-20:3] Set(“SIP/2223-00000000”, “__DIR-CONTEXT=default”) in new stack
– Executing [s@ivr-20:4] Set(“SIP/2223-00000000”, “_IVR_CONTEXT_ivr-20=ivr-9”) in new stack
– Executing [s@ivr-20:5] Set(“SIP/2223-00000000”, “_IVR_CONTEXT=ivr-20”) in new stack
– Executing [s@ivr-20:6] GotoIf(“SIP/2223-00000000”, “1?begin”) in new stack
– Goto (ivr-20,s,9)
– Executing [s@ivr-20:9] Set(“SIP/2223-00000000”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing [s@ivr-20:10] Set(“SIP/2223-00000000”, “TIMEOUT(response)=5”) in new stack
– Response timeout set to 5
– Executing [s@ivr-20:11] Set(“SIP/2223-00000000”, “__IVR_RETVM=”) in new stack
– Executing [s@ivr-20:12] ExecIf(“SIP/2223-00000000”, “1|Background|custom/menu”) in new stack
– <SIP/2223-00000000> Playing ‘custom/menu’ (language ‘en’)
– Executing [s@ivr-20:13] WaitExten(“SIP/2223-00000000”, “|”) in new stack
== CDR updated on SIP/2223-00000000
– Executing [1@ivr-20:1] DBdel(“SIP/2223-00000000”, “”) in new stack
– Executing [1@ivr-20:2] Set(“SIP/2223-00000000”, “__NODEST=”) in new stack
– Executing [1@ivr-20:3] Goto(“SIP/2223-00000000”, “ivr-21|s|1”) in new stack
– Goto (ivr-21,s,1)
– Executing [s@ivr-21:1] Set(“SIP/2223-00000000”, “MSG=custom/hold”) in new stack
– Executing [s@ivr-21:2] Set(“SIP/2223-00000000”, “LOOPCOUNT=0”) in new stack
– Executing [s@ivr-21:3] Set(“SIP/2223-00000000”, “__DIR-CONTEXT=default”) in new stack
– Executing [s@ivr-21:4] Set(“SIP/2223-00000000”, “_IVR_CONTEXT_ivr-21=ivr-20”) in new stack
– Executing [s@ivr-21:5] Set(“SIP/2223-00000000”, “_IVR_CONTEXT=ivr-21”) in new stack
– Executing [s@ivr-21:6] GotoIf(“SIP/2223-00000000”, “1?begin”) in new stack
– Goto (ivr-21,s,9)
– Executing [s@ivr-21:9] Set(“SIP/2223-00000000”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing [s@ivr-21:10] Set(“SIP/2223-00000000”, “TIMEOUT(response)=2”) in new stack
– Response timeout set to 2
– Executing [s@ivr-21:11] Set(“SIP/2223-00000000”, “__IVR_RETVM=”) in new stack
– Executing [s@ivr-21:12] ExecIf(“SIP/2223-00000000”, “1|Background|custom/hold”) in new stack
– <SIP/2223-00000000> Playing ‘custom/hold’ (language ‘en’)
– Executing [s@ivr-21:13] WaitExten(“SIP/2223-00000000”, “|”) in new stack
– Timeout on SIP/2223-00000000, going to ‘t’
– Executing [t@ivr-21:1] Set(“SIP/2223-00000000”, “LOOPCOUNT=1”) in new stack
– Executing [t@ivr-21:2] GotoIf(“SIP/2223-00000000”, “0?s|begin”) in new stack
– Executing [t@ivr-21:3] DBdel(“SIP/2223-00000000”, “”) in new stack
– Executing [t@ivr-21:4] Set(“SIP/2223-00000000”, “__NODEST=”) in new stack
– Executing [t@ivr-21:5] Goto(“SIP/2223-00000000”, “cidlookup-custom|333|1”) in new stack
– Goto (cidlookup-custom,333,1)
– Executing [333@cidlookup-custom:1] MYSQL(“SIP/2223-00000000”, “Connect connid localhost root database_psswrd asterisk”) in new stack
– Executing [333@cidlookup-custom:2] MYSQL(“SIP/2223-00000000”, “Query resultid 1 SELECT ip_address FROM calledInfo WHERE extension LIKE ‘2221’”) in new stack
– Executing [333@cidlookup-custom:3] MYSQL(“SIP/2223-00000000”, “Fetch fetchid 2 ip_address”) in new stack
– Executing [333@cidlookup-custom:4] MYSQL(“SIP/2223-00000000”, “Clear 2”) in new stack
– Executing [333@cidlookup-custom:5] Verbose(“SIP/2223-00000000”, “192.168.8.89”) in new stack
192.168.8.89
– Executing [333@cidlookup-custom:6] Return(“SIP/2223-00000000”, “”) in new stack
== Spawn extension (cidlookup-custom, 333, 6) exited non-zero on 'SIP/2223-00000000’
localhost*CLI>

,

but now i got new problem, after the lookup, the called was exited.

“== Spawn extension (cidlookup-custom, 333, 6) exited non-zero on ‘SIP/2223-00000000’”

can you explain to me.did i missing some thing…??
thank you =)

can somebody help me…!!!

please…