Aastra XML Script Success

Discussion in 'IP Phones' started by thx2000, Mar 28, 2009.

  1. thx2000

    Joined:
    Mar 28, 2009
    Messages:
    19
    Likes Received:
    0
    I just made the leap to elastix from trixbox. Thought I'd post my method for getting the aastra XML scripts working.

    [*]ssh into the box and get into a working directory (/usr/src)
    [*]Grab the XML script source from Aastra
    Code:
    wget http://www.aastratelecom.com/cps/rde/xbcr/SID-3D8CCB6A-6895A672/03/Aastra_XML_Source_code_V2.2.0.zip
    [*]unzip and extract the tgz, then enter the aastra-xml-scripts-2.2.0 directory
    Code:
    unzip Aastra_XML_Source_code_V2.2.0.zip
    tar -xzvf aastra-xml-scripts-2.2.0.tar.gz
    cd aastra-xml-scripts-2.2.0
    
    [*]Create install.sh and dump the following into it
    Code:
    #!/bin/sh
    
    chown -R asterisk:asterisk ./INSTALL/*
    chown -R asterisk:asterisk ./SCRIPTS/*
    chmod 777 ./SCRIPTS/scripts/*
    
    cp -r ./INSTALL/MP3 /var/cache
    
    if [ ! -x /var/cache/aastra ]; then
            mkdir /var/cache/aastra
    fi
    
    cp -r ./INSTALL/cache/* /var/cache/aastra
    cp -r ./INSTALL/agi-bin /var/lib/asterisk
    cp ./INSTALL/asterisk/* /etc/asterisk
    chmod +x ./INSTALL/scripts/*
    cp ./INSTALL/scripts/* /usr/local/sbin
    cp ./INSTALL/sounds/* /var/lib/asterisk/sounds/custom
    
    if [ ! -x /var/www/html/aastra ]; then
            mkdir /var/www/html/aastra
    fi
    
    cp -r ./SCRIPTS/* /var/www/html/aastra
    
    [*]make install.sh executable (chmod +x install.sh)
    [*]run install.sh
    [*]run setup-aastra-xml
    [*]Almost done, one last step. Edit /etc/httpd/conf/httpd.conf and look for the following:
    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    
    [*]Change it so it it reads:
    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !(/aastra/*)
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    
    [*]Restart apache ('service httpd restart'), and you're all set. Configure your phone to access the TFTP server one way or another and on the next reboot you should be greeted with autoconfig screen.

    I'll probably post another thread on the last step, because I think it is worth noting that specifying an additional 'RewriteCond' can assist with allowing hardware (or software) to access the server w/o using HTTPS. For example, I changed it to read:
    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !(/http/*)
    RewriteCond %{REQUEST_URI} !(/aastra/*)
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    
    This allows me to drop anything into /var/www/html/http and not have it redirected to HTTPS.

    Good luck, and please respond if you find any bugs with this procedure.

    -THX2000
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    thx2000:

    Thank you, a nicely done script,
    Unless I missed something in your script, then I might suggest that you add (for completeness) an installation of the current firmwares available from aastra (available as an rpm, but unfortunately I can only find a "trickybox" rpm, or I would post it's availability, or a whole bunch of wgets from aastra).
    And why not move the wget and unzip/untar and setup-aastra-xml and
    sed -ie 's|RewriteCond %{HTTPS} on|RewriteCond %{HTTPS} off\\nRewriteCond %{REQUEST_URI} !(/http/*)\\nRewriteCond %{REQUEST_URI} !(/aastra/*)|' /etc/httpd/conf/httpd.conf
    (that line needs a little work if rewrite is already off, it would be on by default in Elastix)
    /etc/init.d/httpd restart
    into the script itself and make it easier for those of us who are "bash challenged"?

    (isn't chmod 777 a little over permissive also? (755should be enough))
     
  3. donhwyo

    Joined:
    Aug 8, 2008
    Messages:
    293
    Likes Received:
    0
    Looks like we are now official Aastra supported. Thanks Aastra!!! There is also a new version.

    http://65.205.71.13/2.2.1 It is written to go into 1.5.2. There is documentation written for Elastix and every thing.

    Maybe it can get into our distro. I see a spec file so someone should be able to build rpms from that. Then we will be just a yum update away from having this working with ease.

    I also see a patch file.

    I am still on 1.3.2. It does not seem to be working for me but it may be due to previous hacks. Will look at it later. Had trouble with the firmware file so I went and got it from trixbox repo.

    I have been having problems with this since installing avantfax. I think it may be in the rewrite area you mention above. The phones cant display the page. The pages are at https:// even with rewrite turned off. Not too worried about it as I ordered a new server and will be doing a clean install of 1.5.2 on it.

    Don
     
  4. donhwyo

    Joined:
    Aug 8, 2008
    Messages:
    293
    Likes Received:
    0
    Ok it seems to work great. Avantfax created a virtual web site that was causing the pages to convert to https. Removed /etc/httpd/conf.d/avantfax.conf and all is well. Avantfax still works too. Visual voicemail works with this version too.

    Don
     
  5. raj

    raj

    Joined:
    Apr 19, 2009
    Messages:
    149
    Likes Received:
    0
    donhwyo first of all thank you very much for the link that documents its amazing everything works fine with my elastix 5.2 havent yet tried Avantfax though.

    now i need one small help if you could help please?

    I need to add message application so that we can display something like this on the phone eg. branding the phone.

    [​IMG]

    please as in the image above, where it has PBX in a Flash Displayed i want to Display elastix on every phone.


    Thank you for your help.
     
  6. donhwyo

    Joined:
    Aug 8, 2008
    Messages:
    293
    Likes Received:
    0
  7. aastra1

    Joined:
    Mar 5, 2009
    Messages:
    46
    Likes Received:
    0
    Hi Don,

    Please don't use the Trixbox forum for this kind of questions. I will be monitoring the Elastix forum as well from now on.

    Regards

    aastra1
     
  8. raj

    raj

    Joined:
    Apr 19, 2009
    Messages:
    149
    Likes Received:
    0
    Dear Aastra Engineer,

    WELCOME a grand grand welcome on Elastix Forum, and Thank you so so much.

    Should i start shooting questions? please check my above question in that i have only asked for Message Application but Sir if possible i would also like to see Call Pick up with XML Scripts and it is very very important for us if you could help? let me tell you first that im a newbie so i would surely need step by step guide if you have that much time? hope you have.


    Thank you.
     
  9. thx2000

    Joined:
    Mar 28, 2009
    Messages:
    19
    Likes Received:
    0
    Great news!! Reaffirming why Aastra endpoints are the only thing I use.
     
  10. aastra1

    Joined:
    Mar 5, 2009
    Messages:
    46
    Likes Received:
    0
    Hi Raj,

    PIAF is displaying 'PBX in a Flash' using the phone status line that can be programmed using the AastraIPPhoneStatus XML command. This status line is also used to display dynamic information such as DND status, missed calls... so it is not permanent.

    There is no simple way to do what you ask as you would need to change the scripts code. I will give it some thoughts and publish a way to do it.

    The other option you have is to display 'Elastix' using the screen name 2 parameter. The changes can be done in demo-user.prf which is located at /var/www/html/aastra/asterisk.

    Right now you should have
    Code:
    sip line1 screen name 2: Ext. $$AA_SIPUSERNAME_AA$$
    but you can put something like
    Code:
    sip line1 screen name 2: Elastix $$AA_SIPUSERNAME_AA$$
    The change must be done on all the phones which support this capability (55i, 57i, 57iCT, 9480i and 9480iCT).

    I believe this is a better solution.

    Regards

    aastra1
     
  11. raj

    raj

    Joined:
    Apr 19, 2009
    Messages:
    149
    Likes Received:
    0
    Great thank you for quick response.

    So simply adding the line:

    Code:
    sip line1 screen name 2: Elastix $$AA_SIPUSERNAME_AA$$
    to demo-user.prf would work?

    and second about call pick up. take your time sir may be in future Aastra could come with giving options while auto provisioning the phone such as what buttons user wants etc. but i know its too much to ask for but just a thougt, your help is incredible anyways.


    Thank you.
     
  12. aastra1

    Joined:
    Mar 5, 2009
    Messages:
    46
    Likes Received:
    0
    Be careful, "simply adding" is not what I meant. I was telling you to modify the lines that have the 'sip line1 screen name2' parameter not adding anything.

    aastra1
     
  13. raj

    raj

    Joined:
    Apr 19, 2009
    Messages:
    149
    Likes Received:
    0
    Great Sir, it worked but only thing is doesnt display same as PIAF one but still it works, hope you will provide in future the way it display on PIAF and that too to be permanent.

    Great Work Aastra.
     
  14. donhwyo

    Joined:
    Aug 8, 2008
    Messages:
    293
    Likes Received:
    0
    Thanks and we are glad to have you here. I used that because last I saw that was where to go according to your website. Didn't even know about the new version because I only look there once in a while. It will be nice not to have to look there at all.

    You have some dedicated user over here.

    Don
     
  15. thx2000

    Joined:
    Mar 28, 2009
    Messages:
    19
    Likes Received:
    0
    I'd rather see them spending time on new features or bug fixes. Useless badging is hardly something that any time should be wasted on.
     
  16. donhwyo

    Joined:
    Aug 8, 2008
    Messages:
    293
    Likes Received:
    0
    I agree but I suppose they can sell it to somebody who wants looks over function.B) To each there own.

    Don
     
  17. petranator

    Joined:
    Aug 10, 2010
    Messages:
    4
    Likes Received:
    0
    Hi there,

    I'm at a complete loss. I've been trying to use the AastraIPPhoneStatus to send a non-invasive message to my 6757's. The sample XML I got from the Aastra documentation looks like this.

    <AastraIPPhoneStatus>
    <Session>abc12345</Session>
    <Message index=”0”>Message 1 displayed</Message>
    <Message index=”1” type=”alert” Timeout=”5”>Alert
    displayed</Message>
    </AastraIPPhoneStatus>

    I had previously succeeded in sending invasive messages to the phones using this other sample PHP code to push the message:

    <?php
    #
    function push2phone($server,$phone,$data)
    {
    $xml = "xml=".$data;
    $post = "POST / HTTP/1.1\r\n";
    $post .= "Host: $phone\r\n";
    $post .= "Referer: $server\r\n";
    $post .= "Connection: Keep-Alive\r\n";
    $post .= "Content-Type: text/xml\r\n";
    $post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
    $fp = @fsockopen ( $phone, 80, $errno, $errstr, 5);
    if($fp)
    {
    fputs($fp, $post.$xml);
    flush();
    fclose($fp);
    }
    }
    ##############################
    $xml = "<AastraIPPhoneTextScreen>\n";
    $xml .= "<Title>Push test</Title>\n";
    $xml .= "<Text>This is a test for pushing a screen to
    a phone. It is a way to demonstrate that we can
    push XML objects to an Aastra Phone.</Text>\n";
    $xml .= "</AastraIPPhoneTextScreen>\n";
    push2phone("192.168.0.112","192.168.0.150",$xml);
    ?>

    This works perfectly on my phones, except of course the AastraIPPhoneTextScreen class sends an interuptive event to the phone, which is undesirable.

    So I substituted the AastraIPPhoneStatus XML code into the sample PHP Post code, but now all I get is "Cannot Display Message". How else to I send AastraIPPhoneStatus XML to my phones?

    Thanks,

    Nate Hughes
     

Share This Page