[asterisk-users] Perl AGI: read variable with quotes

Benoit Panizzon benoit.panizzon at imp.ch
Fri Jan 24 08:47:49 CST 2020

Hi Gang

I have stumbled of this problem.

I need the P-Asserted-Identity header in an AGI scrip.

In the Dial-Plan I do:

same => n,Set(PAI=${PJSIP_HEADER(read,P-Asserted-Identity)})

In the AGI I do:

my $pai = $AGI->get_variable(PAI);

This works fine, unless the PAI contains quotes:

P-Asserted-Identity: <sip:1000 at;user=phone>

I get "<sip:1000 at;user=phone>" in the variable $pai.

P-Asserted-Identity: "John Doe" <sip:2000 at;user=phone>

Is getting me $pai containing just "John".

Anyone a clue how I could get the whole header?

Mit freundlichen Grüssen

-Benoît Panizzon-
I m p r o W a r e   A G    -    Leiter Commerce Kunden

Zurlindenstrasse 29             Tel  +41 61 826 93 00
CH-4133 Pratteln                Fax  +41 61 826 93 01
Schweiz                         Web  http://www.imp.ch

More information about the asterisk-users mailing list