Forwarding and Privacy

Got an Asterisk 1.2.4 and having a spot of bother with forwarding calls faithfully.

Essentially, when doing SIP in SIP out, I’d like to place an outbound call that’s identical to the inbound call in terms of From: address and Remote-Party-Id: address. It seems that Asterisk is conflating the two and then sending out an INVITE message without the Remote-Party-Id: field.

Is this working as designed, or are there some config settings to get this to work properly?

Also, for SIP in ZAP out, when calls come in with “privacy=uri” in the Remote-Party-Id field, I’d like to see them forwarded to Q.931 ports with the correct presentation flags. This doesn’t seem to happen either.

Further to this, I’m looking at trying to do an AGI script. One thing I’d like to do is have access to the INVITE message so I can parse Remote-Party-ID and From fields myself before using set_callerid and setcallerpres.

Is this possible?