Softygen

Login Form






Lost Password?
No account yet? Register

Statistics

Visitors: 70241

Syndicate

OpenJobs
User Rating: / 0
Written by Gurito   

So yeah, the guys at opendesktop.org have just created a free service where people can go and post job offerings, resumes, etc... They claim the service is fairly simple and easy to use. Sounds interesting, may be worth looking at.

http://www.opendesktop.org/jobs

 

 

No comments for this item
 
Asterisk Ring Groups
User Rating: / 0
Written by Gurito   

A few days ago I was asked to implement a ring group in Asterisk. I thought okay, it's pretty straight forward, I just put all the devices I want to ring in a Dial command and that's it. So I did, but then I was told that that was not entirely ok. They wanted a delay between devices, such that at first only one phone would ring, X seconds later a second device (without the first one stopping) and so on. I thought I could put more Dial commands in a specific order, but then I had the problem that if the first one didn't answer, it would indicate a missed call.

So here is how I finally solved it with help of my colegue Bleek.

Asterisk basics -> Delayed Ring Group
  1. ;
  2. [wait-op]
  3. ; Ask if the channel is available, if it is
  4. ; go to the next step. If it isn't go to no-op
  5. ; and skip the delay.
  6. exten = _XX,1,ChanIsAvail(SIP/${EXTEN})
  7. exten = _XX,n,GotoIf($[ "${AVAILCHAN}"="" ]?no-op|s-na|1:3)
  8. ; Increment the delay by a value of five.
  9. exten = _XX,n,Set(DB(cross/delay-${key})=$[${DB(cross/delay-${key})}+5])
  10. exten = _XX,n,Wait(${DB(cross/delay-${key})})
  11. exten = _XX,n,Dial(SIP/${EXTEN})
  12.  
  13. [no-op]
  14. ; Do nothing
  15. exten = s,1,NoOp(Dummy)
  16. exten = s-na,1,NoOp(Channel is not available)
  17.  
  18. [hotline-0]
  19. ; Define a custom name for the caller ID.
  20. ; This was an extra that I did
  21. exten = s,1,Set(CALLERID(name)=hotline ${CALLERID(name)} ${CALLERID(num)})
  22. ; Set a key unique for each channel. So id doesn't matter how
  23. ; many calls we get, there will always exist just one key per channel
  24. ; This way we increase the delay only when we want to.
  25. exten = s,n,Set(__key=${CHANNEL})
  26. ; Define the initial delay value on the database. That's even better than
  27. ; a global variable. One advantage, pointed out by a collegue of mine, is
  28. ; that when the process is over, you can delete the key from the DB.
  29. exten = s,n,Set(DB(cross/delay-${key})=-5)
  30. ; Set all the devices as a single variable.
  31. ; Note that all of them use the "Local" context
  32. exten = s,n,Set(dg0=Local/91@wait-op)
  33. exten = s,n,Set(dg0=${dg0}&Local/93@wait-op)
  34. exten = s,n,Set(dg0=${dg0}&Local/95@wait-op)
  35. exten = s,n,Set(dg0=${dg0}&Local/20@wait-op)
  36. exten = s,n,Set(dg0=${dg0}&Local/21@wait-op)
  37. exten = s,n,Set(dg0=${dg0}&Local/50@wait-op)
  38. exten = s,n,Set(dg0=${dg0}&Local/22@wait-op)
  39. exten = s,n,Dial(${dg0}|80)
  40. ; Manage the voicemail with a macro
  41. exten = s,n,Macro(hotline-voicemail|${DIALSTATUS}|0)
  42. ; Delete the keys at hangup
  43. exten = h,1,NoOp(DB_DELETE(cross/inc-${key})
  44. exten = h,n,Hangup
  45.  
  46. [macro-hotline-voicemail]
  47. ; ${ARG1} Dialstatus
  48. ; ${ARG2} Whose voicemail?
  49. exten = s,1,Set(CHANNEL(language)=de)
  50. exten = s,n,Goto(s-${ARG1},1)
  51. exten = s-BUSY,1,Voicemail(${ARG2},b)
  52. exten = s-NOANSWER,1,Voicemail(${ARG2},u)
  53. exten = s-CONGESTION,1,Voicemail(${ARG2},b)
  54. exten = s-CHANUNAVAIL,1,Voicemail(${ARG2},u)
 
 

I know it's perhaps not the best approach. We didn't want to use queues, because our peers aren't agents, and, though it can be optimised, it works now :)

Hope it helps somebody,

Happy coding. 

No comments for this item
Last Updated ( Friday, 01 August 2008 )
 
Asterisk Voicemail
User Rating: / 0
Written by Gurito   

So, I did a fresh install from Asterisk on a server, then configured some SIP users and connected Snom phones for each one of them. Then, as I was testing, I noticed that the "Mail" button on the Snom phones dialed an extension "asterisk". So I couldn't get around dialing the general voicemail extension in order to check my mail.

Anyway, there are a few solutions to this problem. One of them is including the option "vmexten" for each user, either in sip.conf or in users.conf. The problem with this approach is that any other user can dial any existing "vmexten" value and, given that he/she knows the password for this voicemail, access the mailbox. So, in order to solve this problem a collegue told me that it was perhaps a good idea to use the "asterisk" extension.

Here is how I did it. In the file "extensions.conf" I performed the next changes:

Asterisk basics -> Voicemail
  1. ;
  2. ; *First thing is defining an ew context for the voicemail*
  3. [voicemail]
  4. exten = asterisk,1,NoOp(This extension takes us to check the voicemail)
  5. exten = asterisk,n,NoOp(Caller ID : ${CALLERID(num)})
  6. exten = asterisk,n,NoOp(Channel Type : ${CHANNEL(channeltype)})
  7. exten = asterisk,n,GotoIf($[ "${CHANNEL(channeltype)}" = "SIP" ]?asterisk-sip,1)
  8. exten = asterisk,n,GotoIf($[ "${CHANNEL(channeltype)}" = "IAX2" ]?asterisk-iax,1)
  9. exten = asterisk-sip,1,NoOp(SIP Name : ${SIPCHANINFO(peername)})
  10. exten = asterisk-sip,n,NoOp(Mailbox : ${SIPPEER(${SIPCHANINFO(peername)}|mailbox)})
  11. exten = asterisk-sip,n,Macro(voicemail-general|${SIPPEER(${SIPCHANINFO(peername)}|mailbox)})
  12. ; *Now, there's no IAXCHANINFO on asterisk 1.2 - 1.4. But it will work if you have an IAX2 client*
  13. ; *that supports entering voicemail login info. (like voix phone)*
  14. exten = asterisk-iax,1,NoOp(IAX automatic voicemail is not yet supported)
  15. exten = asterisk-iax,n,Macro(voicemail-general)
  16.  
  17.  
  18. ; *Second thing is definig a Voicemail Macro.*
  19. ; *Think of this macro as of a function which performs a login for the voicemail.*
  20. [macro-voicemail-general]
  21. ; ${ARG1} = User's mailbox
  22. ; *If the SIP 12 has the mailbox 30, then ${ARG1} = 30.*
  23. ; *But don't worry, this parameter is already given by the "asterisk" context previously defined.*
  24. ; Set the language for the voicemail message.
  25. exten = s,1,Set(CHANNEL(language)=de)
  26. exten = s,n,Answer()
  27. exten = s,n,GotoIf($[ ${ISNULL(${ARG1})} ]?s-null,1)
  28. ; *In my case I had to put this wait in order for the greeting message to play completely.*
  29. exten = s,n,Wait(1)
  30. exten = s,n,VoiceMailMain(${ARG1})
  31. exten = s,n,Hangup()
  32. ; *The extension s-null is called when ${ARG1} is empty*
  33. ; *In this case, we call VoiceMailMain withouth parameters and, if the client, say voix phone,*
  34. ; *has the voicemail login data configured, it will pass it automatically to asterisk.*
  35. ; *It may well be that you don't need the "Wait()" here*
  36. exten = s-null,1,Wait(1)
  37. exten = s-null,n,VoiceMailMain()
  38. exten = s-null,n,Hangup()
  39.  
  40.  
  41. ; *Finally, I included the "voicemail" context on the default context for my users.*
  42. [default]
  43. include = voicemail
  44. ...
 


So that's it... I hope you find it useful.

Happy coding. :)

No comments for this item
Last Updated ( Monday, 28 July 2008 )
 
<< Start < Prev 1 2 3 Next > End >>

Results 1 - 4 of 12