Coder Social home page Coder Social logo

chakrit / gossip Goto Github PK

View Code? Open in Web Editor NEW
166.0 30.0 74.0 24.32 MB

A SIP client library that wraps PJSIP into a nice and clean ObjC-style OO api.

Home Page: http://chakrit.github.com/gossip

License: The Unlicense

Objective-C 84.99% C++ 6.54% C 1.68% Shell 3.59% Ruby 3.19%

gossip's Introduction

GOSSIP

An Objective-C convenience wrapper around the PJSIP client library. In addition to that, the GOSSIP repository also contains:

  • PJSIP - Original source mirror as git submodule so we can track commits that GOSSIP will compile against.

  • Utility script for compiling PJSIP - This automates the process described by the Getting Started - iPhone guide on the PJSIP website.

  • Pre-built fat PJSIP binaries - These run on armv7, armv7s, arm64 and i386 out of the box. You can also build each architecture individually by yourself using the aforementioned script.

USAGE

  1. Clone the GOSSIP sources.
  2. Make sure to also clone PJSIP submodule as we need the PJSIP headers.
  3. (optional) Use the provided script to build your custom version of PJSIP.
  4. Adds the GOSSIP xcodeproj as reference to your main application project. Either workspace reference or as a subproject should works.
  5. Initializes GSUserAgent on application starts.

Check the GSUserAgent documentation for further instructions.

Example of a successful git clone command:

git clone git://github.com/chakrit/gossip.git
cd gossip
git submodule init
git submodule update --recursive

