[Asterisk-Users] paging agi

Alex Barnes abarnes at ubiquitysoftware.com
Fri Jan 27 03:27:28 MST 2006


> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-
> bounces at lists.digium.com] On Behalf Of Tzafrir Cohen
> Sent: 27 January 2006 08:21
> To: asterisk-users at lists.digium.com
> Subject: Re: [Asterisk-Users] paging agi
> 
> Hi
> 
> Some petty notes notes regarding the perl:
> 

<SNIPPED>

> 
> I really don't see why you need to connect to the manager just to set
a
> global variable. You can easily do that from the dialplan or from the
> AGI itself. Or am I missing anything?
> 

Hi all,

I'm not sure if this helps but I had a bit of a bash at fixing some
issues with the new Page() function.

The problem was the phone that initiates the Page was getting called
itself and I think because the Snom360 had a bit of a race condition it
wasn't returning "486 Busy Here" as it should of and thus causing a
feedback loop that killed the phone and required a reboot to fix.

My solution was the following (advice is more than welcome as this is
the first EVER bash script I have written and maybe GROUP function would
have been an option):

Dialplan:

[macro-page]
exten => s,1,SIPAddHeader(Call-Info:
<sip:192.168.10.16>\;answer-after=0)

;;;Strip out calling channel
exten => s,n,Cut(caller=CHANNEL,-,1)
;exten => s,n,Cut(caller=caller,/,2)

exten => s,n,AGI(strremove|${ARG1}|${caller})
exten => s,n,NoOp(dialstring: ${dialstring})

;exten => s,n,Cut(dialstr=ARG1,caller,1)
;exten => s,n,NoOp(dialstr: ${dialstr})

exten => s,n,Page(${dialstring})



/var/lib/asterisk/agi-bin/strremove:

#!/bin/sh

dialarg=` echo $1 | sed -e 's/"//g'`
channelarg=` echo $2 | sed -e 's/"//g'`

echo arg: $1
echo arg: $unqarg

OUT="test1 $string test2"
OUT ="${dialarg//$channelarg/}"
echo SET VARIABLE dialstring $OUT

(I have tidied up the script a little to remove old debug but it should
still work fine.)


Notes:

- The AGI script finds and removes a string from the target string.
- The macro takes ARG1 as input which is the list of devices you wish to
use as intercom phones:

exten => 200,1,Macro(page,SIP/snom1&SIP/snom2&SIP/snom3) ;Pager /
Intercom


I still have issues with intercom breaking the odd snom that is
currently on the phone so I dare say that Jeremy's script will fix that.

However it would seem to me that the page function should be doing this
itself.


I hope this is of use to someone.

Alex


Information contained in this e-mail and any attachments are intended for the use of the addressee only, and may contain confidential information of Ubiquity Software Corporation.  All unauthorized use, disclosure or distribution is strictly prohibited.  If you are not the addressee, please notify the sender immediately and destroy all copies of this email.  Unless otherwise expressly agreed in writing signed by an officer of Ubiquity Software Corporation, nothing in this communication shall be deemed to be legally binding.  Thank you.




More information about the asterisk-users mailing list