|
ChannelResourceDnis Property |
This is the DNIS or the inbound number dialed of the last inbound call.
Namespace:
VoiceElements.Client
Assembly:
VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax public string Dnis { get; }
Public ReadOnly Property Dnis As String
Get
public:
property String^ Dnis {
String^ get ();
}
member Dnis : string with get
Property Value
Type:
StringRemarks
If provided by the carrier or network, this is essentially the inbound number dialed by the party who placed the last inbound call. For more detail, see
What is a DNIS. This is typically used for assigning blocks of inbound numbers to different scripts or call flows.
in essence, you can write several applications and combine them into one, assigning different inbound numbers or blocks of numbers to each one in a single code base. you may also want to use DNIS for logging call activity in a database or even
applying routing or script rules based on the number, area code, prefix that has been called. Also helpful for this type of call filtering and available on an inbound call are the
ANI and the
Caller ID Name.
DNIS's Come in Many Forms
You may find that carriers will only pass the last four or seven numbers as the DNIS. Also, in a
SIP deployment, the DNIS will contain the originating SIP URI.
It is always a good idea to run a test in your production environment, log the exact DNIS format coming in and adjust your code accordingly.
Examples static void s_TelephonyServer_NewCall(object sender, VoiceElements.Client.NewCallEventArgs callArgs)
{
string m_Dnis = callArgs.ChannelResource.Dnis;
Log.Write("NewCall Arrival to {0}.", m_Dnis);
switch (m_Dnis)
{
case "2135551212":
RunScriptOne();
break;
case "4155551212":
case "9165551212":
RunScriptTwo();
break;
default:
RunScriptThree();
break;
}
}
Private Shared Sub s_TelephonyServer_NewCall(sender As Object, callArgs As VoiceElements.Client.NewCallEventArgs)
Dim m_Dnis As String = callArgs.ChannelResource.Dnis
Log.Write("NewCall Arrival to {0}.", m_Dnis)
Select Case m_Dnis
Case "2135551212"
RunScriptOne()
Exit Select
Case "4155551212", "9165551212"
RunScriptTwo()
Exit Select
Case Else
RunScriptThree()
Exit Select
End Select
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also