mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Small outgoing OSP cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -192,7 +192,10 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
if (chan->cdr) {
|
if (chan->cdr) {
|
||||||
start = chan->cdr->answer.tv_sec;
|
start = chan->cdr->answer.tv_sec;
|
||||||
|
if (start)
|
||||||
duration = time(NULL) - start;
|
duration = time(NULL) - start;
|
||||||
|
else
|
||||||
|
duration = 0;
|
||||||
} else
|
} else
|
||||||
ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
|
ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include <asterisk/utils.h>
|
#include <asterisk/utils.h>
|
||||||
#include <asterisk/lock.h>
|
#include <asterisk/lock.h>
|
||||||
#include <asterisk/causes.h>
|
#include <asterisk/causes.h>
|
||||||
|
#include <asterisk/callerid.h>
|
||||||
#include <osp.h>
|
#include <osp.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <stdio.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 callednum[2048]="";
|
||||||
char destination[2048]="";
|
char destination[2048]="";
|
||||||
char token[2000];
|
char token[2000];
|
||||||
|
char tmp[256]="", *l, *n;
|
||||||
OSPTCALLID *callid;
|
OSPTCALLID *callid;
|
||||||
OSPE_DEST_PROT prot;
|
OSPE_DEST_PROT prot;
|
||||||
|
|
||||||
@@ -448,6 +450,16 @@ int ast_osp_lookup(struct ast_channel *chan, char *provider, char *extension, ch
|
|||||||
|
|
||||||
if (!callerid)
|
if (!callerid)
|
||||||
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) {
|
if (chan) {
|
||||||
strncpy(uniqueid, chan->uniqueid, sizeof(uniqueid) - 1);
|
strncpy(uniqueid, chan->uniqueid, sizeof(uniqueid) - 1);
|
||||||
|
Reference in New Issue
Block a user