[VoIP] Can this be done?

Paul Wills pdwills at cedarknolltelephone.com
Tue Jan 30 16:18:41 CST 2007


I thought of using a call file but, as you say, it ain't pretty.

While copying down the below code, I made a few calls so I could recreate 
the error message as part of this email.  To my surprise, I can't get it to 
fail.  I may have fixed the problem in Cisco router or, perhaps, it was that 
dead chicken I waved around last night.

Just to show the concept, there are two components to extensions.conf.

When the ANI unit is triggered, the ANI data comes in here:

[anireceive]

exten => _594XXXX,1,answer
exten => _594XXXX,2,wait
exten => _594XXXX,3,Set(ANIDATA=${EXTEN}|g) ;Read ANI data here
exten => _594XXXX,4,NoOp(${ANIDATA})
exten => _594XXXX,5,hangup


A call coming in from the Cisco FXS port goes here:

[ciscofxs]

exten => _X.,1,NoOp(GET ANI HERE)
;exten => _X.,2,NoOp                         ; Do nothing, or;
exten => _X.,2,Dial(SIP/1 at 55,1)    ; Make a "dummy" call to the E&M port to 
toggle the E lead, or;
;exten => _X.,2,agi                               ; Call a script to toggle 
the DTR lead on the serial port.

The pulsed E lead will then latch up a relay that will start the ANI unit.

exten => _X.,3,NoOp
exten => _X.,4,NoOp(${ANIDATA})^M
exten => _X.,5,NoOp^M
exten => _X.,6,set(ANIDATA=5943514)  ;Leave next line out until ANI is 
implemented
;exten => _X.,6,GoToIf($["${ANIDATA}"="0000000"]?5:7)^M   ;Loop until the 
ANI data has been received.
exten => _X.,7,NoOp
exten => _X.,8,set(CALLERID(num)=${ANIDATA})^M
exten => _X.,9,NoOp(${ANIDATA})^M
exten => _X.,10,set(ANIDATA=0000000|g)^M
exten => _X.,11,NoOp(${ANIDATA})^M
exten => _X.,12,goto(inbound,${EXTEN},1)^M

Then go to the regular inbound context with a real Caller ID number.

The above code all works so far.  All I have to do is complete the hardware 
connection between [ciscofxs] and [anireceive] and I should be done.  I 
guess it's time to mount the router in the switchroom.

Now to try to "break" it.

PDW



----- Original Message ----- 
From: "Shane Young" <voiptandem at shaneyoung.com>
To: <voip at ckts.info>
Sent: Tuesday, January 30, 2007 4:32 PM
Subject: Re: [VoIP] Can this be done?


> Ok, I've given this some thought.  This ranks up there with hooking a
> fan motor to a magneto generator to ring the phones on your 1A2 system
> BUT yes, you could do it.  It's asterisk, it can do just about
> anythinng.
>
> If you need more details than concepts, let me know:
>
> In your incoming context, use the "system" command to fire off a shell
> script to build a ".call" file and move the .call file into
> /var/spool/asterisk/outgoing.
>
> The call file would look something like this:
>
> Channel: sip/9999 at 1.2.3.4
> MaxRetries: 0
> RetryTime: 0
> WaitTime: 3
> Context: do-nothing
> Extension: s
> Priority: 1
>
>
> When that file is moved into /var/spool/asterisk/outgoing, Asterisk
> will read it and place a call to sip/9999 at 1.2.3.4 and wait 3 seconds
> for an answer.
>
> The context "do-nothing" in your dialplan should never be reached but
> in case it is, it should look something like this:
> [do-nothing]
> exten => s,1,Answer
> exten => s,2,wait(3)
> exten => s,3,Hangup
>
>
> Try that and let me know how it works.
>
> --Shane
>



More information about the VoIP mailing list