I can add support for CocoaPods if there is demand. I have opted not to work on this just yet due to the need to reference PJSIP headers (which in turn has a lot of architecture-specific macro #ifdefs that sometimes break badly.)

BUILD PJSIPs

Before GOSSIP will build, you must first have a working PJSIP binary either by:

  • Using the pre-built binaries already available in this repository. In which case, you should not need to do anything.
  • Use the gossip/pjsip/pjsip script to build a version of PJSIP that suit your needs.

For example, to create a new build for arm64, try the following:

$ cd gossip
$ cd pjsip
$ ./pjsip arm64
$ ./pjsip info arm64

Or to create new fat binaries on your machine, try the following:

cd gossip
cd pjsip
./pjsip all
./pjsip info .

LICENSE

We do not own the license nor the copyright of the PJSIP source code and derivatives which are required for GOSSIP to function. Check the PJSIP licensing page for more information.

Otherwise the Gossip codebase is public domain. See the LICENSE.md file for the full details.

SUPPORT

Please file a new GitHub issue. I am also available at service [at] chakrit.net or over Twitter as @chakrit.

CONTRIBUTORS

   144	Chakrit Wichian
     5	Hlung
     1	Thane Brimhall

gossip's People

Contributors

chakrit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gossip's Issues

Can't connect to getonsip.com

I compiled this successfully thanks!!
But I am not able to connect with getonsip.com.
Using these -

account.address = @"[email protected]";
account.username = @"getonsip_saurabhsharma";
account.password = @"tWEyNkVMEfFiw66z";
account.domain = @"getonsip.com";
account.proxyServer = @"sip.onsip.com";

Any idea what may be wrong?

The sound is very noisy

Can anyone give instructions to reduce noise.
currently, I have:
speex/16000/1
speex/8000/1
speex/32000/1
iLBC/8000/1
GSM/8000/1
PCMU/8000/1
PCMA/8000/1
I would like to use G711 codec.
what should I do now?

Docs submodule is dirty

After submodules checkout:

-Subproject commit b0af6c8fc8ed97bb03d3afa4ab42c24f46a9212b
+Subproject commit b0af6c8fc8ed97bb03d3afa4ab42c24f46a9212b-dirty

Incoming call is disconnecting immediately after connect.

Hi chakrit,
i wrote this simpler example to evalutate your wrapper library:
https://gist.github.com/jasjisdo/dbfac9530026760b6738

but if i call my app with the Gossip Example app, it connect to my app and it disconnect immediately.
here are my log files with loglevel = 5 of both clients:
https://gist.github.com/jasjisdo/87959957568f3404ea9e

what did i wrong?
Start a call from my GSEMySipApp to GossipExample works great and create a stable connection.

_config reset to nil after pjsua_acc_config_default(&accConfig);

Hi chakrit,
I saw a really weird behavior in method (of file GSAccount.m)

  • (BOOL)configure:(GSAccountConfiguration *)configuration {
    _config = [configuration copy];
    // prepare account config
    pjsua_acc_config accConfig;
    pjsua_acc_config_default(&accConfig);

    .....
    }
    After pjsua_acc_config_default(&accConfig);
    _config is set to nil
    so it can't setup the sip account anymore.
    Could you please give me some advices on this? Have you encountered it before?

Thank you.
MD

fatal: reference is not a tree: 34fcf7a8574c80fb23a3e22b57bc3b38eafe3837

On git submodule update --recursive

Cloning into 'docs'...
remote: Counting objects: 2273, done.
remote: Total 2273 (delta 0), reused 0 (delta 0), pack-reused 2273
Receiving objects: 100% (2273/2273), 24.18 MiB | 1.49 MiB/s, done.
Resolving deltas: 100% (1428/1428), done.
Checking connectivity... done.
fatal: reference is not a tree: 34fcf7a8574c80fb23a3e22b57bc3b38eafe3837
Cloning into 'pjsip/src'...
remote: Counting objects: 49826, done.
remote: Total 49826 (delta 0), reused 0 (delta 0), pack-reused 49826
Receiving objects: 100% (49826/49826), 24.98 MiB | 2.60 MiB/s, done.
Resolving deltas: 100% (34426/34426), done.
Checking connectivity... done.
Submodule path 'pjsip/src': checked out 'b0af6c8fc8ed97bb03d3afa4ab42c24f46a9212b'
Unable to checkout '34fcf7a8574c80fb23a3e22b57bc3b38eafe3837' in submodule path 'docs'

603 is received on Server side

Hi,
I am using gossip in my project and have implemented Incoming Call in my project. Everything works fine untill user relogin to the app or changes the port.
I am calling the configureUserAgent method at that moment and it successfully initialize the new object of GSUserAgent. But when i receive the incoming call, a message of 603 is sent to server. I am no sending this messages to server side at all.
Thanks in advance.

building error

Please help me out i am stuck with the basic implementation i am not getting how to compile this.
It always says no such file or directory found when building ./build-pjsip.
Please help me out its very urgent

Thanking you in anticipation

Crash on configure on iOS9

Currently getting a bad access when configuring with iOS9

Exception Type:  SIGBUS
Exception Codes: BUS_ADRALN at 0x14720ade4
Crashed Thread:  0

Thread 0 Crashed:
0   libsystem_pthread.dylib              0x0000000198e3a364 0x198e38000 + 9060
1   App                                0x00000001006d6430 pj_mutex_create_recursive + 60
2   App                                0x0000000100724488 pjsip_endpt_create + 316
3   App                                0x00000001006a3d3c pjsua_create + 868
4   App                                0x0000000100671cdc -[GSUserAgent configure:] + 352
5   App                                0x00000001000f1c08 __29-[SIPManager restartSIPAgent]_block_invoke (SIPManager.m:242)
6   libdispatch.dylib                    0x0000000198c29198 0x198c28000 + 4504
7   libdispatch.dylib                    0x0000000198c29158 0x198c28000 + 4440
8   libdispatch.dylib                    0x0000000198c2e1e0 0x198c28000 + 25056
9   CoreFoundation                       0x0000000183a3356c 0x183954000 + 914796
10  CoreFoundation                       0x0000000183a313a8 0x183954000 + 906152
11  CoreFoundation                       0x000000018395d800 0x183954000 + 38912
12  GraphicsServices                     0x000000018e9eb170 0x18e9e0000 + 45424
13  UIKit                                0x00000001890f65e8 0x18907c000 + 501224
14  App                                0x00000001000dfb00 main (main.m:16)
15  libdyld.dylib                        0x0000000198c5a8b8 0x198c58000 + 10424

It can be reproduced using the example app in the repro by selecting one of the sip accounts in the table view

NOTES:
-This crash happened on an iPhone 6 Device
-ENABLE_BITCODE must be disabled in XCode 7 project (otherwise building Gossip lib will fail)

File missing?

I think files are missing from the repo.
You say

Copy the file pjsip/config_site.h to `pjlib/include/pj/config_site.h

but there is not pjlib directory. Or I am missing something?

CocoaPods issue

Issue was reported here: CocoaPods/CocoaPods#2368

I'll see if I cannot remedy the issue in the podfile in this repo (if I can grab the time) or if someone else want's to do it before me, feel free. Otherwise I'll try to get a merge request in soon.

Handling IP Address Changes

Is there any mechanism to re-establish a connection after a device IP change? i.e. toggling airplane mode.

SRV DNS records fail to resolve

AFAICT, PJSIP supports SRV DNS records, but Gossip doesn't. When I attempt to connect to my SIP server, I simply get a timeout.

What needs to be done so my app can connect properly? (I'm happy to submit a pull request once I have it figured out, but I'm not really sure where to start.)

G.729 and PJSIP

Hi Their,

I am having an issue using your G.729 patch when compiling PJSIP. Could you provide more instructions on how to get this to work?

Thank you.

Crash when starting outgoing call

Got a SIGABRT ABORT when trying to begin a call...not sure how to reproduce it, but does anyone know what might cause this?

Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x33d90dfc pthread_kill + 8
1 libsystem_pthread.dylib 0x33e0ed37 pthread_kill + 62
2 libsystem_c.dylib 0x33d30909 abort + 76
3 libsystem_c.dylib 0x33d10369 basename
4 App 0x003b666f pj_mutex_lock
5 App 0x0038e6d9 pjsua_call_make_call
6 App 0x003720b1 -[GSOutgoingCall begin]
7 libdispatch.dylib 0x33caa7bb _dispatch_call_block_and_release + 10
8 libdispatch.dylib 0x33caa7a7 _dispatch_client_callout + 22
9 libdispatch.dylib 0x33cadfa3 _dispatch_main_queue_callback_4CF + 718
10 CoreFoundation 0x25f5a3b1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 8
11 CoreFoundation 0x25f58ab1 __CFRunLoopRun + 1512
12 CoreFoundation 0x25ea63c1 CFRunLoopRunSpecific + 476
13 CoreFoundation 0x25ea61d3 CFRunLoopRunInMode + 106
14 GraphicsServices 0x2d2a40a9 GSEventRunModal + 136
15 UIKit 0x294b5fa1 UIApplicationMain + 1440
16 App 0x000e8e7b main (main.m:16)

Cellular call interrupts VoIP call

Hi,
Its known issue that if Voip call is in progress and phone receives a normal cellular call then Voip call is sent to background and after call is disconencted VoIP call is retrievd and is still in progress but media is lost. Can you please check it

Does Gossip have a support for IPv6?

Hi,
I am currently using gossip for VOIP calling functionality. Our iOS application is rejected by Apple saying that it should support IPv6. Does gossip have a support for it? If so then how can we enable it? Will it support both IPv4 and IPv6?

Regards
Vijay

crash after disconnect and switch accounts

14:06:48.425 os_core_unix.c !pjlib 2.2.1-svn for POSIX initialized
14:06:48.427 sip_endpoint.c .Creating endpoint instance...
14:06:48.428 pjlib .select() I/O Queue created (0x13e858a28)
14:06:48.428 sip_endpoint.c .Module "mod-msg-print" registered
14:06:48.428 sip_transport. .Transport manager created.
14:06:48.428 pjsua_core.c .PJSUA state changed: NULL --> CREATED
14:06:48.504 pjsua_core.c .pjsua version 2.2.1-svn for initialized
2016-07-25 14:07:18.275 GossipExample[2253:1291601] Gossip: dispatchRegistrationStarted(0, 1)
14:07:27.774 pjsua_acc.c .Unable to create/send REGISTER: Object is busy (PJSIP_EBUSY) [status=171001]
2016-07-25 14:07:27.774 GossipExample[2253:1291601] Gossip: Error Domain=pjsip.org Code=341001 "Object is busy (PJSIP_EBUSY)" UserInfo={PJSIP_ERRNO_FORM_SIP_STATUS=341001, NSLocalizedDescription=Object is busy (PJSIP_EBUSY), pj_status_t=171001}
2016-07-25 14:07:27.775 GossipExample[2253:1291601] Destroying...
14:07:27.777 pjsua_acc.c ..Unable to create/send REGISTER: Object is busy (PJSIP_EBUSY) [status=171001]
14:07:32.278 pjsua_acc.c ....SIP registration failed, status=503 (Service Unavailable)
2016-07-25 14:07:32.279 GossipExample[2253:1291601] Gossip: dispatchRegistrationState(0)
2016-07-25 14:07:32.814 GossipExample[2253:1291601] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x13de6fd70 of class GSAccount was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x13ddae1d0> (
<NSKeyValueObservance 0x13de64550: Observer: 0x13de308b0, Key path: status, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x13de31610>
)'
*** First throw call stack:
(0x181e7edb0 0x1814e3f80 0x181e7ecf8 0x1827d2d80 0x10003bb20 0x1871d96fc 0x1819258e8 0x1872f3d3c 0x1814e2b54 0x1814ee040 0x1814ee0a0 0x181d67ee0 0x1814fdae8 0x181d5c9fc 0x181e32bc0 0x181d5cc50 0x183644088 0x187046088 0x10003a184 0x1818fa8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

encryption

Is it possible to encrypt output buffer of speex codec? If yes, where to do that in pjsip?

Duplicate Symbols

I followed the read me, including building a fat binary. I included the project into my workspace and added libc++.dylib to my project to get everything to compile. However, I'm getting 56 duplicate symbols in libGossip.o when linking. One from error.o, about half in sdp.o, and the rest in sdp_cmp.o.

duplicate symbol _pjmedia_strerror in error.o
duplicate symbol _pjmedia_sdp_attr_create in sdp.o
duplicate symbol _pjmedia_sdp_attr_clone in sdp.o
duplicate symbol _pjmedia_sdp_attr_find in sdp.o
...
duplicate symbol _pjmedia_sdp_media_cmp in sdp_cmp.o
duplicate symbol _pjmedia_sdp_session_cmp in sdp_cmp.o
duplicate symbol _pjmedia_sdp_conn_cmp in sdp_cmp.o
...

Any idea what I need to do to eliminate the duplicate symbols?

Thanks!

IPv6

Hello!

Now that Apple made it necessary to support IPv6 networks ( https://developer.apple.com/news/?id=05042016a ) , I am trying to run the project in NAT64 environment.

I am running into some issues...

I've already updated the config_site.h file to contain this line as well :
#define PJ_HAS_IPV6 1

  • I've modified the code to have IPv6 enabled :
    pjsua_acc_config accConfig; pjsua_acc_config_default(&accConfig); accConfig.ipv6_media_use = PJSUA_IPV6_ENABLED;

    But I can't connect via IPv6.

    Have you been able to connect via IPv6?

Thanks!

when makecall,Disconnected!

17:18:22.194 pjsua_acc.c !....sip:[email protected]:5060: registration success, status=200 (OK), will re-register in 300 seconds
2015-01-29 17:18:22.194 GossipExample[6878:3d07] Gossip: dispatchRegistrationState(0)
2015-01-29 17:18:25.343 GossipExample[6878:60b] Gossip: ringbackWithSoundNamed: /var/mobile/Applications/535D5F3F-C00E-41EA-BFEC-C25266E731D0/GossipExample.app/ringtone.wav
2015-01-29 17:18:25.348 GossipExample[6878:60b] Ready
2015-01-29 17:18:25.356 GossipExample[6878:60b] Ready
2015-01-29 17:18:26.855 GossipExample[6878:60b] Gossip: dispatchCallState(0)
2015-01-29 17:18:27.737 GossipExample[6878:3d07] Gossip: dispatchCallState(0)
2015-01-29 17:18:27.740 GossipExample[6878:60b] Disconnected
2015-01-29 17:18:27.741 GossipExample[6878:60b] Disconnected

Enhancement: don't forget to check if connection fails.

Not really an issue. It's just a point to aware. Any connect (GSAccount -connect) sent right after disconnect ([[GSUserAgent sharedAgent] reset]) will fail (pjsua_acc_set_registration returns PJ_FALSE) because pjsip blocks the app for about 1 second after disconnect to wait for its server requests to complete.

If you already check if connect fails then it's fine. Maybe there should be a timer to delay after disconnection to prevent this :)

ip to ip local call not working

Hey guys,

I can't make local ip to ip call. The call is just not getting though. Any ideas on why this might be happening?

Not getting compiled

Hi,
i'm working on it since 4 days but haven't found any way to compile it.Everytime it gives missing message of some files.Please help me and post a proper way through a doc file to compile the same.

Thanks & Regards
iOS Developer

Multiple PGSIP accounts

Why do you use only one account per session supporting in your library? Is there a reason for this?
I looked around and understood, that complex changes needed for supporting multiple accounts in your library.

Question about + (NSString *)stringWithPJString:(const pj_str_t *)pjString;

Is there a reason why you went with your approach over this?

  • (NSString *)stringFromPJCharString:(const pj_str_t *)pjString
    {
    NSString *result = [NSString stringWithCString:pjString->ptr encoding:NSASCIIStringEncoding];
    return result;
    }

And use it like this:
NSString *someStringFromSomePJString = [PJUtil stringFromPJCharString:&my_pj_str]];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.