ساعدومي الله يجزاااكم خير Magic numbers

اذا كنت تبحث عن حلول جاهزه او كانت لديك مشكلة تريد حلها باستخدام أستريسك
أضف رد جديد
kasko
مشاركات: 1
اشترك في: 13 إبريل 2013, 08:46

ساعدومي الله يجزاااكم خير Magic numbers

مشاركة بواسطة kasko »

السلام عليكم
انا مبتدئة جدا في تطبيقات الاستيريسك وبدرس مادة اتصالات وطلب مني هذا الواجب
ممكن احد يساعدني لاني من جد مرررررة ضايعة

Here is a script that allows users to set a "magic" number in the database. Each "account" has its own "magic" number. There is no authentication here (how would you add that)?.

[dbdemo]
;; this version says the numbers as strings of digits: "one four nine"

exten => start,1,Answer
same => n,Background(yourkeyis)
same => n,SayDigits(${theAccount})
same => n,Noop(The_account_is${theAccount})

same => n,Background(onetwothreemagic) ;; 1 = set account; 2 = get magic, 3 = set magic
same => n,WaitExten(10)
same => n,Playback(goodbye)

exten => 1,1,Playback(digits/1) ;; set account

same => n,Background(enterkey) ;; "enter your key, ending with #"
same => n,Read(theAccount)
same => n,Noop(The_account_is${theAccount})
same => n,Noop(The_value_is:${DB(MagicDB/${theAccount})}:)

same => n,Background(yourkeyis) ;; "your key is"
same => n,SayDigits(${theAccount})
same => n,GotoIf($[${LEN(${DB(MagicDB/${theAccount})})}=0]?end:speak) ;; empty string: LEN=0

same => n(speak),Background(yourmagicis) ;; "your magic number is"
same => n,SayDigits(${DB(MagicDB/${theAccount})})
same => n(end),Goto(start,4)


exten => 2,1,Playback(digits/2) ;; get magic
same => n,Background(yourmagicis) ;; "your magic number is"
same => n,SayDigits(${DB(MagicDB/${theAccount})})

; same => n,Read(theValue)
; same => n,Set(DB(MagicDB/${theAccount})=${theValue})
same => n,Goto(start,1)

exten => 3,1,Playback(digits/3) ;; set magic

same => n,Background(entermagic) ;; "enter a magic number, ending with #"
same => n,Read(theMagic)
same => n,Set(DB(MagicDB/${theAccount})=${theMagic})

same => n,Goto(start,1)

exten => _X,1,Playback(digits/${EXTEN}) ;; match any digit
same => n,Playback(wrong)


You are to take the magic-number example and modify it to support the following features. The existing source is in extensions.conf in the [dbdemo] context (section); all your changes should be made in this context only (or create a new context). The extension to reach this is 2004.

0. Currently the server reads you your magic number whenever you log in. Change this so the magic number is read to you only

when you request it by pressing 2
just after you enter a new magic number, for confirmation

1. Implement a passcode system. Before you can get access to your magic number, let alone set it, you have to provide your passcode. Of course, the account has to be entered first, so that the system knows which passcode to work with. Passcodes should be set up initially in the Asterisk database system; you'll use a separate table from the magic-number table; see the database information below. Some accounts may not have passcodes; your system should handle that option in a reasonable manner.

Note that a "finished" version here implies some structural changes to the prompt system: you should authenticate first (account number and then passcode), and only then be allowed to reach a menu where you can set and get the magic number. My existing menu allows you to set your account at any point.

While you are doing this, you should also adjust the prompt system to better make a distinction between accounts that have a magic number already (in which case it is read), or accounts which do not yet have magic.

2. Add support for allowing a user to change his or her passcode.

3. Add support to allow the user to change to a new account (with new passcode) without hanging up. Perhaps the easiest way to do this is a special option in the main menu to "start over".

4. Currently the initial default account is 2000. Have it instead be the user's extension, using caller-ID to get the extension, if this caller-ID information is available. Design this option so it is quick and easy to use. If the caller-ID information is not available, use no initial account (or 2000, if you can't get the no-initial-account thing to work). Note that the most common arrangement in Asterisk is for the extension caller-ID number to be set in the sip.conf file, as part of the definition of a given channel. You can use substring operators to get the last four digits of the caller-ID number, if you wish, or just use 4-digit extensions exclusively.

5. I am working on one or two additional requirements for graduate students.
All voice prompts should spell out all options; there should be no "hidden" options. That said, you don't have to be wordy; you can just say things like "one for setting account; two for passcode, three for magic". Use the built-in recordings by Allison Smith as appropriate.

Appropriate initial entries in the database should be made from the Asterisk command line, which you reach from the bash command line with asterisk -r. Handy commands:

database show
database put table key value (eg database put dbdemo 4001 123454321)
database get table key
database del table key.

The following entries have been pre-entered

account magic
123454321 4001
429811 4002
73 4003
59 4004

الله يخليكم ساعدوني لان موعد التسليم قرب وانا كل محاولاتي اني احله فشلت
الله يفرج هم اللي يفرج همي
أضف رد جديد

العودة إلى ”طلبات وحلول اخرى“