Jump to content

CreateDialplan


Tim

Recommended Posts

Hi,

 

I'm trying to use the SOAP interface to automate the standard configuration we do for every domain we setup. By automating the repetitive tasks, I hope to decrease the amount of human error we experience in building a domain for a new customer. I have scripted much of process so far, but I ran into a problem building our standard Dialplan which has 4-6 entries depending upon the types of termination the client wants.

 

When I submit the XML below to the SOAP interface, I only see the final <Entry> option being built in the Dialplan. Is the CreateDialplan function capable of handling multiple dialplan routing entries? If not, how would you recommend getting around this limitation?

 

<?xml version="1.0" standalone="yes"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sns="http://www.pbxnsip.com/soap/pbx">
<env:Body>
 <sns:CreateDialplan>
  <Domain>localhost</Domain>
  <Name>Default Dialplan</Name>
  <Entry>
   <Preference>101</Preference>
   <Trunk>Outbound Trunk</Trunk>
   <Pattern>1XXXXXXXXXX</Pattern>
   <Replacement></Replacement>
  </Entry>
  <Entry>
   <Preference>102</Preference>
   <Trunk>Outbound Trunk</Trunk>
   <Pattern>XXXXXXXXXX</Pattern>
   <Replacement>1*</Replacement>
  </Entry>
 </sns:CreateDialplan>
</env:Body>
</env:Envelope>

 

--

Tim

pbxnsip version 3.2.0.3143 on CentOS 5.2

Link to comment
Share on other sites

Hi,

 

I'm trying to use the SOAP interface to automate the standard configuration we do for every domain we setup. By automating the repetitive tasks, I hope to decrease the amount of human error we experience in building a domain for a new customer. I have scripted much of process so far, but I ran into a problem building our standard Dialplan which has 4-6 entries depending upon the types of termination the client wants.

 

When I submit the XML below to the SOAP interface, I only see the final <Entry> option being built in the Dialplan. Is the CreateDialplan function capable of handling multiple dialplan routing entries? If not, how would you recommend getting around this limitation?

 

<?xml version="1.0" standalone="yes"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sns="http://www.pbxnsip.com/soap/pbx">
<env:Body>
 <sns:CreateDialplan>
  <Domain>localhost</Domain>
  <Name>Default Dialplan</Name>
  <Entry>
   <Preference>101</Preference>
   <Trunk>Outbound Trunk</Trunk>
   <Pattern>1XXXXXXXXXX</Pattern>
   <Replacement></Replacement>
  </Entry>
  <Entry>
   <Preference>102</Preference>
   <Trunk>Outbound Trunk</Trunk>
   <Pattern>XXXXXXXXXX</Pattern>
   <Replacement>1*</Replacement>
  </Entry>
 </sns:CreateDialplan>
</env:Body>
</env:Envelope>

 

--

Tim

pbxnsip version 3.2.0.3143 on CentOS 5.2

 

Currently, it is designed to create 1 dial plan at a time. What you can do though, in your program, instead of sending the multiple dialplans at the same time, you can send one at a time in a loop.

Link to comment
Share on other sites

Currently, it is designed to create 1 dial plan at a time. What you can do though, in your program, instead of sending the multiple dialplans at the same time, you can send one at a time in a loop.

 

I think I might not have been clear in what I am trying to create. I am trying to create 1 Dialplan with 4-6 Dialplan Entries. I tried calling CreateDialplan 2 times, first to create priority 101, then to create priority 102. After the second call, I get an error in the logs, "dialplan already exists".

 

[5] 2009/03/11 16:12:23: Receive SOAP request via HTTP interface 
<?xml version="1.0" standalone="yes"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sns="http://www.pbxnsip.com/soap/pbx">
<env:Body>
 <sns:CreateDialplan>
  <Domain>test5.aeoninc.net</Domain>
  <Name>Default Dialplan</Name>
  <Entry>
   <Preference>102</Preference>
   <Trunk>AEON Inc Outbound Trunk</Trunk>
   <Pattern>XXXXXXXXXX</Pattern>
   <Replacement>1*</Replacement>
  </Entry>
 </sns:CreateDialplan>
</env:Body>
</env:Envelope>

[9] 2009/03/11 16:12:23: Other parameter preference, 102 
[9] 2009/03/11 16:12:23: Other parameter trunk, AEON Inc Outbound Trunk 
[9] 2009/03/11 16:12:23: Other parameter pattern, XXXXXXXXXX 
[9] 2009/03/11 16:12:23: Other parameter replacement, 1* 
[5] 2009/03/11 16:12:23: dialplan already exists Default Dialplan 

 

--

Tim

Link to comment
Share on other sites

Oh I see! Looks like multiple "Entry" is not supported. We will fix it in the next release.

 

I think I might not have been clear in what I am trying to create. I am trying to create 1 Dialplan with 4-6 Dialplan Entries. I tried calling CreateDialplan 2 times, first to create priority 101, then to create priority 102. After the second call, I get an error in the logs, "dialplan already exists".

 

[5] 2009/03/11 16:12:23: Receive SOAP request via HTTP interface 
<?xml version="1.0" standalone="yes"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sns="http://www.pbxnsip.com/soap/pbx">
<env:Body>
 <sns:CreateDialplan>
  <Domain>test5.aeoninc.net</Domain>
  <Name>Default Dialplan</Name>
  <Entry>
   <Preference>102</Preference>
   <Trunk>AEON Inc Outbound Trunk</Trunk>
   <Pattern>XXXXXXXXXX</Pattern>
   <Replacement>1*</Replacement>
  </Entry>
 </sns:CreateDialplan>
</env:Body>
</env:Envelope>

[9] 2009/03/11 16:12:23: Other parameter preference, 102 
[9] 2009/03/11 16:12:23: Other parameter trunk, AEON Inc Outbound Trunk 
[9] 2009/03/11 16:12:23: Other parameter pattern, XXXXXXXXXX 
[9] 2009/03/11 16:12:23: Other parameter replacement, 1* 
[5] 2009/03/11 16:12:23: dialplan already exists Default Dialplan 

 

--

Tim

Link to comment
Share on other sites

Oh I see! Looks like multiple "Entry" is not supported. We will fix it in the next release.

 

Thank you for confirming that, is there anything I can do to work around it for now?

 

While at it, I'd like to throw a feature request out there. From what I have been playing with, there are 4 other functions that would be very helpful. I know it is probably too late to try to get them built and tested for the next release, but maybe functions similar to these could be put on the roadmap.

 

CreateDomain - I am currently doing this with posts to the web interface, which was quite fun to get that multi-part form to work. :) It would be much easier if I could create the domain within the SOAP calls as well.

DeleteDomain - I currently have not implemented anything to do this, but it looks like it would have to be done on the web interface as well.

 

CreateAccount - This is not a current need for us, but the ability to create an account, so we can use the DBGet/DBSet functions to finish provisioning it would be very helpful.

DeleteAccount - Delete an account in a domain

 

--

Tim

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...