| Reply | « Previous Thread | Next Thread » |
|
I'm struggling with my extension so I may need some help.
The goal for the extension is to print the ID (number) of a Caller in python on Nokia 6630 and 6680. The problem from my point of view is that it's not possible to get the caller number from the etel api in S60 2nd FP2 sdk, so you need to use 3rd party etelmm.h and etelmm.lib from another sdk. Do you need to install these files on the phone as well or are they only needed to compile? The C++ code below is mainly something that I found on the net, since I'm a beginner. The code compiles fine but when I try to run the extionsion on the phone by CallerId.GetId() python crashs. This happens both while the phone is receiving a call and in idle mode. What is wrong and is it possible to get the Caller number like this? Please help me. /Anders Code:
#include "Python.h"
#include "symbian_python_ext_util.h"
#include <etelmm.h>
/*
* Get caller ID
*/
extern "C" PyObject *
CallerId(PyObject* /*self*/)
{
TBuf<20> callNum;
RMobileCall m_currentCall;
RMobileCall::TMobileCallInfoV1 callInfo;
RMobileCall::TMobileCallInfoV1Pckg callInfoPckg(callInfo);
m_currentCall.GetMobileCallInfo(callInfoPckg);
callNum=callInfo.iRemoteParty.iRemoteNumber.iTelNumber;
return Py_BuildValue("(i)",callNum);
}
///////////////////////////////////////////
//// PYTHON INTEGRATION CODE //////////////
///////////////////////////////////////////
extern "C" {
static const PyMethodDef CallerId_methods[] = {
{"GetId", (PyCFunction)CallerId, METH_NOARGS, NULL},
{NULL, NULL} /* sentinel */
};
DL_EXPORT(void) initsysinfo(void)
{
PyObject *m;
m = Py_InitModule("Id", (PyMethodDef*)CallerId_methods);
}
} /* extern "C" */
GLDEF_C TInt E32Dll(TDllReason)
{
return KErrNone;
}
and the mmp file
TARGETTYPE dll
TARGET CallerId.pyd
TARGETPATH \system\libs
SYSTEMINCLUDE \epoc32\include
SYSTEMINCLUDE \epoc32\include\libc
userinclude ..\..\core\Symbian
userinclude ..\..\core\Include
userinclude ..\..\core\Python
USERINCLUDE .
LIBRARY python222.lib
LIBRARY euser.lib
LIBRARY etelmm.lib
SOURCE CallerId.cpp
|
| agrauballe |
| View Public Profile |
| Find all posts by agrauballe |
|
Try this:
Code:
return Py_BuildValue("u#", callInfo.iRemoteParty.iRemoteNumber.iTelNumber.Ptr(), callInfo.iRemoteParty.iRemoteNumber.iTelNumber.Length());
|
| simo.salminen |
| View Public Profile |
| Find all posts by simo.salminen |
|
So did it worked?
Have we got a python module for 2nd edition which provides caller id? |
|
Quote:
May be you could use the logs module that comes with Pys60. Best Regards, Croozeus |
|
Quote:
In the first case, they could be used to determine caller id or current call, else they could be useful only for statistical purposes... |
|
Did you succeed? I would love to have a callerid module in python (or J2ME). Are there any solutions to this yet? Sorry for bumping this old thread, but I can't find anything to solve my problem without coding native C++. Any help is appreciated!
|
|
Never mind, I found it!
when registered via telephone.call_state(handle_call), handlecall now receives two arguments, the second being the calling number. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Recording in Amr Format | losym | Symbian Media (Graphics & Sounds) | 12 | 2009-03-26 07:41 |
| WAP extension for Dreamweaver | RichardGalbraith | General Browsing | 2 | 2009-01-13 04:21 |
| CIMD default alphabet extension table | misbelief | General Messaging | 0 | 2006-02-06 00:58 |
| Problem with Phone call Extension dialing | awasthi_vivek | Symbian Networking & Messaging | 0 | 2004-03-06 10:07 |
| Nokia 22 problem with incoming calls with extension mode B | meross | PC Suite API and PC Connectivity SDK | 1 | 2002-10-11 10:32 |