[Serusers] how to add a header into the reply??

szj zjsun at biigroup.com
Mon Mar 14 10:10:46 CET 2005


  I want to add some extra header to the positive responce.
I don't want to attain that in script, instead I want to
do that in the code or another module. What I did is
to add the following into the reply_received function.

 if((t->flags & T_IS_INVITE_FLAG) && (!is_local(t)) && (msg_status >=200 
&& msg_status <300))
  {
    typedef  int(*local_fp)(struct sip_msg *msg, char *txt, int flags);
    local_fp append_to_reply = NULL;
    append_to_reply = (local_fp)find_export("append_to_reply", 1, 0);
    if(append_to_reply){
      DBG("DEBUG: SUNZJ find apppend_to_reply\n");
      append_to_reply(p_msg, "P-Security-Nobody:  this is a test header 
for \r\n", 0);
    }
  }

 But it doesn't seem to work for me. I can't see the added text from my 
SIP UA log.
How could I get to that??

  Thanks for your instructions!
  Best Regards

  Sun Zongjun




More information about the sr-users mailing list