aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_osp.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-25 04:27:55 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-25 04:27:55 +0000
commit6c4cb5454fdb3be753f731b1ec136bf1907fea90 (patch)
treeab8d22af772f63075879470df697e1baccd043f5 /res/res_osp.c
parent06cd4ccbc289b04a971ce162de5faf27a45738d4 (diff)
Small outgoing OSP cleanups
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3299 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_osp.c')
-rwxr-xr-xres/res_osp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/res/res_osp.c b/res/res_osp.c
index deac15c7b..6270c4a72 100755
--- a/res/res_osp.c
+++ b/res/res_osp.c
@@ -28,6 +28,7 @@
#include <asterisk/utils.h>
#include <asterisk/lock.h>
#include <asterisk/causes.h>
+#include <asterisk/callerid.h>
#include <osp.h>
#include <openssl/err.h>
#include <stdio.h>
@@ -434,6 +435,7 @@ int ast_osp_lookup(struct ast_channel *chan, char *provider, char *extension, ch
char callednum[2048]="";
char destination[2048]="";
char token[2000];
+ char tmp[256]="", *l, *n;
OSPTCALLID *callid;
OSPE_DEST_PROT prot;
@@ -448,6 +450,16 @@ int ast_osp_lookup(struct ast_channel *chan, char *provider, char *extension, ch
if (!callerid)
callerid = "";
+ strncpy(tmp, callerid, sizeof(tmp) - 1);
+ ast_callerid_parse(tmp, &n, &l);
+ if (!l)
+ l = "";
+ else {
+ ast_shrink_phone_number(l);
+ if (!ast_isphonenumber(l))
+ l = "";
+ }
+ callerid = l;
if (chan) {
strncpy(uniqueid, chan->uniqueid, sizeof(uniqueid) - 1);