viernes, 17 de julio de 2009

Overlap dial and chan_ss7

I've installing Asterisk PBX with SS7 links. I got a case where the number dialed comes in more than one message, so first a got most of the digits and then the rest. This is OK, but chan_ss7 v1.1 doesn't support it if Asterisk dialplan can handle the "first" number dialed.

I've tried with a patch from Asterisk-SS7 mai list - the one from hngovi -, but didn't solve the issue. The short story, I wrote a patch and tested a bit, seems to work well in my scenario. Here you have a shot explanation about it:

To consider that DNI is complete, it takes into account 3 things: complete parameter in pvt, en of dial message, and if Asterisk has the extension in its dialplan. The first one is a must, the DNI MUST be complete to start dialing (t35 timeout is also considered). Then, one of two things can happen, end of dialing message or Asterisk can handle the extension. It would be great if you can grab the patch and give some feedback, I've not been able to detect any issue so far.

Here is the patch:

--- chan_ss7-1.1/l4isup.c 2009-07-17 14:58:12.000000000 -0300
+++ chan_ss7-1.1.fameal/l4isup.c 2009-07-17 15:04:22.000000000 -0300
@@ -1618,8 +1618,9 @@ static void handle_complete_address(stru

static void check_iam_sam(struct ss7_chan* pvt)
- int complete = (pvt->link->linkset->enable_st && pvt->iam.dni.complete) ||
- ast_exists_extension(pvt->owner, pvt->context, pvt->iam.dni.num, 1, pvt->iam.rni.num);
+ /* fameal: in all cases check if DNI is complete */
+ int complete = pvt->iam.dni.complete &&
+ (pvt->link->linkset->enable_st || ast_exists_extension(pvt->owner, pvt->context, pvt->iam.dni.num, 1, pvt->iam.rni.num));
if (complete) {
pvt->iam.dni.complete = 1;
ast_log(LOG_DEBUG, "Setting iam.dni.complete\n");

PS: This article is written in english to make it useful for everybody.