In article <[email protected]>,
Benoit Panizzon <[email protected]> wrote:
> 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:[email protected]:5060;user=phone>
>
> I get "<sip:[email protected]:5060;user=phone>" in the variable $pai.
>
> P-Asserted-Identity: "John Doe" <sip:[email protected]:5060;user=phone>
>
> Is getting me $pai containing just "John".
>
> Anyone a clue how I could get the whole header?
First you need to identify whether the problem is in the Set()
or in the $AGI->get_variable(PAI) (shouldn't that be ("PAI")?)
Add a line to your dialplan just after the line you quoted:
same => n,NoOp(PAI=${PAI})
Then turn on verbose logging and try the call. Look at the logged
NoOp line and see if it contains just the 'John' or the whole value
'"John Doe" <sip:[email protected]:5060;user=phone>'
If it contains the whole value, then the problem is in the AGI library
reading the variable. If it just contains John, the problem is in the
Set() operation in the dialplan.
Cheers
Tony
--
Tony Mountifield
Work: [email protected] - http://www.softins.co.uk
Play: [email protected] - http://tony.mountifield.org
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Check out the new Asterisk community forum at: https://community.asterisk.org/
New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users