Hi Stefan,

-------- Originele bericht --------
Onderwerp: Re: [Sems] Response to INFO messages in C2D app (AmB2BSession)
Datum: 16-9-2009 16:40
[...]
implement your own onSipRequest method where you catch INFO like this:
void MyCalleeSession::onSipRequest(const AmSipRequest& req)
{
 if ((req.method=="INFO") &&
   (req.content_type == "whatever") &&
 // maybe some more checks here
    ) {
        dlg.reply(req, 200, "OK" ["application/mycontent", "body..."]);
    }
} else {
 AmB2BCalleeSession::onSipRequest();
}
}

For the record:

Don't forget to add dlg.updateStatus(req); in there or else it will give you the following error: "could not find any transaction matching request". My code now looks like:

void C2DCalleeDialog::onSipRequest(const AmSipRequest& req)
{
   if ( (req.method=="INFO") ) {
DBG("INFO received with content_type=%s length=%d\n", req.content_type.c_str(), (getHeader(req.hdrs, "Content-Type", "c")).length() ); if ( req.content_type == "" && !(getHeader(req.hdrs, "Content-Type", "c")).length() ){
           dlg.updateStatus(req);
           DBG("Replying empty INFO with 200 OK\n");
           dlg.reply(req, 200, "OK" );
           return;
       }
   }

   AmB2BCalleeSession::onSipRequest( req );
}

Best regards,

Tom

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

Reply via email to