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

No calls control from anywhere #51

Closed
AlexMarlo opened this issue Jul 16, 2015 · 7 comments
Closed

No calls control from anywhere #51

AlexMarlo opened this issue Jul 16, 2015 · 7 comments

Comments

@AlexMarlo
Copy link
Contributor

i hope to see that i cant get call id and them use it to control call with that id
Now i can control only current call

@AlexMarlo
Copy link
Contributor Author

For implementing this task i have following:

add unique id for call which is independent from any infrastructure (like sip)

I tried to add call id but it is hard task to add crossplatform unique id generator.
To solve this problem we can use incremental call id but i don't know about any thread in design of baresip which can cause same call ids for different calls

@lmangani
Copy link
Contributor

lmangani commented Aug 3, 2015

See comments in #50 this needs broader engineering than simply adding an ID as you would be unable to use it as intended alone

@alfredh
Copy link
Collaborator

alfredh commented Oct 29, 2015

how about this algorithm for generating a globally unique "Call" ID?

GCID = BASE64(HMAC_SHA1(rand, call | rand| ua))

static void mk_uid(struct call *call, struct ua *ua)
{
    char buf[256];
    uint8_t fp[20];
    uint8_t key[8];
    size_t n;
    char b64[128];
    size_t b64_len = sizeof(b64);

    rand_bytes(key, sizeof(key));

    n = re_snprintf(buf, sizeof(buf), "%p%u%p", call, rand_u32(), ua);

    hmac_sha1(key,
          sizeof(key),
          (void *)buf,
          n,
          fp,
          sizeof(fp));

    base64_encode(fp, sizeof(fp), b64, &b64_len);

    re_printf("CALL-UID: %b\n", b64, b64_len);
}

example:

CALL-UID: eSzd1ABaJUFKJyWU6G62q/JrrCs=

@AlexMarlo
Copy link
Contributor Author

i think that call id should be independent from call initialisation.
This means that even before call is created we can generate uid and control it.
But it is only my view on this.

@alfredh
Copy link
Collaborator

alfredh commented Dec 13, 2015

can you suggest a good way to generate this CALLID ?

I am not sure if I understand your suggestions?

@AlexMarlo
Copy link
Contributor Author

For c++ i use http://www.boost.org/doc/libs/1_56_0/doc/html/boost_random.html this library and it can provide very good id generation, but for C i don't know such library.

@alfredh
Copy link
Collaborator

alfredh commented Mar 12, 2016

I have some problems understanding the requirements, so I am going to close
this issue for now.

If someone really needs this, please open a new issue with a very clear description
and preferably also some sample application code to see how the wanted API should be.

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

3 participants