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

Re: [reSIProcate-users] clientSubscription NOTIFY problem


...answers inline...

On Tue, Jun 8, 2010 at 1:19 PM, Klaus Darilion <klaus.mailinglists@xxxxxxxxx> wrote:
Hi Scott!

So far my simple watcher seems to work, thanks.

My watcher is based on the basicRegister example. If I understand it correctly, the stack/DUM only do any processing when dum.process is called (from basicRegister).

     stack.buildFdSet(fdset);
     int err = fdset.selectMilliSeconds(100);
     assert ( err != -1 );

     stack.process(fdset);
     while(clientDum.process());

Shouldn't it be (nothing todo if select returns 0):

 if (err) {
     stack.process(fdset);
 }
 while(clientDum.process());

Although inefficient basicRegister relies on the select breaking out every 100ms and calling process, in order to have the stack process new messages from the tu (DUM) to be sent out on the wire (in these cases no fd is signaled).  Use of the AsyncProcessHandler and InterruptableStackThread will help to avoid this.  See wiki page referenced below.

What happens if my application blocks during callback processing? I guess the whole application blocks?

Correct.  If you use a separate thread for stack processing and one for DUM, then you will only be blocking DUM processing in your callbacks.

Further, is there a mode to let stack/dum create a thread itself for internal processing (so that I do not need an event loop in the application, but wait for callback events)?

There is a pretty detailed wiki page on all this stuff:   http://www.resiprocate.org/DUM_Threading

And a last question: Does resiprocate contains helpers to parse the XML bodies (presence/dialog)? If, is there a recommendation for an XML library which fits nicely into resiprocate?

There is a very basic XML parser in resip, check out the XmlCursor class.   If you are doing lots of heavy XML parsing you should probably look into integrating a more complete thirdparty library - I don't have a particular one to recommend.

Thanks
Klaus

Am 08.06.2010 18:15, schrieb Scott Godin:
You would need to call h->acceptUpdate from the various onUpdateXXXX
callbacks.

Scott

On Tue, Jun 8, 2010 at 11:47 AM, Klaus Darilion
   Hi Scott!

   Looks like a human error - I failed to read the logs correctly. I
   see that DUM calls following functions of my subscribeHandler:

   INFO | 20100608-173702.484 | basicRegister.exe | RESIP:TEST | 4280 |
   basicRegister.cxx:101 | SubscriptionHandler::onNewSubscription:

   DEBUG | 20100608-173702.484 | basicRegister.exe | RESIP:DUM | 4280 |
   ClientSubscription.cxx:112 | no queued notify
   DEBUG | 20100608-173702.484 | basicRegister.exe | RESIP:TRANSACTION
   | 4280 | TimerQueue.cxx:105 | Adding application timer:
   DumTimeout::Subscription ClientSubscription
   sip:test_test@xxxxxxxxxxx <mailto:sip%3Atest_test@xxxxxxxxxxx>:

   duration=3239 seq=1
   INFO | 20100608-173702.484 | basicRegister.exe | RESIP:DUM | 4280 |
   ClientSubscription.cxx:369 | [ClientSubscription] reSUBSCRIBE in 3239
   INFO | 20100608-173702.484 | basicRegister.exe | RESIP:TEST | 4280 |
   basicRegister.cxx:83 | SubscriptionHandler::onUpdateActive:


   1. SubscriptionHandler::onNewSubscription:
   2. SubscriptionHandler::onUpdateActive:


   I guess in one of the callbacks I should process the NOTIFY's body
   and instruct DUM to reply with 200 ok.

   In which callback? How?

   Thanks
   Klaus

   Am 08.06.2010 17:27, schrieb Scott Godin:

       Hi Klaus,

       You appear to doing everything correctly.  Is the event header
       in the
       notify message set to "presence"?  The resip DEBUG log should
       help to
       see what's going on.  To log to file you should initialize the
       logger as
       follows:
       Log::initialize(Log::File, Log::Info, argv[0], "resip.log", NULL);

       Scott

       On Tue, Jun 8, 2010 at 10:26 AM, Klaus Darilion
       <klaus.mailinglists@xxxxxxxxx
       <mailto:klaus.mailinglists@xxxxxxxxx>
       <mailto:klaus.mailinglists@xxxxxxxxx
       <mailto:klaus.mailinglists@xxxxxxxxx>>> wrote:

           I now have added:

              profile->addSupportedMethod(NOTIFY);
              profile->addSupportedMimeType(NOTIFY, Mime("application",
       "pidf+xml"));

           Now resip responds to the incoming NOTIFY with 100 trying,
       but it
           still does not call back callback handler....

           any ideas?

           thanks
           klaus

           Am 08.06.2010 13:11, schrieb Klaus Darilion:

               Hi!

               I try to write a simple watcher. I do:

               1. registration handler and perform registration -> works.

               2. perform outgoing subscription -> works, but incoming
       NOTIFY are
               rejected with "405 Method not support".

               For the clientSubscription I have done:

               1. made a handler class:
               class SubscriptionHandler : public
       ClientSubscriptionHandler {
               virtual void onUpdatePending
               ...
               }

               2. define a handler and add it to DUM:
               ...
               DialogUsageManager clientDum(stack);
               SubscriptionHandler subscriptionHandler;
               clientDum.addClientSubscriptionHandler("presence",
       &subscriptionHandler);
               ...

               3. subscribe

               SharedPtr<SipMessage> subMessage =
               clientDum.makeSubscription(presentityAor, "presence");
               clientDum.send( subMessage );


               The logs do not show an error (attached). The only
       strange thing
               I can
               spot is "Failed RequestURI validation NOTIFY
       sip:test_test@xxxxx
               .0.51:32036"

               Any hints what I am doing wrong?

               thanks
               Klaus

               PS: How can I log to a file?



               _______________________________________________
               resiprocate-users mailing list
       resiprocate-users@xxxxxxxxxxxxxxx
       <mailto:resiprocate-users@xxxxxxxxxxxxxxx>
       <mailto:resiprocate-users@xxxxxxxxxxxxxxx
       <mailto:resiprocate-users@xxxxxxxxxxxxxxx>>

               List Archive:
       http://list.resiprocate.org/archive/resiprocate-users/

           _______________________________________________
           resiprocate-users mailing list
       resiprocate-users@xxxxxxxxxxxxxxx
       <mailto:resiprocate-users@xxxxxxxxxxxxxxx>
       <mailto:resiprocate-users@xxxxxxxxxxxxxxx
       <mailto:resiprocate-users@xxxxxxxxxxxxxxx>>

           List Archive:
       http://list.resiprocate.org/archive/resiprocate-users/