[OpenSER-Devel] config file question

Daniel-Constantin Mierla daniel at voice-system.ro
Thu Aug 23 09:37:33 CEST 2007


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 <http://www.spectral.go.ro/>
> __________________
>
> ------------------------------------------------------------------------
> Pinpoint customers 
> <http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50>who 
> are looking for what you sell.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>   



More information about the Devel mailing list