PJSip: How to modify SIP headers, like From, To and Contact, fields? (Johan Lantz)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bala

Other may have better suggestions but I think one way to modify outgoing messages could be to add a pjsip module that modifies the message before it is printed to the continous buffer. Look in the doc for handling on_tx_request.

In the case of the Contact header for pjsua there is a config element that allows you to add extensions to the contact parama. Maybe you could use this as a reference.

/**
     * Additional URI parameters that will be appended in the Contact header
     * for this account. This will affect the Contact header in all SIP 
     * messages sent on behalf of this account, including but not limited to
     * REGISTER, INVITE, and SUBCRIBE requests or responses.
     *
     * The parameters should be preceeded by semicolon, and all strings must
     * be properly escaped. Example:
     *	 ";my-param=X;another-param=Hi%20there"
     */
    pj_str_t	    contact_params;

/Johan

Message: 1
Date: Wed, 17 Jun 2009 11:50:00 -0700
From: "Muthusamy, Balamurugan" <bmuthusa@xxxxxxxxxxxx>
Subject: PJSip: How to modify SIP headers, like From,	To and
	Contact fields?
To: "pjsip at lists.pjsip.org" <pjsip at lists.pjsip.org>
Message-ID:
	<48A510997E574B4FBE5F146FED29CEFA380156BAE1 at NALASEXMB04.na.qualcomm.com>
	
Content-Type: text/plain; charset="us-ascii"

I am using P J Sip of pjproject-1.2, in linux.

I have a need to modify / add to the core SIP header fields, like To, From and Contact.

Here is an example:
This is the current contact message that PJSIP INVITE creates (for outgoing INVITE):
Contact: <sip:858*610*10000 at 10.8.39.34:5060>

I need to change this to something like this: Contact: <sip:858*610*10000 at 10.8.39.34:5060>;cache;range="23,24,25,26"

Modifying the "local Contact" argument of pjsip_dlg_create_uac, and passing it "<sip:858*610*10000 at 10.8.39.34:5060>;cache;range="23,24,25,26"" causes a failure of pjsip_dlg_create_uac.

Any ideas how to do this?
Bala




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux