Obtain asterisk IP address from dialplan
|
| Author |
Message |
dghundt
Joined: Oct 16, 2005
Posts: 162
Status: Offline
|
| Posted:
Dec 30, 2007 - 03:33 AM |
|
|
Is there a way to capture the asterisk ip address from the dialplan? I would like to be able to dial a custom extension (like 1234), then have allison read out the current ip address. |
|
|
|
 |
ianplain
Site Admin
Joined: Jul 05, 2004
Posts: 2803
Location: Bath UK
Status: Offline
|
| Posted:
Dec 30, 2007 - 09:46 AM |
|
Hi using the Header you should be able to get what you want
for example.
| Code: | exten => 516,1,Noop(${SIPCALLID})
exten => 516,n,Set(FR=${SIP_HEADER(From):6})
exten => 516,n,Set(FR=${CUT(FR,<,2)})
exten => 516,n,Set(FR=${CUT(FR,@,1)})
exten => 516,n,Set(FR=${CUT(FR,:,2)})
exten => 516,n,Set(IP=${SIP_HEADER(Via):8})
exten => 516,n,Set(IP=${CUT(IP,P,2)})
exten => 516,n,Set(IP=${CUT(IP,b,1)})
exten => 516,n,Noop(${IP})
exten => 516,n,Set(UA=${SIP_HEADER(User-Agent):12})
exten => 516,n,Noop(${UA})
exten => 516,n,flite(Your caller i d is ${FR} and i p address is ${IP} Your user agent is a ${UA})
|
Ian |
|
|
|
 |
dghundt
Joined: Oct 16, 2005
Posts: 162
Status: Offline
|
| Posted:
Dec 30, 2007 - 03:14 PM |
|
|
Thanks Ian,
Would this work for a phone connected to an fxs port? It looks like this depends on using local sip extension and should work well.
I have read that there are commands that can be used in the asterisk dialplan that can be interpreted as linux commands. I was hoping I could use this approach to achieve same functionality as one sees when setting up a sipura ata device - plug in an analog phone, dial a code/number and hear ip address.
I should have mentioned fxs port, but I had not even realized the approach you gave.
Thanks again.
David |
|
|
|
 |
|
| Forum Rules and Guidelines |
About VoIP User |
Privacy Policy
|
All logos and trademarks in this site are property of their respective owner. Comments and posts are property of the poster, all the rest (c) 2003-2006 VoIP User.
No part of this site may be reproduced without our prior consent.
|
|