Page() application

Hello all… I apologize in advance for the long post… just trying to give you as much info as possible!

I am fairly new to Asterisk… been reading A LOT and am working my way through various configurations on Asterisk…

I am trying to get the Page() application to work correctly and am almost there (I think), but i’ve run into a bit of a snag!

I am running Asterisk version 1.8.15 and have setup 2 basic extensions, 100 (hostname is d45f in SIP.conf) and 200 (hostname is d495 in SIP.conf) (both Yealink T22 phones) and they register and are able to call one another… so far so good!

In an attempt to get some paging functionality working, in the current context for the phones, I’ve added the following lines to my dialplan:

exten => _*88XXX,1,SIPAddHeader(p-auto-answer: normal)
exten => _*88XXX,n,Page(SIP/${EXTEN:3},d)

As I understand it, a user would dial *88 and the extension they wish to reach and it would page that extension and auto-answer…

The output at the CLI is as follows:

== Using SIP RTP CoS mark 5
– Executing [*88200@internal_users:1] SIPAddHeader(“SIP/d45f-0000003d”, “P-Auto-Answer: normal”) in new stack
– Executing [*88200@internal_users:2] Page(“SIP/d45f-0000003d”, “SIP/200,d”) in new stack
[Aug 29 20:15:04] WARNING[24564]: chan_sip.c:5442 create_addr: Purely numeric hostname (200), and not a peer–rejecting!
– <SIP/d45f-0000003d> Playing ‘beep.gsm’ (language ‘en’)
– Created MeetMe conference 1023 for conference ‘195541519d’
– Hungup ‘DAHDI/pseudo-65214941’
== Spawn extension (internal_users, *88200, 2) exited non-zero on ‘SIP/d45f-0000003d’

I have tested by replacing ${EXTEN} with d495 and it worked… so I know the p-auto-answer command in the SIPAddHeader() application is working…

I believe I understand the issue somewhat, which is that the ${EXTEN} variable is simply made up of the last 3 digits that I dilaed (i.e. 200) and it cannot be used with the Page() application, which requires a hostname, not an extension number, as a parameter.

My problem is that I don’t know what else to sue instead… Can anyone give me some guidance on how this should be done??

Thank you in advance!!
Amit

You need to look up the device name in the same way as you would do for normal dialing. If you have hints defined for the extension, there may be a function that allows you to read the hint, to get the device name.

I don’t understand why you would use Page if you only had one device to call. Dial should do the same.

Thanks for the quick reply… please note this is a test environment, hence only two extensions…

The reason I am using the Page application, from what I understand, is so the receiving end does not have to actually answer the phone, and I don’t want to set every phone to auto answer every other type of call, only paged calls… the intent is to use it as an intercom system to a targeted phone (as opposed to a general PA) from one office to another.

How could I create this functionality using the Dial app? Can I use the SIPAddHeader function with the Dial app?? Didn’t seem to work when I tried it but I can try again…

If I understand this right, when using the Dial app, the device name (hostname) making the call is looked up in SIP.conf and then matched to an extension in the dial plan based on the context it has been associated with… How can this be done using the Page application without the error I have indicated in the first post?

Thanks in advance!

Dial and Page are run in the same context with respect to extension resolution and take the same parameters.

They are only degenerate when there is only one device being called at a time.

The incoming device determines a context. The destination extension is matched by the dialplan for that context. The dialplan can then issue a Dial or Page to one or more devices that represent the extension, for calls in that context.

OK, that makes perfect sense…

So what syntax can I use to create the functionality I am looking for to contact a extension, and have that extension auto-answer so a “page” or “intercom” type call can take place?

Do the AddHeader and then goto the context and extension.

I’m sorry, I am not quite sure how to do that… still very new to the dialplan… here is my current context in the dialplan, which doesn’t work:

[internal_users]

exten => 100,1,Dial(SIP/d45f)
exten => 200,1,Dial(SIP/d495)

exten => _*88XXX,1,SIPAddHeader(P-Auto-Answer: normal)
same => n,Dial(SIP/${EXTEN:3})

can you show me the syntax you are suggesting?

As it is only one line, I’ll do it, but beyond a certain point you need to go to the jobs forum.

exten => _*88XXX,1,SIPAddHeader(P-Auto-Answer: normal)
same => n,Goto(${EXTEN:3},1)

Next time, please use core show application on any applications named, to see how to use them.

brilliant!
Thank you for clarifying! Sorry about asking for code help in the wrong forum… I’ll make sure to post in the jobs forum for that next time!
Much appreciated sir!

Errr, question…
Is there no other way to get some help with syntax etc without having to hire someone??

core show applications
core show application xxx
core show functions
core show functions xxxx
manager show commands
manager show command xxxx
help yyyy

asteriskdocs.org/
voip-info.org/

configs/*.sample in the source tree.

Generally I will hint people in the right direction, but you will find that I generally drop out of the thread if someone asks me to write their dialplan for them.

If you want help on the syntax and have exhausted the above resources, then you need to present an attempt that can be corrected easily.

catb.org/~esr/faqs/smart-questions.html

Thanks for the references… used a few of them already, but was stumped on the question I had asked…
Still new to the dialplan it’s use of variables etc…

Thanks again!