[asterisk-dev] [feature requests]: 'zap answer confirmation info' and 'different clis on forking'

Peter Beckman beckman at purplecow.com
Tue May 16 07:35:41 MST 2006


On Tue, 16 May 2006, Christian B wrote:

> hello folks!

  First off, this is more of an asterisk-users mailing list question.
  However, since I know your issue, I'll answer.

> there are two features that i'm looking for since nearly a year now but
> so far i can't fullfill them with asterisk(afaik), both have the same
> cause:
>
> in my setup there are extensions similar to this:
>
> exten => s,1,SetCallerID(0023123456 <0023123456>)
> exten => s,n,Dial(SIP/88888 at sipproxy.domain.com&Zap/G1c/0023777777)
>
>
> 1.Feature: Answer Confirmation Info
> ======================================
> There's a patch by bweschke[1] called "follow_me-find_me", which plays a
> message to the callee to accept the call by pressing a key, if he
> doesn't, the next extension that has been configured in the
> followme.conf is dialed.

  No need for a patch.  You need to use the M(x^y) option for Dial.  At the
  CLI type "show application dial" for documentation, or see this page:

     http://mph.gotdns.com:82/manual/en/function.dial.php

  It calls the user, then calls a Macro called x and passes any parameters
  using the carrot ^ to delimit.

  For example, in your dialplan (this is untested, just a theory):

  [macro-press-pound]
  ; If the channel is not Zap, skip everything
  exten => s,1,GotoIf($[${CHANNEL:0:3} = Zap]?press-pound:done)

  ; Ask the caller to press pound to connect
  exten => s,n(press-pound),Read(SCREENING_CHOICE|you-have-a-caller-on-the-line-press-pound-to-connect|1||3)

  ; If they enter pound, end the macro and the call is connected
  exten => s,n,GotoIf($[${SCREENING_CHOICE} = #]?done:nada)

  ; If they enter anything else, tell Asterisk, using MACRO_RESULT, to hang
  ; up on the called party and then return to continue through the dialplan.
  exten => s,n(nada),Set(MACRO_RESULT=CONTINUE)
  exten => s,n(done),NoOp

  [your-normal-dialplan]
  exten => s,1,SetCallerID(0023123456 <0023123456>)
  exten => s,n,Dial(SIP/88888 at sipproxy.domain.com&Zap/G1c/0023777777||M(press-pound))

  When you Dial, the Macro will execute and playback your sound file to the
  called party only.

  The GotoIf will play the "press pound" message only to callers of a Zap
  channel.

> 2.Feature: Different CallerID's on Forking
> ==========================================
> The second feature is a bit more abstract - same setup as above:
>
> exten => s,1,SetCallerID(0023123456 <0023123456>)
> exten => s,n,Dial(SIP/88888 at sipproxy.domain.com&Zap/G1c/0023777777)

  [If the call is SIP, send CLID as 0023123456, else if the call is Zap,
  send CLID as 23123456.]

  Not with a single Dial command with multiple channels is that possible.
  Instead, if CLID is more important than attempting both calls
  simultaneously, do separate calls:

  exten => s,1,SetCallerID(0023123456 <0023123456>)
  exten => s,n,Dial(SIP/88888 at sipproxy.domain.com|20)
  exten => s,n,SetCallerID(23123456 <23123456>)
  exten => s,n,Dial(Zap/G1c/0023777777)

Beckman 
---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
beckman at purplecow.com                             http://www.purplecow.com/
---------------------------------------------------------------------------



More information about the asterisk-dev mailing list