aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-30 04:16:38 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-30 04:16:38 +0000
commita9a990c34439999f57a0993ddf1b81c8501bae91 (patch)
treeac13fdc97eba41953e221550011bf44b2e0cf4fe /channels
parentc10fca18f2a1aab415df2cd4af54f5ed64b49970 (diff)
Issue #6450 - Don't remove characters from SIP uri's when not needed
Patch by jcomellas, heavily modified by oej git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16425 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c16817dfa..4ce8a121f 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7234,7 +7234,8 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
*c = '\0';
tmp = ast_strdupa(of);
if (tmp) {
- ast_shrink_phone_number(tmp);
+ if (ast_is_shrinkable_phonenumber(tmp))
+ ast_shrink_phone_number(tmp);
ast_string_field_set(p, cid_num, tmp);
} else {
ast_string_field_set(p, cid_num, of);
@@ -7265,7 +7266,8 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
ast_string_field_set(p, cid_name, calleridname);
tmp = ast_strdupa(rpid_num);
if (tmp) {
- ast_shrink_phone_number(tmp);
+ if (ast_is_shrinkable_phonenumber(tmp))
+ ast_shrink_phone_number(tmp);
ast_string_field_set(p, cid_num, tmp);
} else {
ast_string_field_set(p, cid_num, rpid_num);
@@ -7301,7 +7303,8 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
if (!ast_strlen_zero(user->cid_num) && !ast_strlen_zero(p->cid_num)) {
char *tmp = ast_strdupa(user->cid_num);
if (tmp) {
- ast_shrink_phone_number(tmp);
+ if (ast_is_shrinkable_phonenumber(tmp))
+ ast_shrink_phone_number(tmp);
ast_string_field_set(p, cid_num, tmp);
} else {
ast_string_field_set(p, cid_num, user->cid_num);
@@ -7376,7 +7379,8 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
if (*calleridname)
ast_string_field_set(p, cid_name, calleridname);
if (tmp) {
- ast_shrink_phone_number(tmp);
+ if (ast_is_shrinkable_phonenumber(tmp))
+ ast_shrink_phone_number(tmp);
ast_string_field_set(p, cid_num, tmp);
} else {
ast_string_field_set(p, cid_num, rpid_num);
@@ -7430,7 +7434,8 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
if (!ast_strlen_zero(peer->cid_num) && !ast_strlen_zero(p->cid_num)) {
char *tmp = ast_strdupa(peer->cid_num);
if (tmp) {
- ast_shrink_phone_number(tmp);
+ if (ast_is_shrinkable_phonenumber(tmp))
+ ast_shrink_phone_number(tmp);
ast_string_field_set(p, cid_num, tmp);
} else {
ast_string_field_set(p, cid_num, peer->cid_num);