Hello everyone!

I've been working on a call refer from the DSM module and stumbled upon a bug 
in the SEMS core.
When I handle the NOTIFY following the REFER I can create a matching "200 OK" 
and send it to the notifier like this:

transition "NOTIFY received" NOTIFIED - sipRequest(#method==NOTIFY) / {
  dlg.replyRequest(200, OK);
} -> NOTIFYOK;

However, a few seconds later I get an error message on stderr:

 [#7f2610406700/6727] [reply, AmBasicSipDialog.cpp:589] ERROR:  could not find 
any transaction matching request cseq
 [#7f2610406700/6727] [reply, AmBasicSipDialog.cpp:593] ERROR:  request 
cseq=22; reply code=501; callid=qRlqUnleG7; 
local_tag=04BCBF31-566E8B8B00052F0D-10E10700; remote_tag=65lf45YV7
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(0/[0x541588]): /usr/sbin/sems(log_stacktrace+0x38) [0x541588]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(1/[0x48d5ad]): 
/usr/sbin/sems(_ZN16AmBasicSipDialog5replyERK12AmSipRequestjRKSsPK10AmMimeBodyS4_i+0x46d)
 [0x48d5ad]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(2/[0x4f7762]): 
/usr/sbin/sems(_ZN9AmSession12onSipRequestERK12AmSipRequest+0x552) [0x4f7762]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(3/[0x480913]): 
/usr/sbin/sems(_ZN12AmB2BSession12onSipRequestERK12AmSipRequest+0x533) 
[0x480913]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(4/[0x7f261159e0f8]): 
/usr/lib64/sems/plug-in/dsm.so(_ZN7DSMCall12onSipRequestERK12AmSipRequest+0x698)
 [0x7f261159e0f8]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(5/[0x48ccda]): 
/usr/sbin/sems(_ZN16AmBasicSipDialog11onRxRequestERK12AmSipRequest+0x2aa) 
[0x48ccda]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(6/[0x4ef364]): 
/usr/sbin/sems(_ZN9AmSession7processEP7AmEvent+0x114) [0x4ef364]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(7/[0x7f26115a0794]): 
/usr/lib64/sems/plug-in/dsm.so(_ZN7DSMCall7processEP7AmEvent+0x12a4) 
[0x7f26115a0794]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(8/[0x4b17ec]): 
/usr/sbin/sems(_ZN12AmEventQueue13processEventsEv+0x5c) [0x4b17ec]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(9/[0x4f0d57]): 
/usr/sbin/sems(_ZN9AmSession28processEventsCatchExceptionsEv+0x37) [0x4f0d57]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(10/[0x4f2210]): 
/usr/sbin/sems(_ZN9AmSession15processingCycleEv+0x60) [0x4f2210]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(11/[0x4f1291]): /usr/sbin/sems(_ZN9AmSession3runEv+0x81) [0x4f1291]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(12/[0x51ee1d]): /usr/sbin/sems(_ZN8AmThread6_startEPv+0x5d) 
[0x51ee1d]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(13/[0x7f2613ee9851]): /lib64/libpthread.so.0(+0x7851) 
[0x7f2613ee9851]
 [#7f2610406700/6727] [log_stacktrace, log.cpp:218] ERROR: 
stack-trace(14/[0x7f2612dfd90d]): /lib64/libc.so.6(clone+0x6d) [0x7f2612dfd90d]

In AmSession::onSipRequest there is no branch for NOTIFYs so the else-branch is 
taken, generating a "501 Not implemented" message (see reply code in the error 
above).
However, this 501-message is never sent because the NOTIFY has been taken care 
of by the replyRequest method in the DSM scenario. Unfortuately, the 501 is 
still present in SEMS ultimately causing the error above.
(When I comment out the replyRequest for the "200 OK" the 501-message is 
actually sent as a reply for the NOTIFY and no error message is displayed on 
stderr.)

As a workaround I've added a branch in AmSession::onSipRequest for handling a 
NOTIFY with a "200 OK" which seems to solve my problem:

...
else if( req.method == SIP_METH_NOTIFY ){
  dlg->reply(req, 200, "OK");
}
...

I'm not sure about all the ramifications of this workaround yet. But maybe you 
can find a better fix for the problem, so we can handle a NOTIFY without a SIP 
or application error ;-)

Best regards,
Stefan
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to