Need help with Gosubif and SIPCHANINFO

Hi all,

someone built code in asterisk and I’m trying to setup a line in the script that will bypass the pin code if the peer is a fax machine, specifically ext 2006

The line is :

[sub_leastcost_maybepin]
exten => _613NXXXXXX,1,Return
exten => _819NXXXXXX,1,Return
exten => _1800NXXXXXX,1,Return
exten => _1888NXXXXXX,1,Return
exten => _1877NXXXXXX,1,Return
exten => _1866NXXXXXX,1,Return
exten => _1855NXXXXXX,1,Return
; Below is to not request pin code if peer is 2006 IS Fax Machine
exten => _X.,1,GosubIf($["${SIPCHANINFO(peername)}" != “IS Fax”]?sub_pincode,s,1)
exten => _X.,1,GosubIf($["${SIPCHANINFO(peerip)}" != ‘172.20.32.32’]?sub_pincode,s,1)

; exten => _X.,1,Gosub(sub_pincode,s,1)
exten => _X.,n,Return

; Called with ${EXTEN:1} (i.e. no leading 8 or 9)

The lines that are bolded is what Im playing with but everything I have tried does not work. I want to bypass the pincode and dialout if the peer matches.

Can someone help?

" is not ’

(Also SIPCHANINFO is deperecated. Use CHANNEL.)

What do you mean is not?

" is “
’ is '
” is not ‘
’ is not "

These characters are treated as part of the string in recent versions of Asterisk.

You talking about replacing the = or != ?

I am talking about using using the same quotes on both sides of the comparison.

Oh, ya… This i tried to, but still the call goes to sub_pincode

The IS Fax is all double quotes and that also does not work