Koozali.org: home of the SME Server

CFWIM a trunk instead of an ext

Offline ldkeen

  • *
  • 405
  • +0/-0
CFWIM a trunk instead of an ext
« on: June 17, 2010, 12:13:03 AM »
Sorry if this has been asked before, but I've searched everywhere and can't find what I'm looking for. I have a Call Group for my mobile and currently I just log into the server manager and change the inbound route for the trunk to the Call Group number. I need to allow the kids to do this also but I don't want them logging into the server manager. Is there a way to program an extension so I can dial a number and have the system effectively route the inbound pstn calls to the call group (my mobile).
Lloyd

Offline gippsweb

  • *****
  • 232
  • +0/-0
    • Wots I.T.?
Re: CFWIM a trunk instead of an ext
« Reply #1 on: June 18, 2010, 04:52:49 AM »
Can't they just *21*xxxx to the group Lloyd?

Offline ldkeen

  • *
  • 405
  • +0/-0
Re: CFWIM a trunk instead of an ext
« Reply #2 on: June 18, 2010, 04:56:31 AM »
Sorry, I forgot to mention the inbound route is going to a Call Group (3 extensions), so *21 wont work. Thanks anyway.

Offline gippsweb

  • *****
  • 232
  • +0/-0
    • Wots I.T.?
Re: CFWIM a trunk instead of an ext
« Reply #3 on: June 18, 2010, 05:14:00 AM »
Doh! didn't think of that.
My call groups are all automated.

I've had no need to do that here........

I can't think of any way to do that other than the way you already do..

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: CFWIM a trunk instead of an ext
« Reply #4 on: June 18, 2010, 11:42:02 AM »
Quote
Is there a way to program an extension so I can dial a number and have the system effectively route the inbound pstn calls to the call group (my mobile).

Here's a way...

Send your trunk call to a custom app.  All you need is a state indicator (i.e. where should I send this call?),  a state changer. and a state switcher..

1.  Add a global variable  (in headers->extensions.conf; let's call it MYGLOBAL
2.  write a custom app to add a couple of custom feature keys, to set MYGLOBAL, and a switcher to flip the calls...


Code: [Select]
exten=>*1000,1,SET(GLOBAL(MYGLOBAL)=4000)
exten=>*1001,1,SET(GLOBAL(MYGLOBAL)=4001)

exten=>s,1,GoTo(extensions,${MYGLOBAL})
exten=>s,2,Hangup
 

I'm sure this isn't syntactically correct but you get the idea, and it sorts your problem in 4 lines of code.  Now, you can dial *1000 to set destination 4000 (which could be an extension or a call group, doesn't matter) and *1001 to set destination *1001.  You can set as many as yoiu like.

The s extension does the switching.

Kind Regards

S
 





Offline Teviot

  • *
  • 610
  • +0/-0
Re: CFWIM a trunk instead of an ext
« Reply #5 on: June 19, 2010, 06:43:59 AM »
Another way would be to do what I have done if the callers number is displayed

Set up a "PTT_CLID" trunk with the Callers number
Regards
M0GLJ
......................................................
I am new to SAIL SME Server v8b6 and have been using SME for many years.
I have already done some research and only ask questions if I still can't work it out.

Offline ldkeen

  • *
  • 405
  • +0/-0
Re: CFWIM a trunk instead of an ext
« Reply #6 on: June 20, 2010, 08:42:30 AM »
Thanks for that Jeff, I'll check it out, but gippsweb reply got me thinking.. The trunk is a Telstra PSTN so if I dial the trunk preselect (67) followed by *21xxxxxxxxxx# this should activate the Telstra Call Forward facility, but it seems I have some sort of problem with Dahdi. I can receive incoming calls but can't make outgoing. I get the following:
Code: [Select]
Unable to create channel of type 'DAHDI' (cause 0 - Unknown)Anyway, I think I'm on the right track. Thanks heaps guys.
Lloyd

Offline gippsweb

  • *****
  • 232
  • +0/-0
    • Wots I.T.?
Re: CFWIM a trunk instead of an ext
« Reply #7 on: June 21, 2010, 12:25:05 AM »
The one downside to that Lloyd, is that you'd be paying Telstras rates for the diversion instead of the VoIP providers..

I quite like Jeff's idea with the custom app....

Offline ldkeen

  • *
  • 405
  • +0/-0
Re: CFWIM a trunk instead of an ext
« Reply #8 on: June 22, 2010, 07:17:27 AM »
Hey Jeff,
Thanks heaps for that, worked like a dream. Here's what we have done:
Create a custom app called "divert" with the following (where 5300 and 5301 are call groups aliases):
Code: [Select]
exten=>*1000,1,SET(GLOBAL(REDIRECT)=5300)
exten=>*1000,2,Playback(call-forwarding)
exten=>*1000,3,Playback(cancelled)
exten=>*1001,1,SET(GLOBAL(REDIRECT)=5301)
exten=>*1001,2,Playback(call-forwarding)
exten=>*1001,3,Playback(activated)

exten=>s,1,agi(selintra,OutCluster,${REDIRECT})
exten=>s,2,Hangup

Point both open and closed trunk settings to this custom app.

Add the following to extensions.conf header
Code: [Select]
REDIRECT=5300
Note: The setting does not survive a commit or restart.
Rgds, Lloyd



Offline ldkeen

  • *
  • 405
  • +0/-0
Re: CFWIM a trunk instead of an ext
« Reply #9 on: June 22, 2010, 07:27:04 AM »
Code: [Select]
Unable to create channel of type 'DAHDI' (cause 0 - Unknown)In /etc/asterisk/dahdi-channels.conf had to change:
context=from-pstn
to
context=mainmenu
Lloyd

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: CFWIM a trunk instead of an ext
« Reply #10 on: June 22, 2010, 10:48:44 AM »
I'd need to see more of the console log. - the dial really


Also - what do you get when you do dahdi show status


Best

S

Offline ldkeen

  • *
  • 405
  • +0/-0
Re: CFWIM a trunk instead of an ext
« Reply #11 on: June 22, 2010, 11:09:46 AM »
Sorry, I was a bit vague, changing the context fixed the problem. Outgoing calls are now working.
Thanks anyway, Lloyd

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: CFWIM a trunk instead of an ext
« Reply #12 on: June 22, 2010, 11:37:59 AM »
from-pstn should work

there is an alias context in extensions for from-pstn and it just includes mainmenu (or should).

Kind Regards

S