Howto:Variable Length Extension Numbers: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
(gpa - Howto use a mixed number lenght (orig. von Klaus W.) erstellt)
(No difference)

Revision as of 13:31, 13 August 2008

Summary

An old and not solved problem in telephony is that a number can’t have a mixed length. If in a PBX for example exists the number 300” it isn’t possible to dial the number 3001 in that PBX. Up to now! In a simple PBX a customer will not ask for something like that (hopefully), but imagine a network with more than one PBX. Where for example for “historical” reasons’ in two PBXes the “old” number should be conserved and of course the customer wants reach his colleague just dialing the well know number but now (in IP) without the ISDN prefix and so without any prefix. For example the customer wants to dial “300” or “3000” and reach the extension “300” (local) or the (remote) extension “3000”. In older times no way, and you have to convince the customer to dial a prefix, similar to the ISDN, and so for example “83000” to reach the remote guy. There are also scenarios like a legacy PBX connected to the innovaphone PBX, well know problems for an insider, where such a feature would be helpful. With a simple XML script you can now realize a “mixed” numbering plan with the same starting digits. Here is how to do that stuff.

Applies To

This information applies to

  • All V6 PBX platforms
  • Build v6 SR1 and later.

More Information

Problem Details

Of course also the innovaphone PBX will not accept mixed numbers with the same first digits. The basic problem is that dialing is a sequential issue, you dial one digit after the other and the question after each digit for a PBX is “is that the final destination or will other digits follow?” If for example you want to mix 3 digits and 4 digits numbers (“300” and “3000”) the solution is to wait, in your application, until the 4rd digit is entered. At the end of the story you force a kind of “block dial” for that specific numbers and that is a limit, but the customer will understand that (how should otherwise the system know?).

System Requirements

The feature is based on an XML script typically installed on the compact flash, it will work also on external Webdav sever.

Installation

You have to create a VM Object pointing on the XML script. The number of the VM Object has to fit with your unique numbering plan. Example: If in a PBX exist the number 330 in the same scenario you want to reach a remote user just dialing 3301 you have to capture the number 330 and so your VM Object hat to have that number.

XML analysis

The code of the XML is quite simple and can easily be modified. Please note that all the XML commands and even the structure is well described in the file “schema” which you will find in every innovaphone Voice-Mail installation. The XML performs the following steps: • captures the digits • controls if the configured number length is reached (in our code example: 3 (digits)) • waits for the dialing time-out (5 seconds) Now there are two cases: the number length is longer than the threshold of 3 or not, if yes the XML will insert an additional number (for example “8”) and transfer the call to that number (so to the number “83301”). Of course in the PBX you will have a connection to the far PBX with the prefix “8” and the job is done. In the timeout case the XML will just transfer the call to the number (“330”) and the extension will ring.

Code discussion (comment in cursive):

 <?xml version="1.0" encoding="utf-8" ?>     the usual header stuff
 <voicemail>
    <function define="Main">
      <assign out="$CodeLen" value="3"/>     Here you define the length of the digits, insert the number
      <assign out="$Prefix" value="8"/>   And here is the prefix to insert, in our example 8
      <assign out="$call" value=""/>    now first the variable $call is cleared
         <call name="CheckLEN"/>     and than the real function is called 
      <pbx-disc/>                              and that’s it.
   </function>
   <function define="CheckLEN">  here starts the function
       <wait sec="5"/>                    here you con define the timout, 5 seconds in our example
       <pbx-getcallinfo out-cgpn="$cgpn" out-cdpn="$cdpn" out-leg2="$leg2"/>  get the dialing information from the pbx
       <lib-strlen out="$res" string="$cdpn"/> and copy it in the $res variable
        <switch var="$res">                         and than check the length of the dialed number
          <case equal="$CodeLen">             if the length is equal the threshold
                  <assign out="$call" value="$cdpn"/>    just copy the dialed number in the $call variable
           </case> 
          <case not-equal="$CodeLen">           otherwise if the length is not equal copy the prefix
               <lib-strcat string="$Prefix" string2="$cdpn" out-string="$call" />   and the dialed number in the $call variable
           </case>
       </switch>
       <pbx-fwd e164="$call" out-cause="$cause"/>   and than transfer in both cases the call to the destination, witch means to the content of the $call variable
   </function>
 </voicemail>

Here again the code without any comment to copy in the xml object:

 <?xml version="1.0" encoding="utf-8" ?>
 <voicemail>
    <function define="Main">
      <assign out="$CodeLen" value="3"/>
      <assign out="$Prefix" value="0"/>
      <assign out="$call" value=""/>
         <call name="CheckLEN"/> 
      <pbx-disc/> 
   </function>
   <function define="CheckLEN">
       <wait sec="5"/>
       <pbx-getcallinfo out-cgpn="$cgpn" out-cdpn="$cdpn" out-leg2="$leg2"/>
       <lib-strlen out="$res" string="$cdpn"/>
        <switch var="$res">
          <case equal="$CodeLen">
                  <assign out="$call" value="$cdpn"/>
           </case>
          <case not-equal="$CodeLen">
               <lib-strcat string="$Prefix" string2="$cdpn" out-string="$call" />
           </case>
       </switch>
       <pbx-fwd e164="$call" out-cause="$cause"/>
   </function>
 </voicemail>

But you can also copy the XML file on your CF and edit it there. Please feel free to modify as you like.

Known Problems

Please note that for die Number 330 and 330x the behavior now will be “block dialing” with timeout.