diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-15 22:10:04 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-15 22:10:04 +0000 |
commit | ca2b7b06fea64f2314672d97836e60aa173c0d47 (patch) | |
tree | 648bac19a9c031de9d3b6f909147b66e0237c56a /channels | |
parent | 343a0e2502690fcbca0146159ec4369e2b53af5f (diff) |
Merged revisions 188646 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r188646 | dvossel | 2009-04-15 17:08:40 -0500 (Wed, 15 Apr 2009) | 12 lines
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/trunk@188647 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_dahdi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index dd2048fa0..d5063b661 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -11323,6 +11323,12 @@ static void ss7_start_call(struct dahdi_pvt *p, struct dahdi_ss7 *linkset) #if defined(HAVE_SS7) static void ss7_apply_plan_to_number(char *buf, size_t size, const struct dahdi_ss7 *ss7, const char *number, const unsigned nai) { + 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 (nai) { case SS7_NAI_INTERNATIONAL: snprintf(buf, size, "%s%s", ss7->internationalprefix, number); @@ -12347,6 +12353,12 @@ static void apply_plan_to_number(char *buf, size_t size, const struct dahdi_pri snprintf(buf, size, "%s", number); return; } + 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); |