Пример #1
0
        public void SendIsNotTyping(int accId, string to)
        {
            Helper.GuardPositiveInt(accId);
            var tto = new pj_str_t(to);

            Helper.GuardError(PJSUA_DLL.IM.pjsua_im_typing(accId, ref tto, 0, null));
        }
Пример #2
0
        public void SendIm(int callId, string mime_type, string content)
        {
            var m = new pj_str_t(mime_type);
            var c = new pj_str_t(content);

            Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_send_im(callId, ref m, ref c, null, IntPtr.Zero));
        }
Пример #3
0
 public int CreatePlayerAndGetId(string fileName, uint options)
 {
     var id = NativeConstants.PJSUA_INVALID_ID;
     var name = new pj_str_t(fileName);
     Helper.GuardError(PJSUA_DLL.Media.pjsua_player_create(ref name, options, ref id));
     return id;
 }
Пример #4
0
 private void OnCallTransfer(int callId, ref pj_str_t dst, ref pjsip_status_code code)
 {
     _eventAggregator.Publish(new CallTransferRequested()
     {
         Id = callId, Destination = dst, Status = (SipStatusCode)code
     });
 }
Пример #5
0
 public int MakeCallAndGetId(int accId, string dstUri, uint options)
 {
     int id = NativeConstants.PJSUA_INVALID_ID;
     var d = new pj_str_t(dstUri);
     Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_make_call(accId, ref d, options, IntPtr.Zero, null, ref id));
     return id;
 }
Пример #6
0
        public int CreatePlayerAndGetId(string fileName, uint options)
        {
            var id   = NativeConstants.PJSUA_INVALID_ID;
            var name = new pj_str_t(fileName);

            Helper.GuardError(PJSUA_DLL.Media.pjsua_player_create(ref name, options, ref id));
            return(id);
        }
Пример #7
0
 public void SendIm(int accId, string to, string mimeType, string content)
 {
     Helper.GuardPositiveInt(accId);
     var tto = new pj_str_t(to);
     var mime = new pj_str_t(mimeType);
     var cntnt = new pj_str_t(content);
     Helper.GuardError(PJSUA_DLL.IM.pjsua_im_send(accId, ref tto, ref mime, ref cntnt, null, IntPtr.Zero));
 }
Пример #8
0
 public int CreatePlaylistAndGetId(string fileNames, uint fileCount, string label, uint options)
 {
     var id = NativeConstants.PJSUA_INVALID_ID;
     var name = new pj_str_t(fileNames);
     var lbl = new pj_str_t(label);
     Helper.GuardError(PJSUA_DLL.Media.pjsua_playlist_create(ref name, fileCount, ref lbl, options, ref id));
     return id;
 }
Пример #9
0
 public int CreateRecorderAndGetId(string filename, uint encType, IntPtr encParam, int maxSize, uint options)
 {
     var id = NativeConstants.PJSUA_INVALID_ID;
     var name = new pj_str_t(filename);
     Helper.GuardError(PJSUA_DLL.Media.pjsua_recorder_create(ref name, encType, encParam, maxSize, options,
                                                             ref id));
     return id;
 }
Пример #10
0
        public int MakeCallAndGetId(int accId, string dstUri, uint options)
        {
            int id = NativeConstants.PJSUA_INVALID_ID;
            var d  = new pj_str_t(dstUri);

            Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_make_call(accId, ref d, options, IntPtr.Zero, null, ref id));
            return(id);
        }
Пример #11
0
        public void SendIm(int accId, string to, string mimeType, string content)
        {
            Helper.GuardPositiveInt(accId);
            var tto   = new pj_str_t(to);
            var mime  = new pj_str_t(mimeType);
            var cntnt = new pj_str_t(content);

            Helper.GuardError(PJSUA_DLL.IM.pjsua_im_send(accId, ref tto, ref mime, ref cntnt, null, IntPtr.Zero));
        }
