powered by simpleCommunicator - 2.0.53     © 2025 Programmizd 02
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Нужна помощь с Sipek SDK
5 сообщений из 5, страница 1 из 1
Нужна помощь с Sipek SDK
    #37272667
tplink
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Приветствую всех.
Здесь нашел способ использования sip в C# проекте. Все сделал по документации, но не понял следующее:
In AccountConfig set the properties (hard coded) to connect to your SIP server.

Есть класс AccountConfig:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
class AccountConfig : IAccount
        {
            string IAccount.AccountName
            {
                get
                {
                  throw new NotImplementedException();
                }
                set
                {
                    throw new NotImplementedException();
                }
            }

            string IAccount.DisplayName
            {
                get
                {
                    throw new NotImplementedException();
                }
                set
                {
                    throw new NotImplementedException();
                }
            }
...

Куда мне надо прописать параметры sip-аккаунта? Логин, пароль, айпишник сип-сервера, порт...
...
Рейтинг: 0 / 0
Нужна помощь с Sipek SDK
    #37272747
LjAPb
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
tplink,

Ну так, а дальше...


Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
class AccountConfig : IAccount
  {
    #region IAccount Members

    public string AccountName
    {
      get
      {
        return "Account";
      }
      set{}
    }

    public string DisplayName
    {
      get
      {
        return "Sipek Instant Softphone";
      }
      set {}
    }

    public string DomainName
    {
      get
      {
        return "*";
      }
      set{}
    }

    public string HostName
    {
      get
      {
        //return "sipserver.net";
        return "192.168.60.211:5070";
      }
      set{}
    }

    public string Id
    {
      get
      {
        return "myId";
      }
      set { }
    }

    public int Index
    {
      get
      {
        return 0;
      }
      set{}
    }

    public string Password
    {
      get
      {
        //return "mypass";
        return "4444";
      }
      set {}
    }

    public string ProxyAddress
    {
      get
      {
        return "";
      }
      set{}
    }

    public int RegState
    {
      get
      {
        return 0;
      }
      set{}
    }

    public ETransportMode TransportMode
    {
      get
      {
        return ETransportMode.TM_UDP;
      }
      set{}
    }

    public string UserName
    {
      get
      {
        //return "myuser";
        return "4444";
      }
      set{ }
    }

    #endregion
  }
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
Нужна помощь с Sipek SDK
    #38097806
Krolist
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Здравствуйте.
Хочу тоже разобраться с SIPEK SDK
Сделал все по инструкции.
Регистрация SIP аккаунта не работает, никаких признаков активности SIP ...
Для теста запущен AsteriskWin32, аккаунт рабочий, проверен.
Более того смотрю "sip debug ip 127.0.0.1" ... никаких запросов от разрабатываемого клиента не наблюдается((

Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sipek.Common;

class AccountConfig : IAccount
{

    public string AccountName
    {
        get
        {
            return "operator28";
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string DisplayName
    {
        get
        {
            return "operator28";
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string DomainName
    {
        get
        {
            return "localhost";
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public bool Enabled
    {
        get
        {
            return true;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string HostName
    {
        get
        {
            return "localhost";
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string Id
    {
        get
        {
            //throw new NotImplementedException();
            return "operator28";
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public int Index
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string Password
    {
        get
        {
            return "";
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string ProxyAddress
    {
        get
        {
            return "";
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public int RegState
    {
        get
        {
            return 0;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public ETransportMode TransportMode
    {
        get
        {
            return ETransportMode.TM_UDP;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string UserName
    {
        get
        {
            return "operator28";
        }
        set
        {
            throw new NotImplementedException();
        }
    }
}

internal class PhoneConfig : IConfiguratorInterface {

    List<IAccount> _acclist = new List<IAccount>();

    internal PhoneConfig()
    {
        _acclist.Add(new AccountConfig());
    }

    public List<IAccount> Accounts
    {
        get { return _acclist; }
    }



    public bool AAFlag
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public bool CFBFlag
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string CFBNumber
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public bool CFNRFlag
    {
        get
        {
            return false;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string CFNRNumber
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public bool CFUFlag
    {
        get
        {
            return false;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public string CFUNumber
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public List<string> CodecList
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public bool DNDFlag
    {
        get
        {
            return false;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public int DefaultAccountIndex
    {
        get { return 0; }
    }

    public bool IsNull
    {
        get { return false; }
    }

    public bool PublishEnabled
    {
        get
        {
            return true;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public int SIPPort
    {
        get
        {
           return 5060;
        }
        set
        {
            throw new NotImplementedException();
        }
    }

    public void Save()
    {
        throw new NotImplementedException();
    }


}



Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Sipek.Common.CallControl;
using Sipek.Sip;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {


        CCallManager CallManager
        {
            get { return CCallManager.Instance; }
        }

        private PhoneConfig _config = new PhoneConfig();
        internal PhoneConfig Config
        {
            get { return _config; }
        }
        
        public Form1()
        {

            InitializeComponent();


            CallManager.CallStateRefresh += new DCallStateRefresh(CallManager_CallStateRefresh);
            pjsipRegistrar.Instance.AccountStateChanged += new Sipek.Common.DAccountStateChanged(Instance_AccountStateChanged);



            CallManager.StackProxy = pjsipStackProxy.Instance;
            CallManager.Config = Config;
            pjsipStackProxy.Instance.Config = Config;
            pjsipRegistrar.Instance.Config = Config;
            CallManager.Initialize();
            pjsipRegistrar.Instance.registerAccounts();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        void CallManager_CallStateRefresh(int sessionId)
        {
            // MUST synchronize threads
            if (InvokeRequired)
                this.BeginInvoke(new DCallStateRefresh(OnStateUpdate), new object[] { sessionId });
            else
                OnStateUpdate(sessionId);
        }



        private void OnStateUpdate(int sessionId)
        {
            label1.Text = CallManager.getCall(sessionId).StateId.ToString();
        }

        private void Instance_AccountStateChanged(int accountId, int accState)
        {
            // MUST synchronize threads
            if (InvokeRequired)
                this.BeginInvoke(new DCallStateRefresh(OnStateUpdate), new object[] { accountId });
            else
                OnStateUpdate(accountId);
        }

        private void button1_Click(object sender, EventArgs e)
        {
           CallManager.createOutboundCall(phoneBox.Text);
        }

    }
}
...
Рейтинг: 0 / 0
Нужна помощь с Sipek SDK
    #38097808
Krolist
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
tplink, LjAPb помогите разобраться если Вы уже в теме.
Отблагодарю!
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
Нужна помощь с Sipek SDK
    #39302733
Viktor12345
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Krolist, tplink, LjAPb - так может чем-то поможете? А то в русскоязычном сегменте вопросов много а вот ответов почти нету...
...
Рейтинг: 0 / 0
5 сообщений из 5, страница 1 из 1
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Нужна помощь с Sipek SDK
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]