mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-20 13:43:12 +00:00
monitor call/hangup/pickup commands now work.
This commit is contained in:
parent
91d875d70a
commit
175a079c0c
15
monitor.c
15
monitor.c
@ -325,6 +325,8 @@ int monitor_process_command(int index,char *cmd)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char msg[1024];
|
||||||
|
|
||||||
if (sscanf(cmd,"AUDIO:%x:%d:%d",
|
if (sscanf(cmd,"AUDIO:%x:%d:%d",
|
||||||
&callSessionToken,&sampleType,&bytes)==3)
|
&callSessionToken,&sampleType,&bytes)==3)
|
||||||
{
|
{
|
||||||
@ -346,10 +348,20 @@ int monitor_process_command(int index,char *cmd)
|
|||||||
c->flags&=~MONITOR_RHIZOME;
|
c->flags&=~MONITOR_RHIZOME;
|
||||||
else if (sscanf(cmd,"call %s %s %s",sid,localDid,remoteDid)==3) {
|
else if (sscanf(cmd,"call %s %s %s",sid,localDid,remoteDid)==3) {
|
||||||
mdp.vompevent.flags=VOMPEVENT_DIAL;
|
mdp.vompevent.flags=VOMPEVENT_DIAL;
|
||||||
if (overlay_mdp_getmyaddr(0,&mdp.vompevent.local_sid[0])) return -1;
|
int cn=0,in=0,kp=0;
|
||||||
|
if(!keyring_next_identity(keyring,&cn,&in,&kp))
|
||||||
|
{
|
||||||
|
snprintf(msg,1024,"ERROR:no local identity, so cannot place call\n");
|
||||||
|
write(c->socket,msg,strlen(msg));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bcopy(keyring->contexts[cn]->identities[in]
|
||||||
|
->keypairs[kp]->public_key,
|
||||||
|
&mdp.vompevent.local_sid[0],SID_SIZE);
|
||||||
stowSid(&mdp.vompevent.remote_sid[0],0,sid);
|
stowSid(&mdp.vompevent.remote_sid[0],0,sid);
|
||||||
vomp_mdp_event(&mdp,NULL,0);
|
vomp_mdp_event(&mdp,NULL,0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (sscanf(cmd,"pickup %x",&callSessionToken)==1) {
|
else if (sscanf(cmd,"pickup %x",&callSessionToken)==1) {
|
||||||
mdp.vompevent.flags=VOMPEVENT_PICKUP;
|
mdp.vompevent.flags=VOMPEVENT_PICKUP;
|
||||||
mdp.vompevent.call_session_token=callSessionToken;
|
mdp.vompevent.call_session_token=callSessionToken;
|
||||||
@ -364,7 +376,6 @@ int monitor_process_command(int index,char *cmd)
|
|||||||
fcntl(c->socket,F_SETFL,
|
fcntl(c->socket,F_SETFL,
|
||||||
fcntl(c->socket, F_GETFL, NULL)|O_NONBLOCK);
|
fcntl(c->socket, F_GETFL, NULL)|O_NONBLOCK);
|
||||||
|
|
||||||
char msg[1024];
|
|
||||||
snprintf(msg,1024,"MONITORSTATUS:%d\n",c->flags);
|
snprintf(msg,1024,"MONITORSTATUS:%d\n",c->flags);
|
||||||
write(c->socket,msg,strlen(msg));
|
write(c->socket,msg,strlen(msg));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user