Use CALLEDTON variable to specity the 'ETS 300 102-1' called party number octet 3 for outgoing calls

This commit is contained in:
MelwareDE 2009-07-22 08:18:46 +00:00
parent ee3422402f
commit cf77a3577a
3 changed files with 20 additions and 2 deletions

View File

@ -23,6 +23,7 @@ HEAD
- use direct access to vocoders without RTP framing - use direct access to vocoders without RTP framing
- play message to conference and music on hold to caller - play message to conference and music on hold to caller
- add commands to remove users from chat - add commands to remove users from chat
- allow to specity the 'ETS 300 102-1' called party number octet 3
chan_capi-1.1.2 chan_capi-1.1.2

13
README
View File

@ -466,8 +466,19 @@ BCHANNELINFO
capicommand(deflect|<number>) to initiate call deflection to another destination. capicommand(deflect|<number>) to initiate call deflection to another destination.
CALLEDTON CALLEDTON
The 'type of number' value of the called number is saved in this variable on Incoming calls: 'type of number' value of the called number is saved in this variable on
incomming call. incomming call.
Outgoing calls: Allows to specity the 'ETS 300 102-1' called party number octet 3
(0x80 is used by default)
exten => _X.,1,Answer
exten => _X.,n,Set(_CALLEDTON=${CALLEDTON}) ; Use value of incoming call for outgoing call
exten => _X.,n,Dial(CAPI/ISDN3/100,10)
exten => _X.,1,Answer
exten => _X.,n,Set(_CALLEDTON=1) ; Use new value
exten => _X.,n,Dial(CAPI/ISDN3/100,10)
CALLERTON CALLERTON
The 'type of number' value to overwrite for the caller number on outgoing call. The 'type of number' value to overwrite for the caller number on outgoing call.

View File

@ -1481,7 +1481,13 @@ static int pbx_capi_call(struct ast_channel *c, char *idest, int timeout)
called[0] = strlen(dest) + 1; called[0] = strlen(dest) + 1;
sending_complete = "\x02\x01\x00"; sending_complete = "\x02\x01\x00";
} }
called[1] = 0x80;
if ((p = pbx_builtin_getvar_helper(c, "CALLEDTON"))) {
unsigned char ton = (unsigned char)atoi(p);
called[1] = ton | 0x80;
} else {
called[1] = 0x80;
}
strncpy(&called[2], dest, sizeof(called) - 3); strncpy(&called[2], dest, sizeof(called) - 3);
if (c->cid.cid_num) { if (c->cid.cid_num) {