Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call method for python #87

Open
IPB-DevOps opened this issue Aug 16, 2022 · 3 comments
Open

call method for python #87

IPB-DevOps opened this issue Aug 16, 2022 · 3 comments

Comments

@IPB-DevOps
Copy link

Is it posible to implement call functionality for python api?
This would be a big improvement for self developped sms gateways.

Kind regards,
Thomas

@nijel
Copy link
Member

nijel commented Aug 17, 2022

It is already implemented:

python-gammu/gammu/src/gammu.c

Lines 3024 to 3072 in 6067cf1

/*************/
/* DialVoice */
/*************/
static char StateMachine_DialVoice__doc__[] =
"DialVoice(Number, ShowNumber)\n\n"
"Dials number and starts voice call.\n"
"@param Number: Number to dial\n"
"@type Number: string\n"
"@param ShowNumber: Identifies whether to enable CLIR (None = keep default phone settings). Default is None\n"
"@type ShowNumber: boolean or None\n"
"@return: None\n"
"@rtype: None\n"
;
static PyObject *
StateMachine_DialVoice(StateMachineObject *self, PyObject *args, PyObject *kwds) {
GSM_Error error;
static char *kwlist[] = {"Number", "ShowNumber", NULL};
char *s;
PyObject *o = Py_None;
GSM_CallShowNumber ShowNumber = GSM_CALL_DefaultNumberPresence;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|O", kwlist,
&s, &o))
return NULL;
if (o != Py_None) {
switch (BoolFromPython(o, "ShowNumber")) {
case BOOL_INVALID:
return NULL;
case TRUE:
ShowNumber = GSM_CALL_ShowNumber;
break;
case FALSE:
ShowNumber = GSM_CALL_HideNumber;
break;
}
}
BEGIN_PHONE_COMM
error = GSM_DialVoice(self->s, s, ShowNumber);
END_PHONE_COMM
if (!checkError(error, "DialVoice")) return NULL;
Py_RETURN_NONE;
}

@IPB-DevOps
Copy link
Author

IPB-DevOps commented Aug 18, 2022

You are right, I mean call function for a running smsd.
Far as I know, you can only dial a call if the phone / sim has not an allready running daemon with it.
In theory you have to stop daemon, make the call and start daemon again right?

Thank you for your fast response

@nijel
Copy link
Member

nijel commented Aug 18, 2022

Yes, that's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants