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

[reSIProcate-users] Added message body and headers not included during re-subscription


Title: Added message body and headers not included during re-subscription

Hi,

I create a SUBSCRIBE message using DialogUsageManager::makeSubscription(). I add a message body and a couple message headers to the SUBSCRIBE message. I then use DialogUsageManager::send() to send out the SUBSCRIBE message. It looks good for the first SUBSCRIBE message. When the subscription expiry timer expires, it does a refresh subscription. However, in the re-SUBSCRIBE message, I don't see the message body and message headers that are added by me. My code looks something like this:

  // create SUBSCRIBE message
  SharedPtr<SipMessage> msg;
  msg = Dum.makeSubscription(targetUri, event.c_str());

  // add message body and headers
  std:string body = "<some values>";
  msg->header(h_ContentType).type() = "text";
  msg->header(h_ContentType).subtype() = "xml";
  char *buf = new char[body.size() + 1];
  msg->addBuffer(buf);
  strcpy(buf, body.c_str());
  msg->setBody(buf, body.size());

  // send SUBSCRIBE messge
  Dum.send(msg);

The way I use to overcome this problem is to re-include the message body and header in the function ClientSubscriptionHandler::onReadyToSend(). Are there other recommended ways?

Thank you.

Regards,
Kok Meng