Last active
October 4, 2016 19:39
-
-
Save herrersystem/612e39312b05f250614bf515c8fff92b to your computer and use it in GitHub Desktop.
Freebox OS API - Test phone call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
from apize.apize import Apize | |
app = Apize('http://mafreebox.freebox.fr/api/v3') | |
@app.call('/phone/fxs_ring_start/', method='POST') | |
def call_start(session_token): | |
headers = {'X-Fbx-App-Auth': session_token} | |
return {'headers': headers} | |
@app.call('/phone/fxs_ring_stop/', method='POST') | |
def call_stop(session_token): | |
headers = {'X-Fbx-App-Auth': session_token} | |
return {'headers': headers} | |
if __name__ == '__main__': | |
""" | |
To get session_token see: | |
https://gist.github.com/herrersystem/fbeea3c026fe225104edd9866dea2bac | |
""" | |
session_token = '<your_session_token>' | |
call_start(session_token) | |
time.sleep(8) | |
call_stop(session_token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment