summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Eefting <edwin@datux.nl>2012-11-08 14:57:17 (GMT)
committer Edwin Eefting <edwin@datux.nl>2012-11-08 14:57:17 (GMT)
commit1b66f02e61145e1d3902a9deed0462aadd567ec3 (patch)
tree4101522f022edfb49217fd9ff68eba0cb262efe6
parentd01f6f72e9689e6fcf23d3e72fb295d2dc8b6982 (diff)
1.8 iax/dahdi tests
-rw-r--r--etc/synapse/asterisk.conf8
-rw-r--r--modules/ami.module/module.cpp4
-rw-r--r--modules/asterisk.module/module.cpp115
-rw-r--r--modules/docs/html/asterisk_8module_2module_8cpp.html2
4 files changed, 111 insertions, 18 deletions
diff --git a/etc/synapse/asterisk.conf b/etc/synapse/asterisk.conf
index ba8f4c1..bf08828 100644
--- a/etc/synapse/asterisk.conf
+++ b/etc/synapse/asterisk.conf
@@ -1,12 +1,12 @@
{
- "staging":{
+ "rene":{
"host" :"localhost",
"port" :"5038",
- "username" :"synapse",
- "password" :"f39tgvp095vcnek3"
+ "username" :"admin",
+ "password" :"amp111"
},
"datux":{
- "host" :"localhost",
+ "host" :"localhostX",
"port" :"5038",
"username" :"manager",
"password" :"insecure"
diff --git a/modules/ami.module/module.cpp b/modules/ami.module/module.cpp
index 1e67e96..0ac9145 100644
--- a/modules/ami.module/module.cpp
+++ b/modules/ami.module/module.cpp
@@ -134,7 +134,7 @@ class CnetAmi : public synapse::Cnet
string dataStr(boost::asio::buffer_cast<const char*>(readBuffer.data()), readBuffer.size());
dataStr.resize(dataStr.find(delimiter)+delimiter.length());
- DEB("RECEIVED FROM ASTERISK:\n" << dataStr );
+ // DEB("RECEIVED FROM ASTERISK:\n" << dataStr );
//create a regex iterator
boost::sregex_iterator regexI(
@@ -251,7 +251,7 @@ SYNAPSE_REGISTER(ami_Action)
}
amiString+="\r\n";
- DEB("SEND TO ASTERISK:\n" << amiString);
+ // DEB("SEND TO ASTERISK:\n" << amiString);
net.doWrite(msg.src, amiString);
}
diff --git a/modules/asterisk.module/module.cpp b/modules/asterisk.module/module.cpp
index 60a28df..fdd6c42 100644
--- a/modules/asterisk.module/module.cpp
+++ b/modules/asterisk.module/module.cpp
@@ -246,16 +246,16 @@ namespace asterisk
bool isFiltered()
{
//dont show trunks
- if (trunk)
- return (true);
+ // if (trunk)
+ // return (true);
//dont show devices with empty caller ID's
- if (callerIdName=="")
- return (true);
+ // if (callerIdName=="")
+ // return (true);
//dont show anything thats not sip (for now)
- if (id.substr(0,3)!="SIP")
- return (true);
+ // if (id.substr(0,3)!="SIP")
+ // return (true);
return(false);
}
@@ -1122,16 +1122,38 @@ namespace asterisk
else if (msg["ActionID"].str()=="Login")
{
serverMap[msg.dst].status=Cserver::AUTHENTICATED;
-
+ Cmsg out;
//learn all SIP peers as soon as we login
- Cmsg out;
out.clear();
out.src=msg.dst;
out.event="ami_Action";
out["Action"]="SIPPeers";
out.send();
+ //learn all IAX peers as soon as we login
+ out.clear();
+ out.src=msg.dst;
+ out.event="ami_Action";
+ out["Action"]="IAXPeers";
+ out.send();
+
+ //learn all ZAP channels as soon as we login
+ //NOTE: gives useless info
+ // out.clear();
+ // out.src=msg.dst;
+ // out.event="ami_Action";
+ // out["Action"]="ZapShowChannels";
+ // out.send();
+
+ //learn all DAHDI channels as soon as we login
+ //NOTE: gives useless info
+ // out.clear();
+ // out.src=msg.dst;
+ // out.event="ami_Action";
+ // out["Action"]="DahdiShowChannels";
+ // out.send();
+
//learn current channel status as soon as we login
out.clear();
out.src=msg.dst;
@@ -1179,7 +1201,35 @@ namespace asterisk
}
- //we got a response to our SIPPeers request.
+ //we got a response to our SIPPeers/IAXpeers request.
+ /* IAX2 1.8:
+ |ChanObjectType = peer (string)
+ |Channeltype = IAX2 (string)
+ |Dynamic = no (string)
+ |Encryption = no (string)
+ |Event = PeerEntry (string)
+ |IPaddress = 81.18.245.155 (string)
+ |IPport = 4569 (string)
+ |ObjectName = flexvoice/201-CDS_Datux (string)
+ |Status = Unmonitored (string)
+ |Trunk = yes (string)
+
+ SIP 1.8:
+ |ACL = no (string)
+ |ChanObjectType = peer (string)
+ |Channeltype = SIP (string)
+ |Dynamic = yes (string)
+ |Event = PeerEntry (string)
+ |Forcerport = yes (string)
+ |IPaddress = -none- (string)
+ |IPport = 0 (string)
+ |ObjectName = 1002 (string)
+ |RealtimeDevice = no (string)
+ |Status = Unmonitored (string)
+ |TextSupport = no (string)
+ |VideoSupport = no (string)
+
+ */
SYNAPSE_REGISTER(ami_Event_PeerEntry)
{
serverMap[msg.dst].getDevicePtr(msg["Channeltype"].str()+"/"+msg["ObjectName"].str());
@@ -1202,6 +1252,21 @@ namespace asterisk
}
+ /*
+ 1.8:
+ |Alarm = No Alarm (string)
+ |Context = phones (string)
+ |DAHDIChannel = 1 (string)
+ |DND = Disabled (string)
+ |Event = DAHDIShowChannels (string)
+ |Signalling = FXO Kewlstart (string)
+ |SignallingCode = 4128 (string)
+ */
+ SYNAPSE_REGISTER(ami_Event_DAHDIShowChannels)
+ {
+
+ }
+
void channelStatus(Cmsg & msg)
{
CchannelPtr channelPtr=serverMap[msg.dst].getChannelPtr(msg["Uniqueid"]);
@@ -1296,7 +1361,22 @@ namespace asterisk
State: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
- Uniqueid: 1269871368.144*/
+ Uniqueid: 1269871368.144
+
+ 1.8 dahdi horn pickup:
+ |Account = (string)
+ |CallerIDName = <unknown> (string)
+ |CallerIDNum = <unknown> (string)
+ |Channel = DAHDI/1-1 (string)
+ |ConnectedLineName = <unknown> (string)
+ |ConnectedLineNum = <unknown> (string)
+ |Event = Status (string)
+ |Privilege = Call (string)
+ |State = Rsrvd (string)
+ |Uniqueid = 1352387005.54 (string)
+
+
+ */
channelStatus(msg);
}
@@ -1324,10 +1404,21 @@ namespace asterisk
// State: Up
// Link: SIP/604-00000046
// Uniqueid: 1269958018.98
-
+/*
+ 1.8 dahdi:
+ |Account = (string)
+ |CallerIDName = <unknown> (string)
+ |CallerIDNum = <unknown> (string)
+ |Channel = DAHDI/1-1 (string)
+ |ConnectedLineName = <unknown> (string)
+ |ConnectedLineNum = <unknown> (string)
+ |Event = Status (string)
+ |Privilege = Call (string)
+ |State = Rsrvd (string)
+ |Uniqueid = 1352387096.56 (string)
channelStatus(msg);
-
+*/
}
// channel status is changing
diff --git a/modules/docs/html/asterisk_8module_2module_8cpp.html b/modules/docs/html/asterisk_8module_2module_8cpp.html
index 80c3908..d9b1054 100644
--- a/modules/docs/html/asterisk_8module_2module_8cpp.html
+++ b/modules/docs/html/asterisk_8module_2module_8cpp.html
@@ -129,6 +129,8 @@ string&#160;</td><td class="memItemRight" valign="bottom"><b>asterisk::getDevice
&#160;</td><td class="memItemRight" valign="bottom"><b>asterisk::SYNAPSE_REGISTER</b> (asterisk_refresh)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7a10de3494ea0e1b1bbb2b0b2276ac38"></a><!-- doxytag: member="asterisk.module/module.cpp::SYNAPSE_REGISTER" ref="a7a10de3494ea0e1b1bbb2b0b2276ac38" args="(ami_Event_PeerEntry)" -->
&#160;</td><td class="memItemRight" valign="bottom"><b>asterisk::SYNAPSE_REGISTER</b> (ami_Event_PeerEntry)</td></tr>
+<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af916c61262b4ed62e5aa1b7a413a75c4"></a><!-- doxytag: member="asterisk.module/module.cpp::SYNAPSE_REGISTER" ref="af916c61262b4ed62e5aa1b7a413a75c4" args="(ami_Event_DAHDIShowChannels)" -->
+&#160;</td><td class="memItemRight" valign="bottom"><b>asterisk::SYNAPSE_REGISTER</b> (ami_Event_DAHDIShowChannels)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a135f5d9084ded0f3ab6093f4165e9897"></a><!-- doxytag: member="asterisk.module/module.cpp::channelStatus" ref="a135f5d9084ded0f3ab6093f4165e9897" args="(Cmsg &amp;msg)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>asterisk::channelStatus</b> (Cmsg &amp;msg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0396d20e8b04d1acb1e383b5432a0c5"></a><!-- doxytag: member="asterisk.module/module.cpp::SYNAPSE_REGISTER" ref="aa0396d20e8b04d1acb1e383b5432a0c5" args="(ami_Event_Newchannel)" -->