[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 1.2.3.4:5060;user=phone>

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

P-Asserted-Identity: "John Doe" <sip:2000 at 1.2.3.4:5060;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