From de60f52c5936a29e800329f07dd996e13a5c79c7 Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Mon, 28 May 2007 19:30:20 +0000 Subject: [PATCH] QSIG: - moved QSIG initialation out of chan_capi.c --- chan_capi.c | 15 +-------------- chan_capi_qsig.h | 1 + chan_capi_qsig_core.c | 21 +++++++++++++++++++++ chan_capi_qsig_ecma.c | 14 +++++++------- 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/chan_capi.c b/chan_capi.c index d3af7af..3e0a6b9 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -4837,20 +4837,7 @@ int mkif(struct cc_capi_conf *conf) tmp->qsigfeat = conf->qsigfeat; if (conf->qsigfeat) { - tmp->qsig_data.calltransfer_active = 0; - tmp->qsig_data.calltransfer = 0; - tmp->qsig_data.calltransfer_onring = 0; - tmp->qsig_data.callmark = 0; - tmp->qsig_data.dnameid = NULL; - - /* Path Replacement */ - tmp->qsig_data.pr_propose_sendback = 0; /* send back an prior received PR PROPOSE on Connect */ - tmp->qsig_data.pr_propose_cid = NULL; /* Call identity */ - tmp->qsig_data.pr_propose_pn = NULL; /* Party Number */ - - /* Partner Channel - needed for many features */ - tmp->qsig_data.partner_ch = NULL; - tmp->qsig_data.partner_plci = 0; + cc_qsig_interface_init(conf, tmp); } tmp->next = capi_iflist; /* prepend */ diff --git a/chan_capi_qsig.h b/chan_capi_qsig.h index b696630..5626514 100644 --- a/chan_capi_qsig.h +++ b/chan_capi_qsig.h @@ -168,6 +168,7 @@ extern int pbx_capi_qsig_ssct(struct ast_channel *c, char *param); extern int pbx_capi_qsig_ct(struct ast_channel *c, char *param); extern int pbx_capi_qsig_callmark(struct ast_channel *c, char *param); +extern void cc_qsig_interface_init(struct cc_capi_conf *conf, struct capi_pvt *tmp); extern void interface_cleanup_qsig(struct capi_pvt *i); extern void pbx_capi_qsig_handle_info_indication(_cmsg *CMSG, unsigned int PLCI, unsigned int NCCI, struct capi_pvt *i); diff --git a/chan_capi_qsig_core.c b/chan_capi_qsig_core.c index 235c96c..242b5a7 100644 --- a/chan_capi_qsig_core.c +++ b/chan_capi_qsig_core.c @@ -984,6 +984,27 @@ int pbx_capi_qsig_callmark(struct ast_channel *c, char *param) return 0; } +/* + * init QSIG data on new channel - will be called by mkif + */ +void cc_qsig_interface_init(struct cc_capi_conf *conf, struct capi_pvt *tmp) +{ + tmp->qsig_data.calltransfer_active = 0; + tmp->qsig_data.calltransfer = 0; + tmp->qsig_data.calltransfer_onring = 0; + tmp->qsig_data.callmark = 0; + tmp->qsig_data.dnameid = NULL; + + /* Path Replacement */ + tmp->qsig_data.pr_propose_sendback = 0; /* send back an prior received PR PROPOSE on Connect */ + tmp->qsig_data.pr_propose_cid = NULL; /* Call identity */ + tmp->qsig_data.pr_propose_pn = NULL; /* Party Number */ + + /* Partner Channel - needed for many features */ + tmp->qsig_data.partner_ch = NULL; + tmp->qsig_data.partner_plci = 0; +} + /* * cleanup QSIG stuff on interface */ diff --git a/chan_capi_qsig_ecma.c b/chan_capi_qsig_ecma.c index e77347f..20efa85 100644 --- a/chan_capi_qsig_ecma.c +++ b/chan_capi_qsig_ecma.c @@ -352,13 +352,13 @@ void cc_qsig_encode_ecma_calltransfer(unsigned char * buf, unsigned int *idx, st c[ix++] = ASN1_TC_CONTEXTSPEC | ASN1_TF_CONSTRUCTED; /* val 2 - Source Caller ID struct */ c[ix++] = 5 + cidlen; - c[ix++] = ASN1_TC_CONTEXTSPEC; /* CallerID */ - c[ix++] = cidlen; - memcpy(&c[ix], cid, cidlen); - ix += cidlen; - c[ix++] = ASN1_ENUMERATED; /* Screening Indicator */ - c[ix++] = 1; /* length */ - c[ix++] = 1; /* 01 = userProvidedVerifiedAndPassed ...we hope so */ + c[ix++] = ASN1_TC_CONTEXTSPEC; /* CallerID */ + c[ix++] = cidlen; + memcpy(&c[ix], cid, cidlen); + ix += cidlen; + c[ix++] = ASN1_ENUMERATED; /* Screening Indicator */ + c[ix++] = 1; /* length */ + c[ix++] = 1; /* 01 = userProvidedVerifiedAndPassed ...we hope so */ c[ix++] = ASN1_ENUMERATED; /* val 3 - wait for connect ? */ c[ix++] = 1;