Extracting A SIP Header From A 302 Response

Home » Asterisk Users » Extracting A SIP Header From A 302 Response
Asterisk Users No Comments

I got the response below from a provider. How do I extract the Identity header and apply it to the next INVITE? Is it possible at all with PJSIP?
SIP/2.0 302 Moved Temporarily Via: SIP/2.0/UDP 172.16.7.254:52169
;rport=52169;received=XX.205.172.89;branch=z9hG4bK-524287-1—129f4244aaba9f04
Call-ID: 102650Mzg4NmFiNTQzOGY5NDJmNjM3OTYzNmE5MzNlZDIwZmI
From: “Peter Perez” ;tag=81a25c36
To: ;alg=ES256 CSeq: 1 INVITE
Server: Asterisk PBX 16.10.0
Contact:
Reason: Q.850;cause=0
Content-Length: 0