Free Switch with 10+ digit regex validation?

424 views Asked by At

When we install Free-Switch... by default we will get 20 endpoints (1000.xml to 1019.xml).

  1. If we want to create our own endpoints like +919885098850 or +16308045480. How can we do that?

  2. Instead of creating static endpoints inside Free-Switch... how to create endpoints outside?

For ex: 1. We will create endpoints inside MySql database... 2. We will authenticate from SIP application 3. Then forward calls to Free -Switch 4. Free-Switch will forward call to destination endpoint.

Can some explain me how to achieve this scenario?

1

There are 1 answers

0
Jenish patel On BEST ANSWER
  1. You can create as many extensions as you want. The extension number 1000 to 1019 are just example extensions.

    what you need to do is just copy the 1000.xml and change the extension number from 1000 to 919885098850 and set a password for it.

    reload the freeswitch : /etc/init.d/freeswitch restart

    and then try to register your phone with Username : 919885098850 password : password in your xml Domain : your IP address

    That's all, you can now register 10 digit or 11 digit or whatever length extensions.

  2. Freeswitch authenticates the users or extensions on the basis of the directory users defined in the directory folder with names like 1000.xml or XXXXXXX.xml

    If you want to dynamically create and auth this extensions , you got 2 ways.

    • Either you write a service which will read data from your database and create one XML file in this folder
    • Another and personally my preferred way is using xml_curl module.

Trust me XML_CURL is best thing, I invested many hours in RnD just like your question and then in hard way I learned about xml_curl and it saved my day.