
Modifying the dialplan for the new user
We still have a problem: we saw in the previous chapter how the "Local_Extension" in dialplan define how to route calls whenever "destination_number" (eg, what the caller dialed in hope to reach the callee) is matching the regular expression "^(10[01][0-9])$". This regex matches 1000...1019, and then send the call to the user with an "id" corresponding to the dialed number.
We must do one of two things: we can modify that already existing "Local_Extensions" so its condition matches 1020 too, or we can create a new extension in dialplan.
We can create a new extension in dialplan by copying all the "Local_Extension" XML snippet (from the opening "extension" tag to the closing "/extension" tag, both included). We may modify the new extension name attribute, but that's not required.
What is required is to change the "condition" on "destination_number" expression. We can change it to be: "^1020$", and it will match exactly and only a destination_number string variable equal to "1020" (caret is beginning of string placeholder, dollar sign is end of string placeholder).
Or, we can edit the already existing "Local_Extensions" so its "destination_number" condition matches 1020 too. There is more than one way to do this (as always with anything PERL related, and FreeSWITCH regexes are of the PERL flavor).
The original regex is "^(10[01][0-9])$", matching 1000...1019.
We can modify it to be "^(10[01][0-9]|1020)$", and it will match 21 dialed numbers: 1000...1019 and 1020.
Or, we can make it "^(10[012][0-9])$", and it will match 30 dialed numbers: 1000...1029.
Again, from FreeSWITCH command line (fs_cli), we need to reload configuration for the modified dialplan to become known to FreeSWITCH:
