You Are Here:

Community: Developer Discussion Boards

#1 Old Help with CallerID extension - 2006-03-21, 22:52

Join Date: Feb 2006
Posts: 8
agrauballe
Offline
Registered User
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
Reply With Quote

#2 Old Re: Help with CallerID extension - 2006-03-22, 20:29

Join Date: Aug 2004
Posts: 290
simo.salminen
Offline
Regular Contributor
Try this:
Code:
return Py_BuildValue("u#", callInfo.iRemoteParty.iRemoteNumber.iTelNumber.Ptr(), callInfo.iRemoteParty.iRemoteNumber.iTelNumber.Length());
I suggest then setting up a logger, and go through line by line. Example how to setup logger can be found in this example: http://pymbian.sourceforge.net/misc/...0.20051019.zip. Remember to create c:\logs\<your_debug_dir> to phone.
Reply With Quote

#3 Old Re: Help with CallerID extension - 2008-05-13, 10:21

Join Date: Mar 2003
Posts: 564
cassioli's Avatar
cassioli
Offline
Super Contributor
So did it worked?
Have we got a python module for 2nd edition which provides caller id?
Reply With Quote

#4 Old Re: Help with CallerID extension - 2008-05-13, 19:28

Join Date: May 2007
Posts: 2,737
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by cassioli View Post
So did it worked?
Have we got a python module for 2nd edition which provides caller id?
I don't think we have it as yet!
May be you could use the logs module that comes with Pys60.

Best Regards,
Croozeus
Reply With Quote

#5 Old Re: Help with CallerID extension - 2008-05-14, 08:17

Join Date: Mar 2003
Posts: 564
cassioli's Avatar
cassioli
Offline
Super Contributor
Quote:
Originally Posted by croozeus View Post
I don't think we have it as yet!
May be you could use the logs module that comes with Pys60.

Best Regards,
Croozeus
are the logs updated as soon as the phone starts ringing, or only after the call is closed?
In the first case, they could be used to determine caller id or current call, else they could be useful only for statistical purposes...
Reply With Quote

#6 Old Re: Help with CallerID extension - 2009-06-19, 20:23

Join Date: Jun 2009
Posts: 4
unbehagen
Offline
Registered User
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!
Reply With Quote

#7 Old Re: Help with CallerID extension - 2009-06-20, 01:54

Join Date: Jun 2009
Posts: 4
unbehagen
Offline
Registered User
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