Hi Guys,
Through putty using telnet i am connecting to asterisk 11. Trying to edit/modify config files using updateconfig action. In this case i am trying to add a new user and my action command looks as follows
action: updateconfig
reload:yes
srcfilename: users.conf
dstfilename: users.conf
action-000000: Insert
Cat-000000: default
Var-000000: type
Value-000000: peer
Var-000000: username
Value-000000: 1064
Var-000000: host
Value-000000: dynamic
Var-000000: secret
Value-000000: 1064
Var-000000: context
Value-000000: default
Var-000000: hasiax
Value-000000: no
Var-000000: hassip
Value-000000: yes
Var-000000: icesupport
Value-000000: yes
Var-000000: callcounter
Value-000000: yes
While doing so, i got error message like
Response: Error
Message: Problem with category, value, or line (if required)
i surfed a lot and didn’t able to sort this out.
Could anyone please help me on this.
Thanks
Vijay
Why do you have more than one Var-000000?
Note the other parameter, besides var, needed for insert:
} else if (!strcasecmp(action, "insert")) {
if (ast_strlen_zero(var) || ast_strlen_zero(line)) {
result = UNSPECIFIED_ARGUMENT;
break;
}
Thanks for the reply david,
I am trying to add a new extension to users.conf file through manager action command.
For adding a new users the details should be in a following format
[1064]
type: peer
username: 1064
host: dynamic
secret: 1064
context: default
hasiax: no
hassip: yes
icesupport: yes
callcounter: yes
so i am trying to achieve this through Manager action command in asterisk java. While try to execute that i am getting the error as mentioned in my first post.
Is there anything else i need to do in order to make it work?
Regards
Vijay
Yes. See my previous reply.
(Note. A very small number of people in the whole world probably write code for this interface, but there are probably examples in widely used software, including, I would guess, FreePBX.)
Hi David,
The reason for more than one Var-000000?
In order to insert a new user , we need details like context,type,host etc. so i included everything in the updateconfig command so i can add all the content to config file.
Whether i need to update the following code in my config file
[b][i]} else if (!strcasecmp(action, "insert")) {
if (ast_strlen_zero(var) || ast_strlen_zero(line)) {
result = UNSPECIFIED_ARGUMENT;
break;
}[/i][/b]
I don’t know where to add this content.
Regards
Vijay
Why do you think the documentation says “beginning” in “X’s represent a 6 digit number beginning with 000000”?
The code fragment is code that is already present, and is the code that makes the decision to reject your request with the specific error message that you are getting. If you have enough programming skills to take on the job, it should tell you which parameter you are missing.
updateconfig is a rather specialised AMI action (mainly used in "GUI"s. I’ve never used it and my response is based on a very short time reading the documentation and searching the source code. There is quite a good chance that no-one else on this forum has used it.
On the other hand, there are some very well known open source applications that do dynamically modify configuration files, which you could use as examples.