locked
Capturing DNIS, ANI and Trunk RRS feed

  • Question

  • Hello all,
     
    Are these the correct properties for getting DNIS, ANI and Trunk?
     
    strANI = Me.TelephonySession.CallInfo.CallingParty.Uri.ToString
    strDNIS = Me.TelephonySession.CallInfo.CalledParty.Uri.ToString
    strTrunk = Me.TelephonySession.CallInfo.CallReferenceInfo.TrunkId.ToString
     
    The results I get look like this. Can I assume I'll have to parse out the values I need (i.e. 7636, 7329342100)?
    Also does anyone know why I would get a Trunk of -1
     
    DNIS is : sip:7636@10.1.9.14
    ANI is : sip:7329342100@10.1.9.144
    Trunk is : -1
     
    Thanks
     
    Wednesday, May 16, 2007 8:33 PM

Answers

  • Almost -- instead you want this:

     

    strANI = Me.TelephonySession.CallInfo.CallingParty.Uri.User;
      strDNIS = Me.TelephonySession.CallInfo.CalledParty.Uri.User;

    In general you only want to use ToString() for display and debugging; you don't want to rely on being able to parse it.

     

    As for the trunk: that's because we can only give you the trunk/channel/port if the SIP peer sends it to us. We have defined a header for that purpose, but at this point the only SIP peer that uses that header is our own TIMC component (used for working with legacy MSS 2004 telephony hardware.) If your gateway has the trunk and sends it on some other header, you can access that header in the CallInfo.RemoteHeaders collection.

    Wednesday, May 16, 2007 10:15 PM

All replies

  • Almost -- instead you want this:

     

    strANI = Me.TelephonySession.CallInfo.CallingParty.Uri.User;
      strDNIS = Me.TelephonySession.CallInfo.CalledParty.Uri.User;

    In general you only want to use ToString() for display and debugging; you don't want to rely on being able to parse it.

     

    As for the trunk: that's because we can only give you the trunk/channel/port if the SIP peer sends it to us. We have defined a header for that purpose, but at this point the only SIP peer that uses that header is our own TIMC component (used for working with legacy MSS 2004 telephony hardware.) If your gateway has the trunk and sends it on some other header, you can access that header in the CallInfo.RemoteHeaders collection.

    Wednesday, May 16, 2007 10:15 PM
  • Thanks Dan!
    Monday, May 21, 2007 5:01 PM