Re: GSM_CancelCall not found
Paulo Roberto <[email protected]>
| Newsgroups | gmane.linux.drivers.gammu |
|---|---|
| Message-ID | <CA+96iqe_h7oLfZRe1F1ehsdHnUhs+GS54eJbE3CmPDv=WjiUzA@mail.gmail.com> |
Hello Guys,
I do need your help to solve this issue.
I made some progress since the last e-mail. I fetched the last source code
of gammu (commit: 70ab47136f12be6478b3892f43b913d2a23a3274), built it and
test it with my application.
I'm still unable to Cancel the calls but it is a totally different issue.
The *s->Phone.Functions* is initialized correctly and it's not *NULL*
anymore. And for the phone *Samsung GT-E2220* the *GSM_CancelCall*
registered function is *ATGEN_CancelCall*
The problem now is a stack overflow.
My *Incoming Call Callback* routine, calls *GSM_CancelCall* and this one
indirectly call back my *Incoming Call Callback* routine. A kind of a
recursive infinite loop.
The process continues until there is no space left on the stack and the OS
kills the process.
Inside my callback I do test the condition: *call->Status ==
GSM_CALL_IncomingCall (*Where call is the *GSM_Call* parameter received)
but for this situation is useless.
I'm able to avoid this problem by setting a static variable to control the
condition if it is a reentrant call. But it makes my routine not reentrant
anymore.
Besides that, this behavior is different from the Python implementation
where everything works as expected.
When the device receives the call, the read message from it is:
"+CLIP: \"099999999999\",129,\"\",,\"Promocoes Vivo\",0\r\nAT+CSQ\r\r"
Below, there is the stack backtrace of my application. I stopped it exactly
where my callback function calls the GSM_CancelCall for the second time.
#0 GSM_CancelCall (s=0x7ffff5e1d010, ID=0, all=1) at
git/gammu/gammu/libgammu/api.c:913
#1 0x00000000004014a0 in incoming_call_callback (sm=0x7ffff5e1d010,
call=0x7ffffffdd430, user_data=0x0) at intercom.c:68
#2 0x00007ffff73280c5 in ATGEN_ReplyIncomingCallInfo (msg=0x7ffffffdd680,
s=0x7ffff5e1d010)
at git/gammu/gammu/libgammu/phone/at/atgen.c:5327
#3 0x00007ffff72db958 in GSM_DispatchMessage (s=s@entry=0x7ffff5e1d010) at
git/gammu/gammu/libgammu/gsmstate.c:1161
#4 0x00007ffff7325337 in ATGEN_DispatchMessage (s=0x7ffff5e1d010) at
git/gammu/gammu/libgammu/phone/at/atgen.c:1563
#5 0x00007ffff73198b5 in AT_StateMachine (s=0x7ffff5e1d010,
rx_char=<optimized out>)
at git/gammu/gammu/libgammu/protocol/at/at.c:226
#6 0x00007ffff72daa69 in GSM_ReadDevice (s=s@entry=0x7ffff5e1d010,
waitforreply=waitforreply@entry=1)
at git/gammu/gammu/libgammu/gsmstate.c:951
#7 0x00007ffff72dabaf in GSM_WaitForOnce (s=s@entry=0x7ffff5e1d010,
buffer=buffer@entry=0x7ffff73b38ac "ATH\r", length=length@entry=4,
type=type@entry=0,
timeout=timeout@entry=40) at git/gammu/gammu/libgammu/gsmstate.c:1010
#8 0x00007ffff72dad22 in GSM_WaitFor (s=s@entry=0x7ffff5e1d010,
buffer=buffer@entry=0x7ffff73b38ac "ATH\r", length=length@entry=4,
type=type@entry=0,
timeout=timeout@entry=40, request=request@entry=ID_CancelCall) at
git/gammu/gammu/libgammu/gsmstate.c:1070
#9 0x00007ffff731e64b in ATGEN_WaitFor (s=s@entry=0x7ffff5e1d010,
cmd=cmd@entry=0x7ffff73b38ac "ATH\r", len=len@entry=4, type=type@entry=0,
timeout=timeout@entry=40, request=request@entry=ID_CancelCall) at
git/gammu/gammu/libgammu/phone/at/atgen.c:429
#10 0x00007ffff731f053 in ATGEN_CancelCall (s=0x7ffff5e1d010, ID=<optimized
out>, all=<optimized out>)
at git/gammu/gammu/libgammu/phone/at/atgen.c:4650
#11 0x00007ffff72de13d in GSM_CancelCall (s=0x7ffff5e1d010, ID=0, all=1) at
git/gammu/gammu/libgammu/api.c:915
#12 0x00000000004014a0 in incoming_call_callback (sm=0x7ffff5e1d010,
call=0x7ffffffed9d0, user_data=0x0) at intercom.c:68
#13 0x00007ffff73280c5 in ATGEN_ReplyIncomingCallInfo (msg=0x7ffffffedc20,
s=0x7ffff5e1d010)
at git/gammu/gammu/libgammu/phone/at/atgen.c:5327
#14 0x00007ffff72db958 in GSM_DispatchMessage (s=s@entry=0x7ffff5e1d010) at
git/gammu/gammu/libgammu/gsmstate.c:1161
#15 0x00007ffff7325337 in ATGEN_DispatchMessage (s=0x7ffff5e1d010) at
git/gammu/gammu/libgammu/phone/at/atgen.c:1563
#16 0x00007ffff73198b5 in AT_StateMachine (s=0x7ffff5e1d010,
rx_char=<optimized out>)
at git/gammu/gammu/libgammu/protocol/at/at.c:226
#17 0x00007ffff72daa69 in GSM_ReadDevice (s=s@entry=0x7ffff5e1d010,
waitforreply=waitforreply@entry=1)
at git/gammu/gammu/libgammu/gsmstate.c:951
#18 0x00007ffff72dabaf in GSM_WaitForOnce (s=s@entry=0x7ffff5e1d010,
buffer=buffer@entry=0x7ffff73b3a3e "AT+CSQ\r", length=length@entry=7,
type=type@entry=0, timeout=timeout@entry=20) at
git/gammu/gammu/libgammu/gsmstate.c:1010
#19 0x00007ffff72dad22 in GSM_WaitFor (s=s@entry=0x7ffff5e1d010,
buffer=buffer@entry=0x7ffff73b3a3e "AT+CSQ\r", length=length@entry=7,
type=type@entry=0,
timeout=timeout@entry=20, request=request@entry=ID_GetSignalQuality) at
git/gammu/gammu/libgammu/gsmstate.c:1070
#20 0x00007ffff731e64b in ATGEN_WaitFor (s=s@entry=0x7ffff5e1d010,
cmd=cmd@entry=0x7ffff73b3a3e "AT+CSQ\r", len=len@entry=7, type=type@entry=0,
timeout=timeout@entry=20, request=request@entry=ID_GetSignalQuality) at
git/gammu/gammu/libgammu/phone/at/atgen.c:429
#21 0x00007ffff731f8a0 in ATGEN_GetSignalQuality (s=0x7ffff5e1d010,
sig=<optimized out>)
at git/gammu/gammu/libgammu/phone/at/atgen.c:5583
#22 0x00007ffff72dcb53 in GSM_GetSignalQuality (s=0x7ffff5e1d010,
sig=0x7fffffffe050) at git/gammu/gammu/libgammu/api.c:457
#23 0x00000000004018ba in main (argc=1, argv=0x7fffffffe158) at
intercom.c:227
Thanks in advance and I kindly ask for your help.
Best Regards.
Paulo Roberto Brandão.
------------------------------------------------------------------------------
_______________________________________________
Gammu-users mailing list - https://lists.sourceforge.net/lists/listinfo/gammu-users