summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-03-30 04:16:38 +0000
committerOlle Johansson <oej@edvina.net>2006-03-30 04:16:38 +0000
commit2c4ebe356e19b02617fbaffe95d03610aeb6182e (patch)
treeac13fdc97eba41953e221550011bf44b2e0cf4fe /channels
parent0c134c5cba0113f23dd4894dc89c61c3878792e8 (diff)
Issue #6450 - Don't remove characters from SIP uri's when not needed
Patch by jcomellas, heavily modified by oej git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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);