PDA

View Full Version : CLIR support with Pika Digital (BRI line)



mck
04-21-11, 02:28 AM
Hi Mark,
I have a question about CLIR (Caller Line ID Restriction) support in chan_pika: this feature is supported?
In the documentation I have no reference to calling presentation configuration, and I'm trying to configure a CLIR on an ISDN BRI for outbound calls but without success.


Best regards,
Matteo

mrecoskie
04-21-11, 02:43 PM
Unfortunately this functionality is not available through configuration in chan_pika but I believe it could be added with one simple addition to the code (highlighted with '// CLIR ADDITION' below). In the pika_call function in the file chan_pika.c:



...
default:
//for CAS, ISDN types
ast_copy_string(info.to, destp, sizeof(info.to));
ast_copy_string(info.from, chan->cid.cid_num ? chan->cid.cid_num : "", sizeof(info.from));
ast_copy_string(info.display, chan->cid.cid_name ? chan->cid.cid_name : "unknown", sizeof(info.display));
info.callingNumberRestricted = PK_FALSE;

info.protocol.BRI.callingNumber.presentationInd = PKX_ISDN_PRESENTATION_IND_RESTRICT; // CLIR ADDITION

//test if the from number is valid for CAS - only numbers are allowed
if (groupType == PKX_GROUP_TYPE_CAS) {
if (!pika_check_from_number(info.from))
ast_copy_string(info.from, "", sizeof(info.from));
}
settings.callAnalysis.enable = PK_FALSE;
}

if (groupType == PKX_GROUP_TYPE_PHONE) {
...


Note: You will also notice the 'callingNumberRestricted' field just above the line addition which might seem useful for blocking the caller id. This field does not work for BRI so please avoid it.

mck
04-26-11, 04:44 PM
Thank you Mark.
So with this change I have the CLIR setted for all the outbound call?
Can I use the SetCallerPres(...) function in Asterisk dialplan to dynamically change this setting?
I'll try this addition to the code soon.

Regars,
Matteo


Unfortunately this functionality is not available through configuration in chan_pika but I believe it could be added with one simple addition to the code (highlighted with '// CLIR ADDITION' below). In the pika_call function in the file chan_pika.c:



...
default:
//for CAS, ISDN types
ast_copy_string(info.to, destp, sizeof(info.to));
ast_copy_string(info.from, chan->cid.cid_num ? chan->cid.cid_num : "", sizeof(info.from));
ast_copy_string(info.display, chan->cid.cid_name ? chan->cid.cid_name : "unknown", sizeof(info.display));
info.callingNumberRestricted = PK_FALSE;

info.protocol.BRI.callingNumber.presentationInd = PKX_ISDN_PRESENTATION_IND_RESTRICT; // CLIR ADDITION

//test if the from number is valid for CAS - only numbers are allowed
if (groupType == PKX_GROUP_TYPE_CAS) {
if (!pika_check_from_number(info.from))
ast_copy_string(info.from, "", sizeof(info.from));
}
settings.callAnalysis.enable = PK_FALSE;
}

if (groupType == PKX_GROUP_TYPE_PHONE) {
...


Note: You will also notice the 'callingNumberRestricted' field just above the line addition which might seem useful for blocking the caller id. This field does not work for BRI so please avoid it.

mrecoskie
04-27-11, 08:01 AM
Yes - with this change CLIR should be set for all outbound calls. No, SetCallerPres () in the dialplan will not work.

If you wanted an equivalent type of functionality one way would be to create your own Asterisk application - like PIKASetcallerPres - in chan_pika. An example of an application like this is PIKAFlash in chan_pika. This new application could then set this 'presentationInd' field dynamically.

The only other alternative I can see is passing in a custom Dial string and then creating code in chan_pika to interpret this and set the presentation field accordingly for the call. Hopefully this all makes sense.