Programmable Voice

  1. Home
  2. Docs
  3. Programmable Voice
  4. How do I
  5. Have a Voice Elements Application Accept all Calls Except One Number

Have a Voice Elements Application Accept all Calls Except One Number

Question: Is there a way for us to set up a VE machine take calls on all numbers “except” 1 number? I know we can list out all of the numbers we want to listen to, however that is not much fun when we have 400 numbers. We would like to have one machine listen to all numbers except a test number.

Answer: HMPE (HMP Elements) has to respond to all calls that are presented to it. To have a particular VE application accept all calls except one number, do this in your incoming logic:

First of all there is a setting called:

           
<setting name="SessionProgressControlledByApp" serializeAs="String">
    <value>False</value>
</setting>

When this is set, HMPE will not send the SESSION PROGRESS until instructed to do so. This is helpful if you plan on rejecting calls.

In your new call event code, you would:

if (channelResource.Dnis == "3032345678")
{
   channeResource.Disconnect(503);           // This tells HMPE to REJECT the call with a 503 Service Not Available, you could also send Disconnect() and that would return a 486 busy here.
   return;
}

SipChannel sipChannel = channelResource as SipChannel;
if (sipChannel!=null) sc.AcceptCall();                       // This sends the SESSION PROGRESS if the Setting above is set to TRUE.

...  Continue on and Answer the call.
Was this article helpful to you? Yes 8 No

How can we help?