aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-15 22:08:40 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-15 22:08:40 +0000
commit14ae45a40691d86e405d700f7b2e0420dbe050b1 (patch)
treeaa67c2bfac31991d0e12a6c82e06ee6d37646a9f /channels
parent53c494103eb8376ee303dec4f367a79ff7ff6b5c (diff)
National prefix inserted even when caller ID not available
When the caller ID is restricted, the expected behavior is for the caller id to be blank. In chan_dahdi, the national prefix is placed onto the callers number even if its restricted (empty) causing the caller id to be the national prefix rather than blank. (closes issue #13207) Reported by: shawkris Patches: national_prefix.diff uploaded by dvossel (license 671) Review: http://reviewboard.digium.com/r/220/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@188646 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index e1f9e437c..76c701a91 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -8819,6 +8819,13 @@ static char * redirectingreason2str(int redirectingreason)
static void apply_plan_to_number(char *buf, size_t size, const struct dahdi_pri *pri, const char *number, const int plan)
{
+ if (ast_strlen_zero(number)) { /* make sure a number exists so prefix isn't placed on an empty string */
+ if (size) {
+ *buf = '\0';
+ }
+ return;
+ }
+
switch (plan) {
case PRI_INTERNATIONAL_ISDN: /* Q.931 dialplan == 0x11 international dialplan => prepend international prefix digits */
snprintf(buf, size, "%s%s", pri->internationalprefix, number);