Re: [reSIProcate] question about how to close a batch of sip sessions at the same time
One additional observation:
I turn off all the log information showing in the console which by
default is turned on in the library.
--------------------
Log::setLevel(Log::None);
--------------------
If I remove this line to let the console shows those log information,
without adding any delay when calling end() to stop a batch of sip
sessions, all sip clients can receive the sip ending signal from the
server. seems it has some subtle timing issue here, those log printing
out give additional time for the sip signal to reach the sip clients.
Would any one please give me some hints how to do it correctly without
showing those log information?
Thanks!
-Allen
On Mon, Oct 24, 2011 at 12:24 PM, Allen Guan <allenguan@xxxxxxxxx> wrote:
> Hi, all,
>
> I have a question about how to close a batch of sip sessions at the same time.
>
> I have created a sip server, using DUM with a InviteSessionHandler to
> handle the sip connections, during the time of
> onNewSession(ServerInviteSessionHandle oServerInviteSessionHandle ..),
> I set up a map from the new connection's callid to the
> oServerInviteSessionHandle for later usage.
>
> I write a DUM thread code as the following running in a separate thread:
>
> while( true )
> {
> // step 1. check if exist a command to stop a sip session, if so,
> find out its ServerInviteSessionHandle and issue end() command.
>
> // step 2.
> std::auto_ptr<Message> msg(oDialogUsageManager->getNext(1000));
> if (msg.get())
> oDialogUsageManager->internalProcess(msg);
> }
>
> I have a problem with this code, if I issue the command to stop a sip
> session with some delay in between, for example, one second, all the
> sip clients of the batch of sip sessions can receive the sip ending
> signal from the server. but if in the step 1, all the end() functions
> are made to stop the sip session, most of the time only one sip client
> can receive the sip ending signal from the server.
>
> my question is, have I written this code in the correct way? is there
> a timing issue I need to take care of?
>
> Eagerly looking forward to hear from your comments. Thanks a lot in advance.
>
> -Allen
>