| 699 | | ; If this came through a ringgroup or CF, then we want to retain original CID |
|---|
| 700 | | ; unless KEEPCID is set and there's a TRUNK OVERRIDE. This is usually set because |
|---|
| 701 | | ; the users VSP or PSTN provider can only accept a limited range of CID's on |
|---|
| 702 | | ; outbound calls. |
|---|
| 703 | | |
|---|
| 704 | | ; Check to see if there's a TRUNK CID |
|---|
| 705 | | exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}}) |
|---|
| 706 | | ; If there is _and_ if OUTKEEPCID is set to 'On', go to trunkcid, which uses that. |
|---|
| 707 | | exten => s,n,GotoIf($[$["x${OUTKEEPCID_${ARG1}}"!="xon"]&$["x${TRUNKOUTCID:1:2}"!="x"]]?trunkcid) |
|---|
| 708 | | ; If there's not, does KEEPCID exist? If it's not TRUE, then try to load the AMPUSER/xtn/outboundcid key |
|---|
| 709 | | exten => s,n,GotoIf($["${KEEPCID}" != "TRUE"]?normcid) ;Dialparties sets this to TRUE if coming from ringgroups, CF, etc. |
|---|
| 710 | | ; REALCALLERID number was set above, to the caller ID. If there's no CID, go through normal processing. |
|---|
| | 700 | ; If this came through a ringgroup or CF, then we want to retain original CID unless |
|---|
| | 701 | ; OUTKEEPCID_${trunknum} is set. |
|---|
| | 702 | ; |
|---|
| | 703 | exten => s,n,GotoIf($["${KEEPCID}" != "TRUE"]?normcid) ;Set to TRUE if coming from ringgroups, CF, etc. |
|---|
| | 704 | exten => s,n,GotoIf($["x${OUTKEEPCID_${ARG1}}"!="xon"]?normcid) |
|---|
| 714 | | ; We now have to make sure the CID is valid. If we find an AMPUSER with the same CID, we assume it is an internal |
|---|
| 715 | | ; call (would be quite a conincidence if not) and go through the normal processing to get that CID. If a device |
|---|
| 716 | | ; is set for this CID, then it must be internal |
|---|
| 717 | | ; |
|---|
| 718 | | exten => s,n,GotoIf($["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "foo"]?bypass:normcid) |
|---|
| | 708 | ; We now have to make sure the CID is valid. If we find an AMPUSER with the same CID, we assume it is an internal |
|---|
| | 709 | ; call (would be quite a conincidence if not) and go through the normal processing to get that CID. If a device |
|---|
| | 710 | ; is set for this CID, then it must be internal |
|---|
| | 711 | ; |
|---|
| | 712 | exten => s,n,GotoIf($["foo${DB(AMPUSER/${REALCALLERIDNUM}/device}" = "foo"]?bypass:normcid) |
|---|