Re: pjsip Digest, Vol 197, Issue 3

MR
Mahbub Rahman
Thu, Oct 24, 2024 1:03 PM

unsubscribe  help
---Mahbub

On Thursday, October 24, 2024 at 10:30:36 AM GMT+3, <pjsip-request@lists.pjsip.org> wrote:  

Send pjsip mailing list submissions to
    pjsip@lists.pjsip.org

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
    pjsip-request@lists.pjsip.org

You can reach the person managing the list at
    pjsip-owner@lists.pjsip.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of pjsip digest..."

Today's Topics:

  1. Asynchronicity of launch of the function and its output
      (Ogogon !!!)
  2. What should I do to apply the new log level value? (Ogogon !!!)


Message: 1
Date: Wed, 23 Oct 2024 18:45:24 +0300
From: Ogogon !!! ogogon@ogogon.org
Subject: [pjsip] Asynchronicity of launch of the function and its
    output
To: pjsip@lists.pjsip.org
Message-ID: 1b90ce89-4daf-4f4c-9e40-f0c905fbea6f@ogogon.org
Content-Type: text/plain; charset=UTF-8; format=flowed

Colleagues, please tell me how to properly overcome the asynchronicity
of launch of the function and its output to the console. The function
launched by the command interpreter calls the pjsua_acc_set_registration
function to register on the SIP server or to stop registration. The
function returns control to the command interpreter and it do a line
feed and displays its prompt for entering a new command. At this time, a
message about successful registration appears on the screen. On the same
line. Many blondes do not understand what is happening.

If I understand the technical meaning of what is happening correctly,
then when the pjsua_acc_set_registration function is called, control is
immediately returned to the program and a pthread is started, which
performs registration. They are asynchronous.

Is it possible to somehow synchronize these processes so that
registration and output to the console occurs first, and then control is
returned. Or get a signal for the command line editor to again do a line
feed and once again display the prompt?

Thank you for your advice on the topic of the question,
Ogogon.


Message: 2
Date: Wed, 23 Oct 2024 21:41:19 +0300
From: Ogogon !!! ogogon@ogogon.org
Subject: [pjsip] What should I do to apply the new log level value?
To: pjsip@lists.pjsip.org
Message-ID: f53b1e6d-1855-4cf4-afff-835be490fceb@ogogon.org
Content-Type: multipart/alternative;
    boundary="------------p0ggH2uBCc9Gd80q0dQmlcTO"

Colleagues, please tell me how to apply the changed log level value?

I read the API documentation, in particular the "Group PJ_LOG" chapter.
I wrote a test code in full compliance with its content. It is launched
by the command interpreter, after PJSUA initialization.

int v, n;
*n = atoi (arg);
v = pj_log_get_level ();
printf ("\nbefore %d, new %d\n", v, n);

pj_log_set_level (n);

v = pj_log_get_level ();
printf ("\nafter %d\nj", v);

*Apparently, the functions work fine, the new value of level is returned
on the second request.
*
However, this has no effect on the actual verbosity of the application.
It remains the original.
*
I suppose that something else needs to be done for the new value to be
applied. Unfortunately, this is not in the documentation.
What am I forgetting to do?

Thank you in advance for answers to the essence of my topic,
Ogogon.

unsubscribe  help ---Mahbub On Thursday, October 24, 2024 at 10:30:36 AM GMT+3, <pjsip-request@lists.pjsip.org> wrote: Send pjsip mailing list submissions to     pjsip@lists.pjsip.org To subscribe or unsubscribe via email, send a message with subject or body 'help' to     pjsip-request@lists.pjsip.org You can reach the person managing the list at     pjsip-owner@lists.pjsip.org When replying, please edit your Subject line so it is more specific than "Re: Contents of pjsip digest..." Today's Topics:   1. Asynchronicity of launch of the function and its output       (Ogogon !!!)   2. What should I do to apply the new log level value? (Ogogon !!!) ---------------------------------------------------------------------- Message: 1 Date: Wed, 23 Oct 2024 18:45:24 +0300 From: Ogogon !!! <ogogon@ogogon.org> Subject: [pjsip] Asynchronicity of launch of the function and its     output To: pjsip@lists.pjsip.org Message-ID: <1b90ce89-4daf-4f4c-9e40-f0c905fbea6f@ogogon.org> Content-Type: text/plain; charset=UTF-8; format=flowed Colleagues, please tell me how to properly overcome the asynchronicity of launch of the function and its output to the console. The function launched by the command interpreter calls the pjsua_acc_set_registration function to register on the SIP server or to stop registration. The function returns control to the command interpreter and it do a line feed and displays its prompt for entering a new command. At this time, a message about successful registration appears on the screen. On the same line. Many blondes do not understand what is happening. If I understand the technical meaning of what is happening correctly, then when the pjsua_acc_set_registration function is called, control is immediately returned to the program and a pthread is started, which performs registration. They are asynchronous. Is it possible to somehow synchronize these processes so that registration and output to the console occurs first, and then control is returned. Or get a signal for the command line editor to again do a line feed and once again display the prompt? --- Thank you for your advice on the topic of the question, Ogogon. ------------------------------ Message: 2 Date: Wed, 23 Oct 2024 21:41:19 +0300 From: Ogogon !!! <ogogon@ogogon.org> Subject: [pjsip] What should I do to apply the new log level value? To: pjsip@lists.pjsip.org Message-ID: <f53b1e6d-1855-4cf4-afff-835be490fceb@ogogon.org> Content-Type: multipart/alternative;     boundary="------------p0ggH2uBCc9Gd80q0dQmlcTO" Colleagues, please tell me how to apply the changed log level value? I read the API documentation, in particular the "Group PJ_LOG" chapter. I wrote a test code in full compliance with its content. It is launched by the command interpreter, after PJSUA initialization. *int v, n;* *n = atoi (arg); v = pj_log_get_level (); printf ("\nbefore %d, new %d\n", v, n); pj_log_set_level (n); v = pj_log_get_level (); printf ("\nafter %d\nj", v); *Apparently, the functions work fine, the new value of level is returned on the second request. * However, this has no effect on the actual verbosity of the application. It remains the original. * I suppose that something else needs to be done for the new value to be applied. Unfortunately, this is not in the documentation. *What am I forgetting to do?* -- Thank you in advance for answers to the essence of my topic, Ogogon.