Asterisk 1.4 - PrivacyManager falls through

I’m running Asterisk 1.4 compiled from source on a SuSE Linux 10.0 machine. I have attempted to enable PrivacyManager but it seems to refuse to jump to n+101 even when receiving invalid input.

I tried to test this feature by calling into Asterisk from my old home phone (separate service and DID not associated with my new Asterisk/IAX provider) by disabling CID using *67 prior to the call. However, the phone company sends through the following CID info: “Name Unavailabl” when I use *67. Because the CID number is not blank PrivacyManager doesn’t run at all in this case.

To get around that problem I added some code to blank out the CID number and name if the “stricted” string was observed. Wiping out the CID info does cause PrivacyManager to execute. However, regardless of whether I simply wait for PrivacyManager to timeout, or whether I enter invalid phone numbers (i.e. too short or just press #), the app fails to jump to n+101 and instead continues through the normal path allowing users to access my main menu context.

I have pasted the relevant section from my incoming context as well as an excerpt from the logfile below. I have intentionally shortened my extension to just the area code here.

Please note that PrivacyManager does execute in priority 6 and the log clearly shows that it identified the input as being invalid. However the script continues at priority 7 rather than jumping to 107. Any suggestions as to what I might be doing wrong (or if this is a known bug in 1.4) would be appreciated.

Thanks,
Daniel

[incoming]
exten => 205,1,Answer()
exten => 205,2,SetMusicOnHold(native-classical-ulaw)
exten => 205,3,NoOp(“CID = ${CALLERID(all)}”)
exten => 205,4,Set(CALLERID(num)=${IF($["${CALLERID(num)}"=“stricted”]?${EMPTYSTR}:${CALLERID(num)})})
exten => 205,5,Set(CALLERID(name)=${IF($["${CALLERID(num)}"=“stricted”]?${EMPTYSTR}:${CALLERID(name)})})
exten => 205,6,PrivacyManager()
exten => 205,7,AGI(calleridname.agi)
exten => 205,8,Goto(main,s,1)
exten => 205,107,Goto(main,telemarketer,1)

-- Executing [205@incoming:1] Answer("IAX2/teliax-7", "") in new stack
-- Executing [205@incoming:2] SetMusicOnHold("IAX2/teliax-7", "native-classical-ulaw") in new stack
-- Executing [205@incoming:3] NoOp("IAX2/teliax-7", ""CID = "Name Unavailabl" <stricted>"") in new stack
-- Executing [205@incoming:4] Set("IAX2/teliax-7", "CALLERID(num)=") in new stack
-- Executing [205@incoming:5] Set("IAX2/teliax-7", "CALLERID(name)=Name Unavailabl") in new stack
-- Executing [205@incoming:6] PrivacyManager("IAX2/teliax-7", "") in new stack

== Parsing ‘/etc/asterisk/privacy.conf’: Found
– Playing ‘privacy-unident’ (language ‘en’)
– Playing ‘privacy-prompt’ (language ‘en’)
– Playing ‘privacy-incorrect’ (language ‘en’)
– Playing ‘privacy-prompt’ (language ‘en’)
– Playing ‘privacy-incorrect’ (language ‘en’)
– Executing [205@incoming:7] AGI(“IAX2/teliax-7”, “calleridname.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/calleridname.agi
calleridname.agi: CALLERID IS: unknown
calleridname.agi: Unable to parse phone number for NPA/NXX/station. Phone number is: unknown
– AGI Script calleridname.agi completed, returning 0
– Executing [205@incoming:8] Goto(“IAX2/teliax-7”, “main|s|1”) in new stack
– Goto (main,s,1)
– Executing [s@main:1] Answer(“IAX2/teliax-7”, “”) in new stack
– Executing [s@main:2] Set(“IAX2/teliax-7”, “RETRIES=0”) in new stack
– Executing [s@main:3] Goto(“IAX2/teliax-7”, “prompt|1”) in new stack
– Goto (main,prompt,1)
– Executing [prompt@main:1] Wait(“IAX2/teliax-7”, “2”) in new stack
– Executing [prompt@main:2] Playback(“IAX2/teliax-7”, “vm-extension”) in new stack
– Playing ‘vm-extension’ (language ‘en’)
– Executing [prompt@main:3] WaitExten(“IAX2/teliax-7”, “5”) in new stack
== Spawn extension (main, prompt, 3) exited non-zero on ‘IAX2/teliax-7’
– Hungup ‘IAX2/teliax-7’

didnt read most of that but a thought- as of version 1.2 priority jumping is considered ‘bad’ and is heavily discouraged. you may have to add the ‘j’ flag to privacymanager() to make it use the old jumping behavior.l

I will give that a try tonight. That does bring up another question though. All of the example scripts and documentation I’ve seen still seem to rely on the n+101 jumping. From a programming standpoint I understand the issues this can cause and agree that a more flexible solution would be great, but I haven’t seen any documentation on what that solution is.

If priority jumping has been deprecated then what is the alternative. Is there an official recommended standard solution for managing these command-return branching situations in post-1.2 scripts and where can I find documentation on those techniques?

Sorry if this is a remedial question. I’m new to asterisk and have basically been going by what I’ve read in the asterisk book and the documentation at the voip-info.org asterisk wiki.

Thanks,
Daniel

the new behavior is for an app to set a variable as it exits, which can then be used with ExecIf or GotoIf to create dialplan logic.

The application sets the following channel variable upon completion: PRIVACYMGRSTATUS The status of the privacy manager's attempt to collect a phone number from the user. A text string that is either: SUCCESS | FAILED

you can also enable priority jumping for the entire dialplan by setting priorityjumping=yes in (IIRC) the general section at the top of extensions.conf. This is equivalent to adding a j flag to all apps.

That absolutely did the trick. I’m much happier with explicit branching off the return status rather than using the priority jumping.

Thanks for all your help!