Пример #12
0
        public int CreatePlaylistAndGetId(string fileNames, uint fileCount, string label, uint options)
        {
            var id   = NativeConstants.PJSUA_INVALID_ID;
            var name = new pj_str_t(fileNames);
            var lbl  = new pj_str_t(label);

            Helper.GuardError(PJSUA_DLL.Media.pjsua_playlist_create(ref name, fileCount, ref lbl, options, ref id));
            return(id);
        }
Пример #13
0
        public int CreateRecorderAndGetId(string filename, uint encType, IntPtr encParam, int maxSize, uint options)
        {
            var id   = NativeConstants.PJSUA_INVALID_ID;
            var name = new pj_str_t(filename);

            Helper.GuardError(PJSUA_DLL.Media.pjsua_recorder_create(ref name, encType, encParam, maxSize, options,
                                                                    ref id));
            return(id);
        }
Пример #14
0
 private void OnIncomingSubscribe(int accId, IntPtr srvPres, int buddyId, ref pj_str_t @from, IntPtr rdata, ref pjsip_status_code code, ref pj_str_t reason, pjsua_msg_data msgData)
 {
     _eventAggregator.Publish(new IncomingSubscribeRecieved()
     {
         AccountId = accId,
         BuddyId   = buddyId,
         From      = @from,
         Reason    = reason,
         Status    = (SipStatusCode)code
     });
 }
Пример #15
0
 private void OnPager(int callId, ref pj_str_t @from, ref pj_str_t to, ref pj_str_t contact, ref pj_str_t mimeType, ref pj_str_t body)
 {
     _eventAggregator.Publish(new IncomingImRecieved()
     {
         CallId   = callId,
         From     = from,
         Body     = body,
         Contact  = contact,
         MimeType = mimeType
     });
 }
Пример #16
0
 private void OnPagerStatus(int callId, ref pj_str_t to, ref pj_str_t body, IntPtr user_data, pjsip_status_code status, ref pj_str_t reason)
 {
     _eventAggregator.Publish(new ImStatusChanged()
     {
         Id     = callId,
         To     = to,
         Body   = body,
         Reason = reason,
         Status = (SipStatusCode)status
     });
 }
Пример #17
0
 private void OnTyping(int callId, ref pj_str_t @from, ref pj_str_t to, ref pj_str_t contact, int isTyping)
 {
     _eventAggregator.Publish(new IncomingTypingRecieved()
     {
         CallId   = callId,
         From     = from,
         Contact  = contact,
         IsTyping = Convert.ToBoolean(isTyping),
         To       = to
     });
 }
Пример #18
0
        private void OnCallTransferStatus(int callId, int stCode, ref pj_str_t stText, int final, ref int pCont)
        {
            var @event = new CallTransferStatusChanged()
            {
                Id         = callId,
                Status     = stCode,
                StatusText = stText,
                Final      = Convert.ToBoolean(final),
                Continue   = Convert.ToBoolean(pCont)
            };

            _eventAggregator.Publish(@event);
            pCont = Convert.ToInt32(@event.Continue);
        }
Пример #19
0
        public void DialDtmf(int callId, string digits)
        {
            var d = new pj_str_t(digits);

            Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_dial_dtmf(callId, ref d));
        }
Пример #20
0
 public int GetBestSuitingAccountIdForUrl(string url)
 {
     var uri = new pj_str_t(url);
     return PJSUA_DLL.Accounts.pjsua_acc_find_for_outgoing(ref uri);
 }
Пример #21
0
 private void OnCallTransfer(int callId, ref pj_str_t dst, ref pjsip_status_code code)
 {
     _eventAggregator.Publish(new CallTransferRequested()
                               {Id = callId, Destination = dst, Status = (SipStatusCode) code});
 }
Пример #22
0
 private void OnCallTransferStatus(int callId, int stCode, ref pj_str_t stText, int final, ref int pCont)
 {
     var @event = new CallTransferStatusChanged()
                      {
                          Id = callId,
                          Status = stCode,
                          StatusText = stText,
                          Final = Convert.ToBoolean(final),
                          Continue = Convert.ToBoolean(pCont)
                      };
     _eventAggregator.Publish(@event);
     pCont = Convert.ToInt32(@event.Continue);
 }
