[reSIProcate] question about how to close a batch of sip sessions at the same time
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