CLIR (Command Line Interface Report) is used to display Asterisk debug information.
In order to get CLIR for a call:
Output information is used to pinpoint the problem; for example, if the call is not reaching its destination. Please read the instructions below on how to interpret the debug information:
AGI variables:
The first part of CLIR consist of variables that are being sent from Asterisk to us. It basically gives information about who is calling who, callerid, account code, channel type, and so on.
So let's describe some of these fields:
19:05:51 VAR: agi\_channel: SIP/1001-08185a40
This is channel type. It can be SIP, IAX2, or Zap depending on the incoming transport. In the previous version this was used to identify extensions, but it now uses the account code first (look below). If accountcode fails, then we go for this.
19:05:51 VAR: agi\_language: en
19:05:51 VAR: agi\_type: SIP
19:05:51 VAR: agi\_uniqueid: 1173377151.6
This is an important number. It tells us the unique id of the call. Each call has a unique number which consists of the current timestamp of the call. Recordings, CDRs, and CLIRs are all stored and linked up with this key.
It is important to remember that on certain actions, such as Queue exit and some types of transfers, this number is preserved. That means that 3 or 4 separate calls can have 1 single unique id. That is how we link them up on the CDR page in the latest versions.
19:05:51 VAR: agi\_callerid: 1001
This tells us the caller id.
19:05:51 VAR: agi\_calleridname: x-lite
This is the name part of the caller id. Previously, these two variables were showed as: x-lite <100> and were parsed like that. But they are now two separate fields.
19:05:51 VAR: agi\_callingpres: 0
19:05:51 VAR: agi\_callingani2: 0
19:05:51 VAR: agi\_callington: 0
19:05:51 VAR: agi\_callingtns: 0
19:05:51 VAR: agi\_dnid: \*149
19:05:51 VAR: agi\_rdnis: unknown
19:05:51 VAR: agi\_context: default
Another important field is the context we are in. If the context is ‘default’, it means that it is a local call (extension to extension, extension to outside).
If the context is the name of the trunk, it means it is an incoming call. In such contexts, only DIDs are allowed. That is why you may have CLIRs which say ‘Destination not found’ because we do not allow anything except DIDs.
There are several other contexts that essentially tell PBXware what limitations are to be performed.
When we are in ‘transfer’ context, there are no limitations for destinations.
19:05:51 VAR: agi\_extension: \*149
Extension that is being called. This tells us it is *149.
19:05:51 VAR: agi\_priority: 1
19:05:51 VAR: agi\_enhanced: 0.0
19:05:51 VAR: agi\_accountcode: 1001
This variable will be used to identify local extensions.
Now we are going to identify the second part of the CLIR. It consist of three parts:
The TIME command-to-be-performed result-from-asterisk
Command to be performed can be of two types:
If it begins with APP: it means that we tell Asterisk to do something.
If it doesn’t being with APP: it means we are just echoing some debug information so we can easily track what is going on if there is a problem.
result-from-asterisk usually consist of result=something, and it really is useful only for APP: entries as that is when we actually would like to read some result from Asterisk.
So, lets begin:
19:05:51 APP: get variable TRANSFER\_PARENT 200 result=0
Here we ask Asterisk for TRANSFER_PARENT variable. As you can see Asterisk said result=0, meaning there is no such variable. If the result was something like this result=1131023912.1 then it means the variable is set.
This variable tells us that we are either part of a transferred call or we are basically a new call. This works only for Blind transfers and normal transfers. Attendant transfers are shown as new calls and therefore TRANSFER_PARENT equals 0 there.
19:05:51 APP: set variable \_\_TRANSFER\_PARENT 1173377151.6 200 result=1
Here we set TRANSFER_PARENT variable with our current uniqueid. Note the __ before variable: it means that Asterisk should copy this variable to all calls that follow up this one.
19:05:51 Detected accountcode '1001' ... 200 result=1
Ok, this means we detected accountcode 1001 from agi_accountcode.
19:05:51 APP: get variable BLINDTRANSFER 200 result=0
Checking for Blind transfer. What does this mean? If somebody transferred a 3rd party, it means we have to force a ‘transfer’ context which will allow that party to be transffered to ANY extension. This is might be a security risk, but it is the only way to transfer 3rd party successfully.
19:05:51 '\*149' is not in DID database, continuing ... 200 result=1
Ok, now we check if *149 is in DID database. Why are we doing this? Well for two reasons:
19:05:51 Set limit - 246 200 result=1
Ok, here we set a limit on global level. At the moment this tells us we set limit to 246 global calls.
19:05:51 Limit not exceeded (1 < 246) for localextensions 200 result=1
Now we compare global limit to current number of calls. This is the first call so we are continuing. If we reached the limit we wouldn’t progress with the call.
19:05:51 Set limit - 3 200 result=1
Now we print out the limit for this particular extension. At the moment it is 3 for outgoing.
19:05:51 Limit not exceeded (1 < 3) for 1001\_out 200 result=1
We compare this with current number of outgoing calls for extension 1001. This is first call so all is fine.
19:05:51 Set limit - 9999 200 result=1
Now we echo limit for special types. Special type is basically whatever begins with * as that is special type of an extension for us.
19:05:51 Limit not exceeded (1 < 9999) for special\_in 200 result=1
We continue.
19:05:51 Lastcaller enabled 200 result=1
We check if the Lastcaller (*149) is enabled for this particular extension. It is enabled, so we progress.
19:05:51 APP: answer 200 result=0
We answer the call.
19:05:51 Playing macro 'last-num-to-call' ... 200 result=1
Now we echo out that we will stream a file to the other party.
19:05:53 APP: stream file last-num-to-call 200 result=0 endpos=19040
We are streaming the file out.
19:05:53 APP: exec SayDigits unknown 200 result=0
Now we are executing SayDigits with ‘unknown’. This will actually never work, as SayDigits can only ‘say’ numbers. This is just an example of how *149 won’t work if there wasn’t any CallerID.
19:05:53 APP: exec Set TIMEOUT(digit)=3 200 result=0
19:05:53 APP: exec Set TIMEOUT(response)=6 200 result=0
19:05:53 APP: answer 200 result=0
Now we are setting some timeouts. We are basically saying that after digit is pressed we are waiting additional 3 seconds for next digit. We are also saying that global response timeout is 6 seconds, meaning if nothing is entered in 6 seconds, we consider that as end of input.
19:05:53 Playing macro 'to-call-this-number' ... 200 result=1
19:05:55 APP: stream file to-call-this-number 200 result=0 endpos=11040
Now we are streaming a file.
19:05:55 APP: exec Set TIMEOUT(response)=5 200 result=0
19:05:55 APP: exec Set TIMEOUT(digit)=3 200 result=0
We are re-resetting that limit again.
19:05:59 APP: exec read dtmfdata|press\_one 200 result=0
Now we execute application READ and we tell asterisk to play out file ‘press_one’ and if a digit is pressed to store that in dtmfdata variable. You can find description for each application from CLIR by going to Asterisk and saying: show application read, or for functions such as TIMEOUT() you would say show function TIMEOUT. It will tell you much more info.
19:05:59 APP: get variable dtmfdata 200 result=1 (1)
Now we check if 1 is pressed. If it is pressed we continue. As you can see 1 is in brackets (1), so it means it is pressed.
19:05:59 Checking for 'Other Network' prefix ... 200 result=1
So now we check if there is any Other Network prefix allocated with extension ‘unknown’. Of course this will never work!
19:05:59 Detecting destination for '38732unknown' ... 200 result=1
Since we are not Other Network, we now check the route.
19:05:59 Destination range -- Max: 7, Min: 1 200 result=1
19:05:59 Found Destination proper (route 135, range 38700 - 38732) 200 result=1
We found a route ‘135’ (that is probably Bosnia-Herzegovina, check route id in URL in Settings > Destinations in GUI). As you can see althought the number is completely wrong we are passing it thru because we have a range of 38730 - 38732. So we allow anything that begins with 38732.
19:05:59 Setting destination 'proper' ... 200 result=1
So this is group ‘proper’ so we echo that out.
19:05:59 APP: exec Set TIMEOUT(absolute)=3600 200 result=0
19:05:59 Setting AbsoluteTimeout to 3600 seconds ... 200 result=1
Now we are setting absolute timeout for a particular call. We allow only 1 hour.
19:05:59 Checking for Time Based Dialing data ... 200 result=1
Now we check for Time Based Dialling. That would be Settings > TBD. I am not sure if this works anymore.
19:05:59 Found primary trunk '032445231' ... 200 result=1
So, we were searching for the trunk and we found a primary trunk 032445231 for this particular destination.
19:06:00 Secondary trunk set as '-- None --', skipping it ... 200 result=1
19:06:00 Tertiary trunk set as '-- None --', skipping it ... 200 result=1
Since there were no other trunks, we are skipping them.
19:06:00 Detecting LCR data ... 200 result=1
So, above trunks where from Settings > Default Trunks. Now we try to fetch LCR data from either global LCR table (Settings > miniLCR or in newer menu LCR) or from LCR table in extensions. There is no trunks in there so we didn’t find anything.
19:06:00 APP: get variable CALLERID 200 result=1 ("gloCOM" )
19:06:00 Setting backup CallerID to 'gloCOM' ... 200 result=1
We are saving our previous CallerID.
19:06:00 Set limit - 246 200 result=1
19:06:00 Limit not exceeded (1 < 246) for remote 200 result=1
19:06:00 Set limit - 246 200 result=1
19:06:00 Limit not exceeded (1 < 246) for zaptel 200 result=1
Again we check for limits. First we try remote and then we try zaptel as we found a zaptel trunk.
19:06:00 Trunk does not support E164 ... 200 result=1
This is important info. It tells us trunk is not set for E164 so there will be some number translation happening.
19:06:00 Dialing over Zaptel protocol ... 200 result=1
19:06:00 APP: set variable DYNAMIC_FEATURES automon 200 result=1
19:06:00 APP: set variable TOUCH_MONITOR_SILENT FALSE 200 result=1
19:06:00 APP: exec Set MONITOR_EXEC=|g 200 result=0
19:06:00 APP: set variable TOUCH_MONITOR_ARGS wav49|1173377151.6|m 200 result=1
19:06:00 APP: set variable TOUCH_MONITOR_START_SOUND recorded 200 result=1
19:06:00 APP: set variable TOUCH_MONITOR_STOP_SOUND beep 200 result=1
These options are setting recording stuff. As we can see ‘automon’ is enabled, that is basically ‘Instant Recording’ in our interface (when you are in the call and want to start recording by inputing access code). So watch all TOUCH_MONITOR_* variables and it will tell you that we will play out recorded on start, and beep on stop. We will also save file as wav49 and as our current uniqueid.
MONITOR_EXEC is a global recording variable and is not related to ‘Instant Recording’ but rather for ‘Record Calls’ option in Extension. Watch that out for additional options. At the moment as you can see it is empty, so it means that the Recording is set to ‘off’.
19:06:06 APP: exec Dial ZAP/G1/32unknown|| 200 result=-1
Now we are dialling out.
19:06:06 APP: get variable DIALSTATUS 200 result=1 (ANSWER)
19:06:06 APP: get variable ANSWEREDTIME 200 result=1 (4)
We are checking for state of the call (is it ANSWERED, BUSY..) and if it is ANSWERED, we check how long did the call last.
19:06:06 Total time: 4 200 result=1
We print out total time.
Now we check one incoming call:
19:02:22 VAR: agi_network: yes
19:02:22 VAR: agi_request: agi://127.0.0.1
19:02:22 VAR: agi_channel: Zap/2-1
This is Zaptel based call.
19:02:22 VAR: agi_language: us
19:02:22 VAR: agi_type: Zap
19:02:22 VAR: agi_uniqueid: 1173376937.3
19:02:22 VAR: agi_callerid: unknown
19:02:22 VAR: agi_calleridname: unknown
19:02:22 VAR: agi_callingpres: 0
19:02:22 VAR: agi_callingani2: 0
19:02:22 VAR: agi_callington: 0
19:02:22 VAR: agi_callingtns: 0
19:02:22 VAR: agi_dnid: unknown
19:02:22 VAR: agi_rdnis: unknown
19:02:22 VAR: agi_context: 032445231
Remember this? This tells us this is a trunk incoming call.
19:02:22 VAR: agi_extension: s
And it also tells us that it is an anologue trunk as it went for extension ‘s’. On TDM-based cards, we cannot know our own number.
19:02:22 VAR: agi_priority: 1
19:02:22 VAR: agi_enhanced: 0.0
19:02:22 VAR: agi_accountcode:
As you can see no accountcode.
19:02:22 APP: get variable TRANSFER_PARENT 200 result=0
19:02:22 APP: set variable __TRANSFER_PARENT
1173376937.3 200 result=1
19:02:22 APP: set variable DNID unknown 200 result=1
19:02:22 APP: get variable Referen