Пример #23
0
 public void SetCodecPriority(string codecId, byte priority)
 {
     var codec = new pj_str_t(codecId);
     Helper.GuardError(PJSUA_DLL.Media.pjsua_codec_set_priority(ref codec, priority));
 }
Пример #24
0
 public void SendIsNotTyping(int accId, string to)
 {
     Helper.GuardPositiveInt(accId);
     var tto = new pj_str_t(to);
     Helper.GuardError(PJSUA_DLL.IM.pjsua_im_typing(accId, ref tto, 0, null));
 }
Пример #25
0
 public void DialDtmf(int callId, string digits)
 {
     var d = new pj_str_t(digits);
     Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_dial_dtmf(callId, ref d));
 }
Пример #26
0
 public void HangupCall(int callId, SipStatusCode code, string reason)
 {
     var r = new pj_str_t(reason);
     Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_hangup(callId, (uint) code, ref r, null));
 }
Пример #27
0
        public void TransferCall(int callId, string destination)
        {
            var dest = new pj_str_t(destination);

            Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_xfer(callId, ref dest, null));
        }
Пример #28
0
        public void HangupCall(int callId, SipStatusCode code, string reason)
        {
            var r = new pj_str_t(reason);

            Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_hangup(callId, (uint)code, ref r, null));
        }
Пример #29
0
 public void TransferCall(int callId, string destination)
 {
     var dest = new pj_str_t(destination);
     Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_xfer(callId, ref dest, null));
 }
Пример #30
0
 private void OnTyping(int callId, ref pj_str_t @from, ref pj_str_t to, ref pj_str_t contact, int isTyping)
 {
     _eventAggregator.Publish(new IncomingTypingRecieved()
                               {
                                   CallId = callId,
                                   From = from,
                                   Contact = contact,
                                   IsTyping = Convert.ToBoolean(isTyping),
                                   To = to
                               });
 }
Пример #31
0
 public void SendIm(int callId, string mime_type, string content)
 {
     var m = new pj_str_t(mime_type);
     var c = new pj_str_t(content);
     Helper.GuardError(PJSUA_DLL.Calls.pjsua_call_send_im(callId, ref m, ref c, null, IntPtr.Zero));
 }
Пример #32
0
 private void OnPagerStatus(int callId, ref pj_str_t to, ref pj_str_t body, IntPtr user_data, pjsip_status_code status, ref pj_str_t reason)
 {
     _eventAggregator.Publish(new ImStatusChanged()
                               {
                                   Id = callId,
                                   To = to,
                                   Body = body,
                                   Reason = reason,
                                   Status = (SipStatusCode) status
                               });
 }
Пример #33
0
        public void SetCodecPriority(string codecId, byte priority)
        {
            var codec = new pj_str_t(codecId);

            Helper.GuardError(PJSUA_DLL.Media.pjsua_codec_set_priority(ref codec, priority));
        }
Пример #34
0
 private void OnPager(int callId, ref pj_str_t @from, ref pj_str_t to, ref pj_str_t contact, ref pj_str_t mimeType, ref pj_str_t body)
 {
     _eventAggregator.Publish(new IncomingImRecieved()
                               {
                                   CallId = callId,
                                   From = from,
                                   Body = body,
                                   Contact = contact,
                                   MimeType = mimeType
                               });
 }
Пример #35
0
 private void OnIncomingSubscribe(int accId, IntPtr srvPres, int buddyId, ref pj_str_t @from, IntPtr rdata, ref pjsip_status_code code, ref pj_str_t reason, pjsua_msg_data msgData)
 {
     _eventAggregator.Publish(new IncomingSubscribeRecieved()
                               {
                                   AccountId = accId,
                                   BuddyId = buddyId,
                                   From = @from,
                                   Reason = reason,
                                   Status = (SipStatusCode) code
                               });
 }
Пример #36
0
        public int GetBestSuitingAccountIdForUrl(string url)
        {
            var uri = new pj_str_t(url);

            return(PJSUA_DLL.Accounts.pjsua_acc_find_for_outgoing(ref uri));
        }