Re: [asterisk-users] dialed peer number

2007-08-31 Thread Vieri

--- Atis [EMAIL PROTECTED] 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  

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] dialed peer number

2007-08-30 Thread Atis
On 8/30/07, Vieri [EMAIL PROTECTED] wrote:
 I am trying to retrieve the dialed peer number but
 it seems that ${DIALEDPEERNUMBER} is broken.
 Also, I know that I could extract the dialed number
 from the ${CHANNEL} variable but this only works for
 SIP and maybe IAX (untested). However, it doesn't work
 for ZAP. All I get when using ZAP is something like
 Zap/1-1 (for SIP I would get SIP/4053-082fc408 and
 that allows me to extract the dialed extension
 4053).

 How can I get the dialed number when using a ZAP
 channel?
 (using asterisk 1.2.17)

It's already noted in documentation that dialed peer number is broken:
http://www.voip-info.org/wiki/view/Asterisk+variables

As i understand you need to get number that is dialed. You would have
it in incoming context's, in variable ${EXTEN}. Then you can store it
in some other variable. For example

[default]
exten = _XXX,1,Set(__dialed_peer=${EXTEN})
exten = _XXX,n,Answer()
...

and then use ${dialed_peer} anywhere within inherited channels.

Regards,
Atis


-- 
Atis Lezdins,
IT Responsible of BEST Riga,
[EMAIL PROTECTED]
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? - www.BEST.eu.org

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] dialed peer number

2007-08-30 Thread Vieri

--- Atis [EMAIL PROTECTED] wrote:

 On 8/30/07, Vieri [EMAIL PROTECTED] wrote:
  I am trying to retrieve the dialed peer number
 but
  it seems that ${DIALEDPEERNUMBER} is broken.
  Also, I know that I could extract the dialed
 number
  from the ${CHANNEL} variable but this only works
 for
  SIP and maybe IAX (untested). However, it doesn't
 work
  for ZAP. All I get when using ZAP is something
 like
  Zap/1-1 (for SIP I would get SIP/4053-082fc408
 and
  that allows me to extract the dialed extension
  4053).
 
  How can I get the dialed number when using a ZAP
  channel?
  (using asterisk 1.2.17)
 
 It's already noted in documentation that dialed peer
 number is broken:

http://www.voip-info.org/wiki/view/Asterisk+variables
 
 As i understand you need to get number that is
 dialed. You would have
 it in incoming context's, in variable ${EXTEN}. Then
 you can store it
 in some other variable. For example
 
 [default]
 exten = _XXX,1,Set(__dialed_peer=${EXTEN})
 exten = _XXX,n,Answer()
 ...
 
 and then use ${dialed_peer} anywhere within
 inherited channels.

Thanks Atis,

that's what I ended up doing and it's fine for my
purpose.
However, I'm still having some trouble trying to
understand why Asterisk does not log the ZAP number as
is otherwise the case for SIP. A description of this
problem is at:
http://lists.digium.com/pipermail/asterisk-users/2007-August/193645.html
I could get around the problem by knowing how to tweak
lastapp or lastdata but I still didn't get the trick.
Anyway, thank you for your feedback.

Vieri



  

Shape Yahoo! in your own image.  Join our Network Research Panel today!   
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] dialed peer number

2007-08-30 Thread Atis
On 8/30/07, Vieri [EMAIL PROTECTED] wrote:
 However, I'm still having some trouble trying to
 understand why Asterisk does not log the ZAP number as
 is otherwise the case for SIP. A description of this
 problem is at:
 http://lists.digium.com/pipermail/asterisk-users/2007-August/193645.html
 I could get around the problem by knowing how to tweak
 lastapp or lastdata but I still didn't get the trick.
 Anyway, thank you for your feedback.

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}).

Regards,
Atis

-- 
Atis Lezdins,
IT Responsible of BEST Riga,
[EMAIL PROTECTED]
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? - www.BEST.eu.org

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] dialed peer number

2007-08-30 Thread Vieri

--- Atis [EMAIL PROTECTED] wrote:

 On 8/30/07, Vieri [EMAIL PROTECTED] wrote:
  However, I'm still having some trouble trying to
  understand why Asterisk does not log the ZAP
 number as
  is otherwise the case for SIP. A description of
 this
  problem is at:
 

http://lists.digium.com/pipermail/asterisk-users/2007-August/193645.html
  I could get around the problem by knowing how to
 tweak
  lastapp or lastdata but I still didn't get the
 trick.
  Anyway, thank you for your feedback.
 
 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 see...
Thanks Atis.
I'll try specifying in the call file:
Channel: Zap/g1/7000
Extension: 7000
and in custom-NOTIFY, instead of s will try using a
pattern like exten = _7XXX,...



   

Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users