[Home]

Summary:ASTERISK-06938: [patch] callingpres ignored when callerid not set
Reporter:Stefano Brandimarte (stevens)Labels:
Date Opened:2006-05-09 15:07:21Date Closed:2006-05-24 11:20:05
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_zap
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:The zap channel driver ignores the callingpres value if the callerid isn't set,
and set always "unavailable" (67), causing incorrect behaviours:

pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
                 l ? (p->use_callingpres ? ast->cid.cid_pres :
                      PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN) :
                      PRES_NUMBER_NOT_AVAILABLE);


****** STEPS TO REPRODUCE ******

exten => _X.,1,Set(CALLERID(all)=)
exten => _X.,2,callingpres(32)
; exten => _X.,2,SetCallerPres(prohib_not_screened)
exten => _X.,4,Dial(${TRUNK}/${EXTEN})
exten => _X.,5,Hangup()

pri debug span <x>

and see what happens.

****** ADDITIONAL INFORMATION ******

Often this means the TELCO will send out the base callerid instead of hiding it.
In fact legacy PBXes are able to send an empty callerid AND callingpres set to a
defined value (e.g. 32) and not always 67 (unavailable).
Comments:By: Serge Vecher (serge-v) 2006-05-17 10:35:08

stevens: do you have a patch to remedy this situation?

By: Stefano Brandimarte (stevens) 2006-05-17 12:39:42

something like this it think could suffice, assuming the callerpres is checked
against allowed values elsewhere; patch against asterisk 1.2.7.1 (edited because of a typo: cid_pres is 0 when allowed_not_screened, so the test should be >= 0):

--- chan_zap.dist.c     2006-04-04 20:28:14.000000000 +0200
+++ chan_zap.c  2006-05-17 19:31:56.000000000 +0200
@@ -2120,7 +2120,7 @@
                       }
               }
               pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
-                                       l ? (p->use_callingpres ? ast->cid.cid_pres : PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN) :
+                                       (ast->cid.cid_pres >= 0) ? (p->use_callingpres ? ast->cid.cid_pres : PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN) :
                                                PRES_NUMBER_NOT_AVAILABLE);
               pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL);



By: Kevin P. Fleming (kpfleming) 2006-05-24 11:20:05

Fixed in branch-1.2 revision 29969 and trunk revision 29970.