How to have a Voice Elements application accept all calls except one number

From VESupport

Jump to: navigation, search

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">

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.

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.
Personal tools