Skip to content

Instantly share code, notes, and snippets.

@altanai
Created September 11, 2018 04:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save altanai/2d7398ad8fc85face3a47df9e094a369 to your computer and use it in GitHub Desktop.
Save altanai/2d7398ad8fc85face3a47df9e094a369 to your computer and use it in GitHub Desktop.
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;
}
}
@altanai
Copy link
Author

altanai commented Sep 11, 2018

Solidity smart contract to store voip call record in block chain in ethereum .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment