PDA

View Full Version : How to assign a DID to a GSM Module ?



carlostico
04-03-12, 11:16 PM
I checked the online manual but it doesnt tell how to assing a DID to a GSM module ?

Thanks in advance.

carlostico
04-06-12, 09:03 AM
You will need to make certain edits to match the 'In-bound Routes' DID's you've added the FreePBX GUI. These changes will associate the GSM channel with a specific DID so the call can be routed. Here are the contents of extensions_custom.conf file and you will need to change the numbers in bold to match the DID you wish to route off for the specific channel. If you have 2 GSM modules with 4 ports then you will need to add macros-from-gsm-5 and macros-from-gsm-4.

[macro-from-gsm-1]
exten => s,1,Noop(Setting GSM DID for channel ${CHAN})
exten => s,n,Set(gsm_did_${CHAN}=6135551234)
exten => s,n,Noop(Entering macro-from-gsm-1 with DID = ${DID} and setting to: ${gsm_did_${CHAN}})
exten => s,n,Set(__FROM_DID=${gsm_did_${CHAN}})
exten => s,n,Goto(from-gsm-custom,${gsm_did_${CHAN}},1)
; end of [macro-from-gsm-1]

[macro-from-gsm-2]
exten => s,1,Noop(Setting GSM DID for channel ${CHAN})
exten => s,n,Set(gsm_did_${CHAN}=5551234)
exten => s,n,Noop(Entering macro-from-gsm-2 with DID = ${DID} and setting to: ${gsm_did_${CHAN}})
exten => s,n,Set(__FROM_DID=${gsm_did_${CHAN}})
exten => s,n,Goto(from-gsm-custom,${gsm_did_${CHAN}},1)
; end of [macro-from-gsm-2]

[from-gsm-custom]
include => ext-did
include => ext-did-post-custom
include => from-did-direct
include => ext-did-catchall

[from-pstn-custom]
exten => _X.,1,Set(DID=${EXTEN})
exten => _X.,n,Goto(s,1)
exten => s,1,Noop(Entering from-pstn-custom with DID == ${DID})
exten => s,n,Ringing()
exten => s,n,Set(DID=${IF($["${DID}"= ""]?s:${DID})})
exten => s,n,Noop(DID is now ${DID})
exten => s,n,Set(CHAN=${CHANNEL:4})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})
exten => s,n,Macro(from-gsm-${CHAN},${DID},1)
exten => s,n,Noop(Returned from Macro from-gsm-${CHAN})
exten => s,n,Goto(from-gsm-custom,${DID},1)