Esempio n. 1
0
void cb_in_1(struct pcbit_dev * dev, struct pcbit_chan* chan,
	     struct callb_data *cbdata) 
{
        isdn_ctrl ictl;
        unsigned short refnum;
 	struct sk_buff *skb;
	int len;


        ictl.command = ISDN_STAT_ICALL;
        ictl.driver=dev->id;
        ictl.arg=chan->id;
        
        /*
         *  ictl.num >= strlen() + strlen() + 5
         */

	if (cbdata->data.setup.CallingPN == NULL) {
		printk(KERN_DEBUG "NULL CallingPN to phone; using 0\n");
		strcpy(ictl.parm.setup.phone, "0");
	}
	else {
		strcpy(ictl.parm.setup.phone, cbdata->data.setup.CallingPN);
	}
	if (cbdata->data.setup.CalledPN == NULL) {
		printk(KERN_DEBUG "NULL CalledPN to eazmsn; using 0\n");
		strcpy(ictl.parm.setup.eazmsn, "0");
	}
	else {
		strcpy(ictl.parm.setup.eazmsn, cbdata->data.setup.CalledPN);
	}
	ictl.parm.setup.si1 = 7;
	ictl.parm.setup.si2 = 0;
	ictl.parm.setup.plan = 0;
	ictl.parm.setup.screen = 0;

#ifdef DEBUG
	printk(KERN_DEBUG "statstr: %s\n", ictl.num);
#endif

        dev->dev_if->statcallb(&ictl);

        
        if ((len=capi_conn_resp(chan, &skb)) < 0) {
                printk(KERN_DEBUG "capi_conn_resp failed\n");
                return;
	}

        refnum = last_ref_num++ & 0x7fffU;
        chan->s_refnum = refnum;

        pcbit_l2_write(dev, MSG_CONN_RESP, refnum, skb, len);
}
Esempio n. 2
0
void cb_in_1(struct pcbit_dev * dev, struct pcbit_chan* chan,
	     struct callb_data *cbdata) 
{
        isdn_ctrl ictl;
        unsigned short refnum;
 	struct sk_buff *skb;
	int len;


        ictl.command = ISDN_STAT_ICALL;
        ictl.driver=dev->id;
        ictl.arg=chan->id;
        
        /*
         *  ictl.num >= strlen() + strlen() + 5
         */

        if (cbdata->data.setup.CalledPN) 
		sprintf(ictl.num, "%s,%d,%d,%s", 
			cbdata->data.setup.CallingPN, 
			7, 0, 
			cbdata->data.setup.CalledPN);
	
	else
		sprintf(ictl.num, "%s,%d,%d,%s", 
			cbdata->data.setup.CallingPN,
			7, 0, 
			"0");


#ifdef DEBUG
	printk(KERN_DEBUG "statstr: %s\n", ictl.num);
#endif

        dev->dev_if->statcallb(&ictl);

        
        if ((len=capi_conn_resp(chan, &skb)) < 0) {
                printk(KERN_DEBUG "capi_conn_resp failed\n");
                return;
	}

        refnum = last_ref_num++ & 0x7fffU;
        chan->s_refnum = refnum;

        pcbit_l2_write(dev, MSG_CONN_RESP, refnum, skb, len);
}