From f0c37c2067fcba29a2a30361091172b80d4d54f8 Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Thu, 21 Apr 2011 20:44:45 +0000 Subject: [PATCH] Allow to Dial without sending complete i.e. This is necessary if dialing is done in overlapped mode but signeling network does not supports sending of initla message witout CPN: SS7 IAM without CPN results in protocol error if send to switch (vendor?) but works B2B with Diva. --- README | 1 + chan_capi.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README b/README index e57b11b..b7b11b9 100644 --- a/README +++ b/README @@ -98,6 +98,7 @@ The Dial string (Useful if additional digits should be send afterwards or together with 'b' to get the dialtone and then send the number, e.g., if no progress tones are available) + 'c' : do not send sending complete 's' : activate 'stay-online': do not disconnect CAPI connection on hangup. This is needed to give additional commands like CCBS after hangup. To really hang up the CAPI connection, use either capicommand(hangup) diff --git a/chan_capi.c b/chan_capi.c index d30b539..b502582 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -1525,6 +1525,7 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout) int doqsig; char *sending_complete; unsigned char *facilityarray = NULL, *bc_s = NULL, *llc_s = 0, *hlc_s = 0; + int no_sending_complete = 0; MESSAGE_EXCHANGE_ERROR error; @@ -1555,6 +1556,11 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout) cc_log(LOG_WARNING, "Overlap already set in '%s'\n", idest); i->doOverlap = 1; break; + case 'c': /* Do not send sending complete */ + if (no_sending_complete != 0) + cc_log(LOG_WARNING, "No sending complete already set in '%s'\n", idest); + no_sending_complete = 1; + break; case 'd': /* use default cid */ if (use_defaultcid) cc_log(LOG_WARNING, "Default CID already set in '%s'\n", idest); @@ -1697,7 +1703,7 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout) } } else { called[0] = strlen(dest) + 1; - sending_complete = "\x02\x01\x00"; + sending_complete = (no_sending_complete == 0) ? "\x02\x01\x00" : "\x00"; } if ((p = pbx_builtin_getvar_helper(c, "CALLEDTON"))) {