Created
September 11, 2018 04:33
-
-
Save altanai/2d7398ad8fc85face3a47df9e094a369 to your computer and use it in GitHub Desktop.
This file contains 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
contract Owned { | |
address owner; | |
function Owned() public { | |
owner = msg.sender; | |
} | |
modifier onlyOwner { | |
require(msg.sender == owner); | |
_; | |
} | |
} | |
contract voipo is Owned { | |
struct Instructor { | |
string sipto; | |
string sipfrom; | |
string callsubject; | |
uint callid; | |
} | |
mapping (address => Instructor) instructors; | |
address[] public instructorAccts; | |
event instructorInfo( | |
string sipto, | |
string sipfrom, | |
string callsubject, | |
uint callid | |
); | |
function setInstructor(address _address, string _sipto, string _sipfrom , string _callsubject , uint _callid) onlyOwner public { | |
//var instructor = instructors[_address]; | |
instructors[_address].sipto = _sipto; | |
instructors[_address].sipfrom = _sipfrom; | |
instructors[_address].callsubject= _callsubject; | |
instructors[_address].callid = _callid; | |
instructorAccts.push(_address) -1; | |
emit instructorInfo(_sipto ,_sipfrom, _callsubject, _callid); | |
} | |
function getInstructors() view public returns(address[]) { | |
return instructorAccts; | |
} | |
function getInstructor(address _address) view public returns (string, string , string , uint) { | |
return ( | |
instructors[_address].sipto, | |
instructors[_address].sipfrom, | |
instructors[_address].callsubject, | |
instructors[_address].callid | |
); | |
} | |
function countInstructors() view public returns (uint) { | |
return instructorAccts.length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solidity smart contract to store voip call record in block chain in ethereum .