Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect sip over websocket #37

Open
Pastor02 opened this issue Feb 9, 2021 · 0 comments
Open

Connect sip over websocket #37

Pastor02 opened this issue Feb 9, 2021 · 0 comments

Comments

@Pastor02
Copy link

Pastor02 commented Feb 9, 2021

Hi people, i'm try to connect with Android ndk but i'm new in this topic.

i have two questions.

  1. Exist any documentation for use the library in C?

  2. i am try to use the next functions to connect with websocket.

CREATE AGENT-->

static const char* AUDIO_CODECS = "PCMU/8000/1";
static const char* VIDEO_CODECS = "h264";
static const char* DEFAULT_TRANSPORT = "ws";
static const int DEFAULT_LIFETIME = 7200;
  char sipChar[1024];
    memset(sipChar, 0, sizeof(sipChar));

    snprintf(sipChar, sizeof(sipChar),
             "<sip:%s:%s@%s;transport=%s>;regint=%d;regq=0.5;answermode=manual;audio_codecs=%s",
             username, password,
             sip_server, DEFAULT_TRANSPORT, DEFAULT_LIFETIME,
             AUDIO_CODECS


    );
    LOGI("AGENT: %s", sipChar);

    int err = ua_alloc(&userAgent, sipChar);
    if(err) {
        LOGI("ERROR: create_agent error! %d", err);
        return EXIT_FAILURE;
    }
    return (long) &userAgent;

CALL -->

void start_audio_call(const char* peer) {
    ua_connect(userAgent, NULL, NULL, peer, 0);
}

But return session closed: Protocol error

i'm use to example this Demo but he used only tcp protocol (https://github.com/MobiSciLab/Baresip-DemoAudioCall)

Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant