[asterisk-users] dialed peer number

Vieri rentorbuy at yahoo.com
Fri Aug 31 03:13:44 CDT 2007


--- Atis <atis at BEST.eu.org> wrote:
> You can always use different extension in
> custom-NOTIFY, it doesn't
> have to be "s". It can be extension you are sending
> call to or
> anything else. And if this one is not enough, you
> can set some
> variables in call file and use them from dialplan
> (and append it to
> CDR). As you are using CSV for CDR, appending custom
> fields should pe
> as simple as Set(CDR(myfield)=${value}).

I didn't want to use custom fields so I tried setting
the extension in the context.
The only way I can get the dialed peer's number into
the log for all circumstances (hangup, timeout, if
user presses a menu option...) is by defining the
following context (which a .call file goes to):

[custom-ALARMS]
exten => h,1,Hangup
exten => _X.,1,SetLanguage(en)
exten => _X.,2,Set(LOOPCOUNT=0)
exten => _X.,3,Set(ACTIONTAKEN=0)
exten => _X.,4,GotoIf($[${ACTIONTAKEN} < 1]?6)
exten => _X.,5,HangUp()
exten => _X.,6(begin),Set(TIMEOUT(digit)=1)
exten => _X.,7,Set(TIMEOUT(response)=2)
exten => _X.,8,Set(USEREXTEN=${EXTEN})
exten => hang,1,Playback(goodbye)
exten => hang,2,Set(ACTIONTAKEN=1)
exten => hang,3,Goto(custom-ALARMS,${USEREXTEN},4)
exten => _X.,9,Answer()
exten => _X.,10,Wait(1)
exten => _X.,11,Background(alarm-press-5-deactivate)

exten =>
5,1,DeadAGI(alarms.php|psychiatry|1|${FHMDIALEDPEER})
exten => 5,2,Playback(alarm-deactivated)
exten => 5,3,Set(ACTIONTAKEN=1)
exten => 5,4,Goto(custom-ALARMS,${USEREXTEN},4)

exten => t,1,Goto(loop,1)

exten => i,1,Playback(invalid)
exten => i,2,Goto(loop,1)

exten => loop,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => loop,2,GotoIf($[${LOOPCOUNT} > 8]?hang,1)
exten => loop,3,Goto(custom-ALARMS,${USEREXTEN},8)

I wonder if there's a cleaner way of doing this.



       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  



More information about the asterisk-users mailing list