< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] question about how to close a batch of sip sessions at the same time


How fast are you terminating the DUM and stack processing loops?  You need to keep those running until all of the messages are sent out.  Once you issue the DUM shutdown API you should wait for the dum shutdown event to signal before stopping the process loop.

http://www.resiprocate.org/DUM_Application_Shutdown

If you are doing all of the above properly, then the only other thing I can think of is the recent bug with the random number generation under Windows.  It may be causing your requests to be sent with the same branch id / tid.  Take a look back through the list posting for the last month or two, if you think that may be the case.  http://list.resiprocate.org/archive/resiprocate-users/msg01664.html

Scott

On Mon, Oct 24, 2011 at 3: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
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel