ERROR: Invalid command syntax

Hi,

I have installed Asterisk 1.2.24 and FreePBX 2.3.0. It is not my forst installation of asterisk and FreePBX but for the first time I have this issue and I don’t know how to fix it. I tried many different thoings but none worked.

I set up two extensions 1001 and 1002. The problem is that whenever I make a call from eatherone of the extensions I get the error: 520-Invalid command syntax.

Check below the excerpt of the log.

I really appreciate any advice you could give me.

– Executing Macro(“SIP/1002-08410ef8”, “exten-vm|novm|1001”) in new stack
– Executing Macro(“SIP/1002-08410ef8”, “user-callerid”) in new stack
– Executing NoOp(“SIP/1002-08410ef8”, “user-callerid: device 1002”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “AMPUSER=1002”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “0?report”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “0?start”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “REALCALLERIDNUM=1002”) in new stack
– Executing NoOp(“SIP/1002-08410ef8”, “REALCALLERIDNUM is 1002”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “AMPUSER=1002”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “AMPUSERCIDNAME=User 2”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “0?report”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “AMPUSERCID=1002”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “CALLERID(all)=“User 2” <1002>”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “REALCALLERIDNUM=1002”) in new stack
– Executing NoOp(“SIP/1002-08410ef8”, “TTL: ARG1: novm”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “0?continue”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “__TTL=64”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,23)
– Executing NoOp(“SIP/1002-08410ef8”, “Using CallerID “User 2” <1002>”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “FROMCONTEXT=exten-vm”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “VMBOX=novm”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “EXTTOCALL=1001”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “CFUEXT=”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “CFBEXT=”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “RT=”) in new stack
– Executing Macro(“SIP/1002-08410ef8”, “record-enable|1001|IN”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing AGI(“SIP/1002-08410ef8”, “recordingcheck|20071015-165948|1192481988.2”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
AGI Tx >> agi_request: recordingcheck
AGI Tx >> agi_channel: SIP/1002-08410ef8
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1192481988.2
AGI Tx >> agi_callerid: 1002
AGI Tx >> agi_calleridname: User 2
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 1001
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: macro-record-enable
AGI Tx >> agi_extension: s
AGI Tx >> agi_priority: 4
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << GET VARIABLE ARG2
AGI Tx >> 200 result=1 (IN)
AGI Rx << GET VARIABLE ARG1
AGI Tx >> 200 result=1 (1001)
AGI Rx << DATABASE GET “AMPUSER\ “1001/recording"
AGI Tx >> 520-Invalid command syntax. Proper usage follows:
AGI Tx >> Usage: DATABASE GET
Retrieves an entry in the Asterisk database for a
given family and key.
Returns 0 if is not set. Returns 1 if
is set and returns the variable in parentheses.
Example return code: 200 result=1 (testvariable)
AGI Tx >> 520 End of proper usage.
AGI Rx << VERBOSE “Inbound recording not enabled” 1
recordingcheck|20071015-165948|1192481988.2: Inbound recording not enabled
AGI Tx >> 200 result=1
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/1002-08410ef8”, “No recording needed”) in new stack
– Executing Macro(“SIP/1002-08410ef8”, “dial||tr|1001”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing AGI(“SIP/1002-08410ef8”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
AGI Tx >> agi_request: dialparties.agi
AGI Tx >> agi_channel: SIP/1002-08410ef8
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1192481988.2
AGI Tx >> agi_callerid: 1002
AGI Tx >> agi_calleridname: User 2
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 1001
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: macro-dial
AGI Tx >> agi_extension: s
AGI Tx >> agi_priority: 3
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << VERBOSE “Starting New Dialparties.agi” 1
dialparties.agi: Starting New Dialparties.agi
AGI Tx >> 200 result=1
AGI Rx << GET VARIABLE AMPMGRUSER
AGI Tx >> 200 result=1 (admin)
AGI Rx << GET VARIABLE AMPMGRPASS
AGI Tx >> 200 result=1 (amp111)
AGI Rx << GET VARIABLE CWINUSEBUSY
AGI Tx >> 200 result=1 (false)
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
AGI Rx << GET VARIABLE priority
AGI Tx >> 200 result=0
AGI Rx << VERBOSE “Caller ID name is ‘User 2’ number is ‘1002’” 1
dialparties.agi: Caller ID name is ‘User 2’ number is '1002’
AGI Tx >> 200 result=1
AGI Rx << SET VARIABLE __KEEPCID “TRUE"
AGI Tx >> 200 result=1
AGI Rx << SET VARIABLE DIALSTATUS_CW ““
AGI Tx >> 200 result=1
AGI Rx << GET VARIABLE ARG1
AGI Tx >> 200 result=1 ()
AGI Rx << GET VARIABLE ARG2
AGI Tx >> 200 result=1 (tr)
AGI Rx << GET VARIABLE RingGroupMethod
AGI Tx >> 200 result=0
AGI Rx << GET VARIABLE ALERT_INFO
AGI Tx >> 200 result=0
AGI Rx << GET VARIABLE SIPADDHEADER
AGI Tx >> 200 result=0
AGI Rx << GET VARIABLE PR_DIALSTATUS
AGI Tx >> 200 result=0
AGI Rx << GET VARIABLE FMGRP
AGI Tx >> 200 result=0
AGI Rx << GET VARIABLE NODEST
AGI Tx >> 200 result=0
AGI Rx << GET VARIABLE RINGGROUP_INDEX
AGI Tx >> 200 result=0
AGI Rx << GET VARIABLE USE_CONFIRMATION
AGI Tx >> 200 result=0
AGI Rx << VERBOSE “USE_CONFIRMATION: ‘FALSE’” 5
AGI Tx >> 200 result=1
AGI Rx << VERBOSE “RINGGROUP_INDEX: ‘’” 5
AGI Tx >> 200 result=1
AGI Rx << VERBOSE “Methodology of ring is ‘none’” 1
dialparties.agi: Methodology of ring is 'none’
AGI Tx >> 200 result=1
AGI Rx << GET VARIABLE ARG3
AGI Tx >> 200 result=1 (1001)
AGI Rx << VERBOSE “Added extension 1001 to extension map” 3
– dialparties.agi: Added extension 1001 to extension map
AGI Tx >> 200 result=1
AGI Rx << GET VARIABLE ARG4
AGI Tx >> 200 result=0
AGI Rx << DATABASE GET “CF\ “1001"
AGI Tx >> 520-Invalid command syntax. Proper usage follows:
AGI Tx >> Usage: DATABASE GET
Retrieves an entry in the Asterisk database for a
given family and key.
Returns 0 if is not set. Returns 1 if
is set and returns the variable in parentheses.
Example return code: 200 result=1 (testvariable)
AGI Tx >> 520 End of proper usage.
AGI Rx << VERBOSE “Extension 1001 has call forward set to Invalid command syntax. Proper usage follows:” 1
dialparties.agi: Extension 1001 has call forward set to Invalid command syntax. Proper usage follows:
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Usage: DATABASE GET " 1
dialparties.agi: Usage: DATABASE GET
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Retrieves an entry in the Asterisk database for a” 1
dialparties.agi: Retrieves an entry in the Asterisk database for a
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " given family and key.” 1
dialparties.agi: given family and key.
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Returns 0 if is not set. Returns 1 if " 1
dialparties.agi: Returns 0 if is not set. Returns 1 if
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " is set and returns the variable in parentheses.” 1
dialparties.agi: is set and returns the variable in parentheses.
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Example return code: 200 result=1 (testvariable)” 1
dialparties.agi: Example return code: 200 result=1 (testvariable)
AGI Tx >> 200 result=1
AGI Rx << VERBOSE “” 1
dialparties.agi:
AGI Tx >> 200 result=1
AGI Rx << VERBOSE “Primary ext is CF so disabling mastermode if it was set” 4
AGI Tx >> 200 result=1
AGI Rx << DATABASE GET “CW\ “Invalid command syntax. Proper usage follows:
AGI Tx >> 520-Invalid command syntax. Proper usage follows:
AGI Tx >> Usage: DATABASE GET
Retrieves an entry in the Asterisk database for a
given family and key.
Returns 0 if is not set. Returns 1 if
is set and returns the variable in parentheses.
Example return code: 200 result=1 (testvariable)
AGI Tx >> 520 End of proper usage.
AGI Rx << Usage: DATABASE GET
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Retrieves an entry in the Asterisk database for a
AGI Tx >> 510 Invalid or unknown command
AGI Rx << given family and key.
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Returns 0 if is not set. Returns 1 if
AGI Tx >> 510 Invalid or unknown command
AGI Rx << is set and returns the variable in parentheses.
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Example return code: 200 result=1 (testvariable)
AGI Tx >> 510 Invalid or unknown command
AGI Rx << #“
AGI Tx >> 510 Invalid or unknown command
AGI Rx << DATABASE GET “CFB\ “Invalid command syntax. Proper usage follows:
AGI Tx >> 520-Invalid command syntax. Proper usage follows:
AGI Tx >> Usage: DATABASE GET
Retrieves an entry in the Asterisk database for a
given family and key.
Returns 0 if is not set. Returns 1 if
is set and returns the variable in parentheses.
Example return code: 200 result=1 (testvariable)
AGI Tx >> 520 End of proper usage.
AGI Rx << Usage: DATABASE GET
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Retrieves an entry in the Asterisk database for a
AGI Tx >> 510 Invalid or unknown command
AGI Rx << given family and key.
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Returns 0 if is not set. Returns 1 if
AGI Tx >> 510 Invalid or unknown command
AGI Rx << is set and returns the variable in parentheses.
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Example return code: 200 result=1 (testvariable)
AGI Tx >> 510 Invalid or unknown command
AGI Rx << #“
AGI Tx >> 510 Invalid or unknown command
AGI Rx << DATABASE GET “CFU\ “Invalid command syntax. Proper usage follows:
AGI Tx >> 520-Invalid command syntax. Proper usage follows:
AGI Tx >> Usage: DATABASE GET
Retrieves an entry in the Asterisk database for a
given family and key.
Returns 0 if is not set. Returns 1 if
is set and returns the variable in parentheses.
Example return code: 200 result=1 (testvariable)
AGI Tx >> 520 End of proper usage.
AGI Rx << Usage: DATABASE GET
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Retrieves an entry in the Asterisk database for a
AGI Tx >> 510 Invalid or unknown command
AGI Rx << given family and key.
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Returns 0 if is not set. Returns 1 if
AGI Tx >> 510 Invalid or unknown command
AGI Rx << is set and returns the variable in parentheses.
AGI Tx >> 510 Invalid or unknown command
AGI Rx << Example return code: 200 result=1 (testvariable)
AGI Tx >> 510 Invalid or unknown command
AGI Rx << #“
AGI Tx >> 510 Invalid or unknown command
AGI Rx << VERBOSE “extnum Invalid command syntax. Proper usage follows:” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Usage: DATABASE GET " 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Retrieves an entry in the Asterisk database for a” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " given family and key.” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Returns 0 if is not set. Returns 1 if " 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " is set and returns the variable in parentheses.” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Example return code: 200 result=1 (testvariable)” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE “# has: cw: 1; hascfb: 1 [Invalid or unknown command] hascfu: 1 [Invalid or unknown command]” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE “Built External dialstring component for Invalid command syntax. Proper usage follows:” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Usage: DATABASE GET " 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Retrieves an entry in the Asterisk database for a” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " given family and key.” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Returns 0 if is not set. Returns 1 if " 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " is set and returns the variable in parentheses.” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Example return code: 200 result=1 (testvariable)” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE “: Local/Invalid command syntax. Proper usage follows:” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Usage: DATABASE GET " 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Retrieves an entry in the Asterisk database for a” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " given family and key.” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Returns 0 if is not set. Returns 1 if " 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " is set and returns the variable in parentheses.” 4
AGI Tx >> 200 result=1
AGI Rx << VERBOSE " Example return code: 200 result=1 (testvariable)” 4
AGI Tx >> 200 result=1
== Manager ‘admin’ logged off from 127.0.0.1
AGI Rx << VERBOSE “@from-internal/n” 4
AGI Tx >> 200 result=1
AGI Rx << SET VARIABLE ds "Local/Invalid command syntax. Proper usage follows:\n Usage: DATABASE GET \n Retrieves an entry in the Asterisk database for a\n given family and key.\n Returns 0 if is not set. Returns 1 if \n is set and returns the variable in parentheses.\n Example return code: 200 result=1 (testvariable)\[email protected]/n||tr"
AGI Tx >> 200 result=1
AGI Rx << SET PRIORITY 10
AGI Tx >> 200 result=0
– AGI Script dialparties.agi completed, returning 0
– Executing Dial(“SIP/1002-08410ef8”, “Local/Invalid command syntax. Proper usage follows:n Usage: DATABASE GET n Retrieves an entry in the Asterisk database for an given family and key.n Returns 0 if is not set. Returns 1 if n is set and returns the variable in parentheses.n Example return code: 200 result=1 (testvariable)[email protected]/n||tr”) in new stack
== Everyone is busy/congested at this time (1:0/0/1)
– Executing Set(“SIP/1002-08410ef8”, “DIALSTATUS=CHANUNAVAIL”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “SV_DIALSTATUS=CHANUNAVAIL”) in new stack
– Executing GosubIf(“SIP/1002-08410ef8”, “0?docfu|1”) in new stack
– Executing GosubIf(“SIP/1002-08410ef8”, “0?docfb|1”) in new stack
– Executing Set(“SIP/1002-08410ef8”, “DIALSTATUS=CHANUNAVAIL”) in new stack
– Executing NoOp(“SIP/1002-08410ef8”, “Voicemail is novm”) in new stack
– Executing GotoIf(“SIP/1002-08410ef8”, “1?s-CHANUNAVAIL|1”) in new stack
– Goto (macro-exten-vm,s-CHANUNAVAIL,1)
– Executing PlayTones(“SIP/1002-08410ef8”, “congestion”) in new stack
== Spawn extension (macro-exten-vm, s-CHANUNAVAIL, 1) exited non-zero on ‘SIP/1002-08410ef8’ in macro ‘exten-vm’
== Spawn extension (macro-exten-vm, s-CHANUNAVAIL, 1) exited non-zero on ‘SIP/1002-08410ef8’

Thanks

something appears very corrupt here. Make sure that the real dialparties.agi (which gets copied from /var/www/html/admin/modules/core/agi-bin) is what is there and there are not permission issues that have resulted in some problem. And/or try re-installing.

This is the first thing I checked. The permissions are OK and I don’t think there is something wrong with the agi files.

At the beginning I decided it is a configuration issue but I found out something really weird. if I started asterisk on the console with the -c key it was working, on the contrary never worked as a daemon. I decided to run asterisk specifying a config file with the -C key and I put a dummy innvalid file. This broke astersik completely. Now it wont work either way. Something permanently has changed. But what? And why there was a difference?

Any ideas?

Thanks

P.S. I reinstalled 3 times so far always with the same result.

Is it only me who encountered this problem???