Koozali.org: home of the SME Server

Modifying Callers dialled extension

Offline compsos

  • *
  • 472
  • +0/-0
Modifying Callers dialled extension
« on: October 23, 2011, 09:48:42 AM »
Hi
Looking for a solution to allow a external call to dial an internal extension. Example from Sonoracomm enter-extension works but we would like to allow the caller to just enter a room number and get the extension.
Sonoracomm Code
Code: [Select]
include => internal-presets
include => extensions

exten => s,1,Set(TIMEOUT(digit)=5)     ;Digit Timeout 5 secs
exten => s,n,Set(TIMEOUT(response)=10) ;Response Timeout 10
exten => s,n,Background(usergreeting0002)
exten => s,n,WaitExten ;Wait for an extension to be dialled
exten => s,n,Goto(enter-extension,t,1)

exten => i,1,Playback(pbx-invalid)
exten => i,2,Goto(enter-extension,s,1)

exten => t,1,Goto(extensions,${SYSOP},1)
exten => t,2,Hangup

(ie) Rooms are from 1 to 39
Extension Numbers are 4001 to 4039 (analogue phones on TDM2400 cards)

If the caller presses 23, ext 4023 gets called. Have been trying a Custom App with the LEN function to test for dialled numbers If(${EXTEN}) =1 then add 400 else add 40 to the dialled number. So far the system seems to ignore all the lines we enter. Is ${EXTEN} the right variable to be looking at?
« Last Edit: October 23, 2011, 10:13:15 AM by compsos »
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Modifying Callers dialled extension
« Reply #1 on: October 23, 2011, 07:45:34 PM »
Wouldn't it be easier to just set up an alias (callgroup) for each room (e.g. 23  dials 4023)?

S

Offline compsos

  • *
  • 472
  • +0/-0
Re: Modifying Callers dialled extension
« Reply #2 on: October 23, 2011, 11:44:57 PM »
We need to pass them through an IVR like "To dial the room please press the room number now". This would be a 2nd level IVR. Would Sonoracomm's code dial the "Alias"?
« Last Edit: October 24, 2011, 12:14:06 AM by compsos »
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Modifying Callers dialled extension
« Reply #3 on: October 28, 2011, 10:39:28 PM »
yes it would because it includes internal-presets, which is where the aliases are generated.

Best

S