Menu

DotNetPlaceCall no UI in C# - problems

Help
2006-10-09
2013-04-23
  • Marcio Marchini

    Marcio Marchini - 2006-10-09

    Hi,

      I tried a console version, in C#, of DotNetPlaceCall, but ran into a timeout:

    EventMonitorThread: 23:09:43.7656250 Handling: LineState Event.
    EventMonitorThread: 23:09:43.7812500 Handled: LineState Event
    EventMonitorThread: 23:09:46.7812500 Handling: CallState Event.
    SipxCall_Event: CallState, Dialtone, Normal
    EventMonitorThread: 23:09:46.7812500 Handled: CallState Event
    Success!
    CallConnect Timed out

    Here is the code:

        class CallWithVoIP
        {

            static int SIP_TCP_PORT = 0;
            static int SIP_UDP_PORT = 0;
            static int SIP_TLS_PORT = -1;
            static int SIP_RTP_PORT_START = 0;
            static int SIP_RTP_MAX_CONNECTIONS = 2;
            static string SIP_BIND_ADDRESS = "localhost";
            static bool SIP_USE_SEQUENTIAL_PORTS = true;

            static void Main(string[] args) {
                // DLL from http://www.codeproject.com/useritems/SIP_Softphone_gateway.asp?df=100&forumid=293020&exp=0&select=1473296
                string login = args[0];
                string password = args[1];
                string server = args[2];
                string userLongName = args[3];
                string whoToCall = args[4];
                string identity = "\&quot;" + userLongName + "\&quot; <" + login + "@" + server + ">";
                SipxInstance aSipxInstance = SipxInstance.Create(identity, SIP_TCP_PORT, SIP_UDP_PORT, SIP_TLS_PORT, SIP_RTP_PORT_START, SIP_RTP_MAX_CONNECTIONS, SIP_BIND_ADDRESS, SIP_USE_SEQUENTIAL_PORTS);
                aSipxInstance.Connect(true);
                int lineNumber = aSipxInstance.LineCreate();
                SipxLine line = aSipxInstance.Lines[lineNumber];
                //SipxLine line = SipxLine.Create(aSipxInstance);
                line.AddCreditial(login, password, server);

                int callNumber = line.CallCreate();
                SipxCall aCall = line.Calls[callNumber];
                aCall.Connect(whoToCall);

                aCall.Dispose();
                line.Dispose();
                aSipxInstance.Disconnect(true);
                aSipxInstance.Dispose();
            }
        }

    Any idea why? I noticed that VB does not have to pass all the params that I have to pass to  SipxInstance.Create, so I am not sure I am passing the right defaults?

    I ran the program passing the following cmd-line params:

    123456 foobar fwd.pulver.com "John Smith" 123456@fwd.pulver.com

    In other words, trying to call myself (I have a VoIP phone with FWD). The same params work with DotNetPlaceCall in VB.

    Any idea? Thanks.

    --mqm

     
    • Joshua Kaldon

      Joshua Kaldon - 2006-10-09

      You're definately not passing the right parameters, but the console message "CallConnect Timeout" was removed from the code back in August.  Additionally, your latency with the older version will be considerably higher than with our DirectSound patches.

      For reference, here are the default parameter values that are used if not specified in vb:

      m_Instance = _
        SipXTapiDotNet.SipxInstance.Create(
          identity, _
          tcpPort:=5060, _
          udpPort:=5060,
          tlsPort:=5061,
          rtpPortStart:=10000,
          maxConnections:=32,
          bindToAddress:="0.0.0.0",
          useSequentialPorts:=False
        )

      - Josh

       
      • Marcio Marchini

        Marcio Marchini - 2006-10-09

        Thanks, with those defaults it worked.

        I was using your binary download, that's probably why it was old stuff being shown. Yes, it was very slow to connect.

        I compiled the VB lib from src, and now I am using that. Seems to work faster. I am still using the C DLL I downloaded (which I mentioned in another msg).

        Thanks,

        marcio

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.