1.1 정의CTI (Computer Telephony Integration)란 PBX와 Computer의 연동에 의해 음성 Service와 Data Service를 동시에 제공해 주는 System을 말함.Computer의 Network기술의 발전과 통신의 Digital 기술의 발전이 서로 결합되어, 다양한 Service를 제공할 수 있도록 체계화 한것.CTI는 기업 내 외부로 들어오고 나가는 전화를 관리하는 콜센터, 빠른시간에 대고객 서비스 업무를 취급해야 하는 고객지원센터, 주로 전화를 이용해 영업하는 텔레 마케팅 업무 등에서 급속히 이용이 확산되며 향후 ITI (Internet Telephony Integration)로 발전 중이다.
/**********************************************Programmed by accto.2001. 04. 25***********************************************/#include #include #include #include #include #define MAX_LIST 20#define MAX_LEN 10typedef struct ch_node *ch_ptr;typedef struct ch_node{ch_ptr llink;char data;ch_ptr rlink;}ch_node;typedef struct hd_node *hd_ptr;typedef struct hd_node{char NAME[MAX_LEN];ch_ptr s_link;hd_ptr h_link;}hd_node;hd_ptr H=NULL;/***************************************Function Prototype Section****************************************/hd_ptr CREATE(void);int LEN(ch_ptr);ch_ptr COPY(ch_ptr);void PRINTS(hd_ptr);ch_ptr FIRST(ch_ptr, int);ch_ptr LAST(ch_ptr, int);int INDEX(ch_ptr, ch_ptr);ch_ptr CONCAT(ch_ptr, ch_ptr);ch_ptr SUBSTR(ch_ptr, int, int);char GetChoice(void);int ExecuteChoice(char);hd_ptr ADD_H(char *);/************************************PROGRAM SECTION*************************************/void main(void){int quit;char choice;clrscr();do{choice=GetChoice();quit=ExecuteChoice(cho), CONCAT(), SUBSTR(), FIRST(), LAST() 이 다섯개의 함수들은 호출하기 전에 일단 HeadPointer 구조체를 만들어야 한다. 앞으로 5개의 함수를 호출할 때 항상 ADD_H()함수가 실행될 것이다.**************************************************************/case 'C':tmp1=H;if(tmp1){printf("Input StrName what you want to COPY :");scanf("%s",input_name);while((tmp1)&&(strcmp(tmp1->NAME,input_name)))tmp1=tmp1->h_link;if(tmp1){H=ADD_H("Copy");H->s_link=COPY(tmp1->s_link);}else{printf("No such StringName exist! COPY aborted. Choose menu.nn");break;}}else {printf("No string is stored in Memory! First, Create new String!nn");break;}break;/******************CASE "FIRST", "LAST" xx STRING*******************기본적인 모양은 위의 COPY와 같다. 먼저, COPY처럼 소스의 이름을 불러들인 뒤에 Verification을 마친다. 그 다음에 새로운 Head_Node를 만들고거기에 FIRST에 맞게 string을 저장한다. LAST역시 마찬가지이다.*******************************************************************/case 'F':tmp1=H;J=1;if(tmp1){printf("Input StrName what you want to FIRST characters :");scanf("%s",input_name);while((tmp1)&&(strcmp(tmp1->NAME,input_namwhile(!tmp1);temp=tmp1->s_link;while(temp->rlink!=NULL){J++; temp=temp->rlink;}temp=tmp1->s_link;do{tmp1=H;printf("Input the StrName 2 to concatenate :");scanf("%s",input_name);while(tmp1&&strcmp(tmp1->NAME,input_name))tmp1=tmp1->h_link;if(!tmp1)printf("Wrong Input StrName2! Input again!n");}while(!tmp1);temp2=tmp1->s_link;while(temp2->rlink!=NULL){I++; temp2=temp2->rlink;}temp2=tmp1->s_link;if(I+J>20){printf("The sum length of S1 and S2 must less than(or equal to)20! Aborted.nn");break;}H=ADD_H("CONCATENATION");H->s_link=CONCAT(temp,temp2);break;/*************************CASE "SUBSTRING"*************************이 함수는 LAST와 FIRST의 확장된 함수라고 볼 수 있다. 저장된 스트링의 이름과 그 스트링의 I번째부터 J개의 스트링을 다른 스트링 네임에저장하게 할 것이다. I와J가 그 문자열의 길이보다 커서는 안되고 또그밖의 여러 경우가 있는데 이를 ||연산자를 이용해서 고려하였다.*******************************************************************/case 'S':tmp1=H;veri=1;if(tmp1){printf("Input StrName what you want to SUBSTR :");scanf("%s",input_name);while((tmp1)&&(strcmp(tmp1->NAME,input_name)))tmp면에 이제껏 저장된 스트링 이름과 스트링을 모두 출력하는방법을 취했다. 파라미터는 ch_ptr이 아니라 hd_ptr을 이용하여 모든스트링과 스트링 이름을 인자로 넘겨주는 방법을 취했다.******************************************************************/case 'P':tmp1=H;PRINTS(tmp1);break;case 'X':quit=1;break;default:printf("Illegal choice! choose again!nn");break;}return (quit);}/**************************************FUNCTION "CREATE()" SECTION***************************************/hd_ptr CREATE(void){int c;hd_ptr head;ch_ptr s, temp;char data[MAX_LIST], sname[MAX_LEN];head=(hd_ptr)malloc(sizeof(hd_node));s=(ch_ptr)malloc(sizeof(ch_node));printf("Input the name of string :");scanf("%s",sname);strcpy(head->NAME,sname);printf("Input the string :");scanf("%s",data);head->s_link=NULL;s->llink=NULL;temp->llink=NULL;temp->rlink=s;for(c=0;data[c]!='