In order to realize this behavior you need to:

  1. Set the device with a SIP extension 
    [Setup -> Identity -> Log In Information]



  2. Goto  “Action URL Settings” tab and fill “Incoming Call” with the following string:
    http://127.0.0.1/dummy.htm?pa1_pin1=on&settings=save



    This setting make an HTTP Request to PA1 in order to enable Pin1 when the phone has an Incoming call

  3. Goto  “Action URL Settings” tab and fill “On Connected” and "On Disconnected" with the following string:
    http://127.0.0.1/dummy.htm?pa1_pin1=off&settings=save


    This setting make an HTTP Request to PA1 in order to disable Pin1 when the phone answer or not

  4. In “Action URL Settings” tab fill “Setup finished” with the following string:
    http://127.0.0.1/dummy.htm?pa1_pin1=off&settings=save



    This will set pin1 to off when the device boots up



Important note: if the settings http_user and http_pass are configured you have to include the credentials into the URL like the following example:
http://username:password@127.0.0.1/dummy.htm?pa1_pin1=on&settings=save

More info on wiki: