[OpenSER-Devel] config file question

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


Hi Daniel and thanks for the promt response. I've looked over m_store() in the msilo module, very nicely made validations, but in my case the to and from are NULL in the sip_msg struct... so I can't even check the ->parsed member.
   
  BR,
  JP.
  
Daniel-Constantin Mierla <daniel at voice-system.ro> wrote:
  Hello,

in your functions you have to be sure that the From header is parsed and 
the body as well. OpenSER does not parse the whole message, only what is 
needed for processing. A good function to look at is m_store() from 
msilo module.

Cheers,
Daniel

On 08/23/07 10:29, Ioan-Paul Pirau wrote:
> 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.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
> 


       
---------------------------------
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openser.org/pipermail/devel/attachments/20070823/713f95ec/attachment-0001.htm


More information about the Devel mailing list