asteriskasteriskami

Updateconfig Asterisk extensions.conf


I am using Asterisk 13. I am trying to modify extensions.conf using AMI.

The line in extensions.conf I'm trying to modify looks like:

Line-000021-000012: exten=_X.,50005,Dial(${dev},20)

I'm trying to change the number of these line 20 by 30. Using telnet to port 5038 I enter the following:

action:updateconfig
srcfilename:extensions.conf
dstfilename:extensions.conf
Action-000000: update
Cat-000000: stdexten
Var-000000: exten
Value-000000:>_X.,50005,Dial(${dev},30)

This results in:

Response: Success  

This action change the Line-000021-000000, but I need to change the Line-000021-000012. How can I do it? Any suggestions?

PD: When I use "Var-000012" instead of "Var-000000" the request is an error.


Solution

  • I have found the solution:

    action:updateconfig
    srcfilename:extensions.conf
    dstfilename:extensions.conf
    Action-000000: update
    Cat-000000: stdexten
    Var-000000: exten
    Match-000000: _X.,50005,Dial(${dev},20)
    Value-000000:>_X.,50005,Dial(${dev},30)