[OpenSER-Devel] config file question

Ioan-Paul Pirau ioanpaulpirau at yahoo.com
Thu Aug 23 09:29:39 CEST 2007


Hello,
   
   My name is John Paul Pirau and I'm trying to use openser to create a sip proxy server that gets and forwards incomming "MESSAGE" sip messages. And I encountered a problem while trying to process an incoming message. My module exports 2 functions :
   
  int ValidateMessage(sip_msg* sip, char*, char*) and
  int HandleMessage(sip_msg* sip, char*, char*)
   
  the ideea is that I want to make a validation before I send back the 200 OK response. And if the message does not have the required information then I want to send back the 400 Bad Request response. So I figured out that a script in the openser config file should do the trick. Here it is :
   
  route{
  ...
      if(ValidateMessage()){
          sl_send_reply("200", "OK") ;
          HandleMessage();
      }
      else {
          sl_send_reply("400","Bad Request");
      }
  ...
  }
   
  ..well it doesn't work because the ValidateMessage() gets an invalid sip_msg structure as parameter. After some debug I figured out that te from, to and message body is not present in the sip_msg structure. On the contrary in the HandleMessage function I get a perfectly valid sip_msg struct
   
  Any ideea on what's going on ?
   
   
  ...
   
  And I also tryed a different aproach.. Here it is :
   
  route{
  ...
      sl_send_reply("182", "Queued") ;
      if(ValidateMessage()){
          sl_send_reply("200", "OK") ;
          HandleMessage();
      }
      else {
          sl_send_reply("400","Bad Request");
      }
  ...
  }
   
  The big difference is that with this .cfg I get a valid sip_msg struct in ValidateMessage() but HandleMessage() never gets called ???.  Any ideeas ?


Best Regards, 
__________________ 
Ioan-Paul Pirau. 
Software Engineer 
www.spectral.go.ro 
__________________


       
---------------------------------
Pinpoint customers who are looking for what you sell. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openser.org/pipermail/devel/attachments/20070823/b3a1ecb9/attachment.htm


More information about the Devel mailing list