Giter VIP home page Giter VIP logo

zrtp4pj's People

Contributors

mokolea avatar r3gis3r avatar saghul avatar traviscross avatar wernerd 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zrtp4pj's Issues

ZRTP4PJ not compile in PJSIP 2.4

ZRTP4PJ is compiled in PJSIP 2.3. I try to compile in PJSIP 2.4 and have one issue:
/pjsip-last/third_party/build/zsrtp$ make dep -- no error
/pjsip-last/third_party/build/zsrtp$ make
rm -f build.mak
make -f /media/android-applications/pjsip-last/build/rules.mak APP=ZSRTP app=libzsrtp ../../lib/libzsrtp-i686-pc-linux-gnu.a
make[1]: entering directory /media/android-applications/pjsip-last/third_party/build/zsrtp' make[1]: *** No rule to make target../../lib/libzsrtp-i686-pc-linux-gnu.a'. Stop.
make[1]: Leaving directory `/media/android-applications/pjsip-last/third_party/build/zsrtp'
make: *** [libzsrtp] Error 2

pjsua2 api support

Hello, I m trying to follow your instructions to use zrtp in my android app which is built on pjsua2 api. However I m not able to use it and there are some object types which is not available in pjsua2 api project. Do you have any recommendation for that?

PJMEDIA_HAS_SRTP flag

Hi,

In order to use this lib, is the PJMEDIA_HAS_SRTP should be defined as 0?

Inside the config_site.h

#define PJMEDIA_HAS_SRTP  0

Thanks!

Problem in ZRTP4PJ with '3rdparty_media_sample '

Hello werner, while running '3rdparty_media_sample' ( pjsip-apps/src/3rdparty_media_sample)
(compiled with ZRTP4PJ)
following runtime error is thrown.
Would you please tell me what may be the reason behind it ??
Following is the gdb log :

Program received signal SIGABRT, Aborted.
[Switching to Thread 4101 (LWP 419)]
0x2ad59924 in kill () from /lib/libc.so.0
(gdb) bt
#0 0x2ad59924 in kill () from /lib/libc.so.0
#1 0x2ab3a60c in pthread_kill () from /lib/libpthread.so.0
#2 0x2ab3ad60 in raise () from /lib/libpthread.so.0
#3 0x2ad5158c in abort () from /lib/libc.so.0
#4 0x2ad2a928 in __assert () from /lib/libc.so.0
#5 0x004e08fc in transport_send_rtp (tp=0x7d2f1c, pkt=0x7e09d4, size=168)

at ../src/pjmedia/transport_udp.c:806 

#6 0x00680a98 in zrtp_sendDataZRTP (ctx=0x1a3, data=0x7e3424 "PZ", length=156) at transport.h:678
#7 0x0069d598 in ZrtpStateClass::evDetect (this=0x7dc748) at ../../zsrtp/zrtp/zrtp/ZrtpStateClass.cpp:339
#8 0x0069d97c in ZrtpStateClass::processEvent (this=0x7dc748, ev=0x7f1ffc70) at ZrtpStates.h:68
#9 0x0068b9dc in ZRtp::processTimeout (this=0x1a3) at ../../zsrtp/zrtp/zrtp/ZRtp.cpp:216
#10 0x005492cc in pj_timer_heap_poll (ht=0x7d8104, next_delay=0x0) at ../src/pj/timer.c:643
#11 0x00680348 in timer_thread_run (p=0x1a3) at ../../zsrtp/transport_zrtp.c:229
#12 0x00532860 in thread_main (param=0x7d81c0) at ../src/pj/os_core_unix.c:523
#13 0x2ab349d4 in pthread_start_thread () from /lib/libpthread.so.0
#14 0x2ab34a64 in pthread_start_thread_event () from /lib/libpthread.so.0
#15 0x2ab34a64 in pthread_start_thread_event () from /lib/libpthread.so.0

Previous frame identical to this frame (corrupt stack?)

after the callback zrtp_signSAS

What should I do when I receive the "zrtp_signSAS" callback?
because the zrtp_showSAS always give me the verified as 0.

I'm speaking of the zrtp_UserCallbacks.

Crash in ZIDCacheFile::getRecord(unsigned char*) ()

ios 10.2.1
call method
pjmedia_transport_zrtp_initialize(zrtp_tp, "simple.zid", PJ_TRUE);

2017-02-28 12 37 17

Log:
ZRTP transport created
ZRTP info message: Hello received, preparing a Commit

stacktrace
Crashed: Thread
0 libsystem_c.dylib 0x1863ebe20 flockfile + 94
1 libsystem_c.dylib 0x1863f75cc fseek + 64
2 aaaaaa 0x100bb9b60 ZIDCacheFile::getRecord(unsigned char*) + 124
3 aaaaaa 0x100bbc2b4 ZRtp::prepareCommit(ZrtpPacketHello*, unsigned int*) + 872
4 aaaaaa 0x100bcc0b0 ZrtpStateClass::evAckDetected() + 196
5 aaaaaa 0x100bce1cc ZrtpStates::processEvent(ZrtpStateClass&) + 132
6 aaaaaa 0x100bce5e0 ZrtpStateClass::processEvent(Event*) + 972
7 aaaaaa 0x100bbbde4 ZRtp::processZrtpMessage(unsigned char*, unsigned int, unsigned long) + 92
8 aaaaaa 0x100bd6398 zrtp_processZrtpMessage + 72
9 aaaaaa 0x100bf7d9c transport_rtp_cb + 796
10 aaaaaa 0x100a49130 srtp_rtp_cb + 100
11 aaaaaa 0x100a4261c ice_on_rx_data + 772
12 aaaaaa 0x100a8cfd4 ice_rx_data + 100
13 aaaaaa 0x100a8812c pj_ice_sess_on_rx_pkt + 700
14 aaaaaa 0x100a8f7e0 stun_on_rx_data + 224
15 aaaaaa 0x100a9e808 on_data_recvfrom + 440
16 aaaaaa 0x1009e4c64 ioqueue_on_read_complete + 280
17 aaaaaa 0x1009d94e0 ioqueue_dispatch_read_event + 976
18 aaaaaa 0x1009dc014 pj_ioqueue_poll + 1260
19 aaaaaa 0x100abaee0 pjsip_endpt_handle_events2 + 360
20 aaaaaa 0x100b1f964 pjsua_handle_events + 72
21 aaaaaa 0x100b1ee98 worker_thread + 52
22 aaaaaa 0x1009de46c thread_main + 188

ZRTP4PJ crash in transport_attach() method after update PJSip 2.7

Steps to reproduce:

  1. update pjsip to version 2.7;
  2. recompile ZRTP4PJ against the new pjsip version;
  3. Try to establish a call between two points.
  4. When B party answer the call Zrtp crash.

Stack trace:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 ??? 0000000000 0 + 0
1 App - 0x0067289a transport_attach + 1122
2 App - 0x0066019a pjmedia_stream_create + 1694
3 App - 0x006d9720 pjsua_aud_channel_update + 200
4 App - 0x006d45da pjsua_media_channel_update + 556
5 App - 0x006c6052 pjsua_call_on_media_update + 348
6 App - 0x006b8c34 inv_negotiate_sdp + 80
7 App - 0x006b7338 process_answer + 188
8 App - 0x006b7498 pjsip_inv_answer + 94
9 App - 0x006c96d2 pjsua_call_answer2 + 732

I had notice that the app is crashing every time is trying to call pjmedia_transport_attach() from transport_attach() in transport_zrtp.c.
Note: I used ZRTP4PJ in an iOS project and I compile this library for armv7 and arm64.

Best regards.

0x0 memory read in transport_zrtp.c - support for pjsip 2.8 onwards

The C wrapper for pjsua seems to have some unwanted behaviour.

After accepting an incoming call, before transmitting media, I experience hard crashes due to a memory read at 0x0.

The error occurs on line 992 within transport_zrtp.c.

zrtp->stream_rtp_cb is NULL.

att_param->rtp_cb; is NULL as well.

I am not quite sure whether this problem is somehow related to the recent upgrade to OpenSSL 1.1.0 (in ZRTPCPP), I haven't yet looked into it really (concerning the wrapper).

I simply used the example provided in this repository to make ZRTP available to pjsua.

I know it's hard to maintain this repository, especially if you've limited time to care about things like this which are not related to your work or what you do for a living. However, I'd absolutely appreciate some help.

Thread 10#0	0x0000000000000000 in 0x00000000 ()
#1	0x0000000100607170 in transport_rtp_cb ()
#2	0x000000010089cdec in srtp_rtp_cb ()
#3	0x00000001008a1c9c in call_rtp_cb ()
#4	0x000000010089fa00 in on_rx_rtp ()
#5	0x000000010091934c in ioqueue_dispatch_read_event ()
#6	0x000000010091bf80 in pj_ioqueue_poll ()
#7	0x000000010086cadc in worker_proc ()
#8	0x000000010091e404 in thread_main ()
#9	0x000000019fd391ec in _pthread_start ()

27/09/โ€˜19: might be related to pjsip/pjproject@106ec87#diff-c2a444132012a8574cc6001cca81feb1
the introduction of rtp_cb2.

What's license under this repo ?

hi @wernerd

Could you please update the license for this repo? I want to use this code for my purpose. But i did not see the license.

Hopefully you have time to update the license :) And hope it would be MIT Or Apache ๐Ÿ‘

zrtp not starting for incoming call (iphone)

Hi wernerd,
I have successfully integrated ZRTP4PJ library with PJSIP-2.3. I am using CSIPSimple to test my implementation. When i am calling from my app to a CSIPSimple client it works fine with SAS negotiation. But when I am calling to my app from CSIPSimple client its not working at my app end. In this case i am getting zrtp log up-to

ZRTP info message: Commit: Generated a public DH key

But after that nothing happens until the call is disconnected and gives the following message

16:57:35.895 transport_zrtp .......Destroy - encrypted packets: 0
16:57:35.895 transport_zrtp .......Destroy - decrypted packets: 0
16:57:35.895 transport_zrtp .......Destroy - encrypted packets: 0
16:57:35.895 transport_zrtp .......Destroy - decrypted packets: 0

Also I have tried with my app 2 app call and traced the log.
When P1 is calling P2 i see up-to following log at P2 side

ZRTP info message: Commit: Generated a public DH key

but P1 does not show this message. I turned on the #define DEBUGOUT(deb) deb in ZrtpPacketBase.h and put some more message to find out more info. I found out that at evDetect the P1 is detecting HelloAck but not receiving any Hello Pkt. So my guess is for some reason P2 is not sending Hello Pkt or P1 not receiving it.

Please help me out here to figure out this issue. let me know if you need some more info.

Compile to android with sqlite

I'm using this in a project with pjsip, and I whant to change the zid file to the database(sqlite) and I would like to know how to do that because I change the Makefile to:
zrtpobj = zrtp/zrtp/ZrtpCallbackWrapper.o \ zrtp/zrtp/ZIDCacheDb.o \ zrtp/zrtp/ZIDRecordDb.o \

but compiling the pjsip project gives me one error :

../../zsrtp/zrtp/zrtp/libzrtpcpp/ZIDCacheDb.h:66: error: undefined reference to 'getDbCacheOps'

how can I solve this problem?

PJSIP settings

Hi i try to make call this zrtp. I want to user ICE+STUN settings. When I make call the receiving client had log:

VOIP CALL status CONFIRMED, mediaState 1
ZRTP info message: Hello received, preparing a Commit
ZRTP info message: Commit: Generated a public DH key

And when I hung up call

2017-04-13 17:12:47:148 FoilChat[2963:1005657]  pjsua_media.c  ........Media stream call01:0 is destroyed
2017-04-13 17:12:47:151 FoilChat[2963:1005657] transport_zrtp  .......Destroy  - encrypted packets: 0
2017-04-13 17:12:47:153 FoilChat[2963:1005657] transport_zrtp  .......Destroy  - decrypted packets: 0
2017-04-13 17:12:47:153 FoilChat[2963:1005657]        icetp00  .......Stopping ICE, reason=media stop requested
2017-04-13 17:12:47:153 FoilChat[2963:1005657] transport_zrtp  .......Destroy  - encrypted packets: 0
2017-04-13 17:12:47:154 FoilChat[2963:1005657] transport_zrtp  .......Destroy  - decrypted packets: 0
2017-04-13 17:12:47:154 FoilChat[2963:1005657]        icetp00  ........ICE stream transport 0x102969028 destroyed
2017-04-13 17:12:47:154 FoilChat[2963:1005657]  ice_session.c  ........ICE session 0x101935828 destroyed

Do I need to configure an additional client to use your library?
my current setting

    pjsua_config endpointConfig;
    pjsua_config_default(&endpointConfig);
    endpointConfig.cb.on_incoming_call = &onIncomingCall;
    endpointConfig.cb.on_call_media_state = &onCallMediaState;
    endpointConfig.cb.on_call_state = &onCallState;
    endpointConfig.cb.on_call_transfer_status = &onCallTransferStatus;
    endpointConfig.cb.on_call_replaced = &onCallReplaced;
    endpointConfig.cb.on_reg_state2 = &onRegState2;
    endpointConfig.cb.on_reg_started2 = &onRegStarted2;
    endpointConfig.cb.on_nat_detect = &onNatDetect;
    endpointConfig.cb.on_transport_state = &onTransportState;
    endpointConfig.cb.on_call_media_event = &onCallMediaEvent;
    endpointConfig.max_calls = (unsigned int)endpointConfiguration.maxCalls;
    endpointConfig.user_agent = endpointConfiguration.userAgent.pjString;
    endpointConfig.cb.on_ice_transport_error = &onIceTransportError;
    
        endpointConfig.stun_srv_cnt = 1;
        endpointConfig.stun_srv[0] = @"stun.freeswitch.org".pjString;
  
        endpointConfig.cb.on_create_media_transport = &on_create_media_transport;
      
    // Configure the media information for the endpoint.
    pjsua_media_config mediaConfig;
    pjsua_media_config_default(&mediaConfig);
    mediaConfig.clock_rate = (unsigned int)endpointConfiguration.clockRate == 0 ? PJSUA_DEFAULT_CLOCK_RATE : (unsigned int)endpointConfiguration.clockRate;
    mediaConfig.snd_clock_rate = (unsigned int)endpointConfiguration.sndClockRate;

       mediaConfig.enable_ice = PJ_TRUE;
  
/* Initialize the ZRTP transport and the user callbacks */
pjmedia_transport* on_create_media_transport(pjsua_call_id call_id,
                                             unsigned media_idx,
                                             pjmedia_transport *base_tp,
                                             unsigned flags)
{
    pjmedia_transport *zrtp_tp = NULL;
    pj_status_t status;
    pjmedia_endpt* endpt = pjsua_get_pjmedia_endpt();
    
    VSLLogInfo(@"ZRTP transport created");
    status = pjmedia_transport_zrtp_create(endpt, NULL, base_tp,
                                           &zrtp_tp, flags);
    usercb.userData = zrtp_tp;
    
    /* this is optional but highly recommended to enable the application
     * to report status information to the user, such as verfication status,
     * SAS code, etc
     */
    pjmedia_transport_zrtp_setUserCallback(zrtp_tp, &usercb);
    
    /*
     * Initialize the transport. Just the filename of the ZID file that holds
     * our partners ZID, shared data etc. If the files does not exists it will
     * be created an initialized.
     */
    
    NSString *path = [[[[NSFileManager defaultManager] URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask] lastObject] path];
    path = [path stringByAppendingPathComponent:@"simple.zid"];
    pjmedia_transport_zrtp_initialize(zrtp_tp, [path cStringUsingEncoding:1], PJ_TRUE);
    return zrtp_tp;
}

zrtp_isEnrollmentMode always false

Hello,

I built the ZRTP4PJ version for iOS. It all runs perfectly and I don't have problems accepting any SAS keys from other partys. Only when I try to sign the SAS of a PBX enrollment it does not work correctly.
When I try to check the state of the enrollment mode by using int32_t zrtp_isEnrollmentMode(ZrtpContext* zrtpContext); it always returns 0.

Do I use the wrong method or is there a different problem ?

I am using the setup code from the simple_pjsua.c file.

pjmedia_transport* on_create_media_transport(pjsua_call_id call_id,
                                             unsigned media_idx,
                                             pjmedia_transport *base_tp,
                                             unsigned flags)
{
    pjmedia_transport *zrtp_tp = NULL;
    pj_status_t status;
    pjmedia_endpt* endpt = pjsua_get_pjmedia_endpt();

    PJ_LOG(3,(THIS_FILE, "ZRTP transport created"));
    status = pjmedia_transport_zrtp_create(endpt, NULL, base_tp,
                                           &zrtp_tp, flags);
    usercb.userData = zrtp_tp;

    /* this is optional but highly recommended to enable the application
     * to report status information to the user, such as verfication status,
     * SAS code, etc
     */
    pjmedia_transport_zrtp_setUserCallback(zrtp_tp, &usercb);

    /*
     * Initialize the transport. Just the filename of the ZID file that holds
     * our partners ZID, shared data etc. If the files does not exists it will
     * be created an initialized.
     */
    pjmedia_transport_zrtp_initialize(zrtp_tp, "simple.zid", PJ_TRUE);
    return zrtp_tp;
}
static void showSAS(void* data, char* sas, int32_t verified)
{
// Getting the context from a pointer saved to the transport 
    ZrtpContext* context = pjmedia_transport_zrtp_getZrtpContext(zrtp_tp);
// Check for MitM Mode, returns 0
    enrollment = pjmedia_transport_zrtp_isMitmMode(zrtp_tp);
//Check for enrollment mode, returns 0
    int32_t e = zrtp_isEnrollmentMode(context);

    if (!verified) {
        if (enrollment) {
// Objective - C code for handling everything else 
            NSLog(@"------------------\n ENROLLMENT \n -------------------");
            [[CallManager sharedManager] zrtpWithSAS:[NSString stringWithCString:sas encoding:NSUTF8StringEncoding] enrollment:YES];
        }else  {
            [[CallManager sharedManager] zrtpWithSAS:[NSString stringWithCString:sas encoding:NSUTF8StringEncoding] enrollment:NO];
        }

    }



    PJ_LOG(3,(THIS_FILE, "SAS data: %s, verified: %d \n UserData: %@", sas, verified, data));
}

Error import

'/libzrtpcpp/ZrtpCWrapper.h' file not found inside transport_zrtp.h

Using ZRTP4PJ with pjproject-2.3 failed to compile

I have successfully compiled the zrtp4pj with pjproject-1.0, but failed when dealing with pjproject-2.3

The make dep is OK and producing .libzsrtp-x86_64-unknown-linux-gnu.depend in current dir.

I got following error when executing make:

vagrant@vagrant-debian-wheezy:~/src/pjproject-2.3-zrtp/third_party/build/zsrtp$ PJDIR=../../.. make
rm -f build.mak
make -f /home/vagrant/src/pjproject-2.3-zrtp/build/rules.mak APP=ZSRTP app=libzsrtp ../../lib/libzsrtp-x86_64-unknown-linux-gnu.a
make[1]: Entering directory `/home/vagrant/src/pjproject-2.3-zrtp/third_party/build/zsrtp'
make[1]: *** No rule to make target `../../lib/libzsrtp-x86_64-unknown-linux-gnu.a'.  Stop.
make[1]: Leaving directory `/home/vagrant/src/pjproject-2.3-zrtp/third_party/build/zsrtp'
make: *** [libzsrtp] Error 2

Thanks!

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.