summaryrefslogtreecommitdiffstats
path: root/callerid.c
diff options
context:
space:
mode:
authorSuper User2008-06-01 18:52:10 +0200
committerSuper User2008-06-01 18:52:10 +0200
commit026b04fc75011a144285f399b82890803b4315bd (patch)
treefc208d625cc72cfaa317c160d42fc2cdcf7256a4 /callerid.c
parentwork (diff)
downloadlcr-026b04fc75011a144285f399b82890803b4315bd.tar.gz
lcr-026b04fc75011a144285f399b82890803b4315bd.tar.xz
lcr-026b04fc75011a144285f399b82890803b4315bd.zip
LCR is now uses socket based mISDN V2 API
*** chan_lcr, the Asterisk interface works (not complete yet). -> LCR can be used as Asterisk channel driver. modified: Makefile modified: Makefile.am modified: README modified: action.cpp modified: apppbx.cpp modified: bchannel.c modified: bchannel.h modified: callerid.c modified: cause.c modified: chan_lcr.c modified: chan_lcr.h modified: configure.ac modified: default/routing.conf modified: dss1.cpp modified: dss1.h modified: genrc.c modified: ie.cpp modified: interface.c modified: lcradmin.c modified: mISDN.cpp modified: mISDN.h modified: main.c modified: main.h modified: message.h modified: myisdn.h modified: route.c modified: socket_server.c modified: trace.h
Diffstat (limited to 'callerid.c')
-rw-r--r--callerid.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/callerid.c b/callerid.c
index 47b51da..7d13f16 100644
--- a/callerid.c
+++ b/callerid.c
@@ -9,19 +9,23 @@
** **
\*****************************************************************************/
-#include "main.h"
+#include <string.h>
+#include <time.h>
+#include "extension.h"
+#include "message.h"
+#include "callerid.h"
/* create caller id from digits by comparing with national and international
* prefixes.
*/
char *nationalize_callerinfo(char *string, int *ntype, char *national, char *international)
{
- if (!strncmp(options.international, string, strlen(options.international)))
+ if (!strncmp(international, string, strlen(international)))
{
*ntype = INFO_NTYPE_INTERNATIONAL;
return(string+strlen(international));
}
- if (!strncmp(options.national, string, strlen(options.national)))
+ if (!strncmp(national, string, strlen(national)))
{
*ntype = INFO_NTYPE_NATIONAL;
return(string+strlen(national));
@@ -40,14 +44,16 @@ char *numberrize_callerinfo(char *string, int ntype, char *national, char *inter
switch(ntype)
{
case INFO_NTYPE_INTERNATIONAL:
- UCPY(result, international);
- SCAT(result, string);
+ strcpy(result, international);
+ strncat(result, string, sizeof(result));
+ result[sizeof(result)-1] = '\0';
return(result);
break;
case INFO_NTYPE_NATIONAL:
- UCPY(result, national);
- SCAT(result, string);
+ strcpy(result, national);
+ strncat(result, string, sizeof(result));
+ result[sizeof(result)-1] = '\0';
return(result);
break;