
| Key: |
XCL-132
|
| Type: |
New Feature
|
| Status: |
Open
|
| Priority: |
Minor
|
| Assignee: |
Unassigned
|
| Reporter: |
Jaroslav Libak
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
|
| Component/s: |
sipXtapi
|
| Affects Version/s: |
None
|
| Fix Version/s: |
None
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
File Attachments:
|
1.
pimclientpatch.zip (4 kb)
|
|
Environment:
|
sipxtapi branch
|
|
|
I don't like bad solutions of using internal functions/classes of
libraries so I decided to integrate sippimclient into sipxtapi. It
basically creates an instance in sipxtapi initialization, starts the
OsServerTask, registers a new event handler which is defined in
sipxtapievents.cpp. You dont need to register any new event handlers, it
works with the standard sipxtapi event handler. I have added code for
printing event, duplicating, freeing event. There is new event category
- EVENT_CATEGORY_PIM, which has its specific event data. All event data
is only basic C datatypes, no UtlString or anything like that. The event
data contains event enum, which is currently only PIM_INCOMING_MESSAGE.
There is SIPX_PIM_INFO struct, which contains the message details.
During sipxuninitialize, the OsServerTask of sippimclient is shutdown
and deleted. I have modified SipPimClient a little bit so it also
removes message observer from SipUserAgent in destructor, and limited
the number of iterations in internal loop of sendPagerMessage to 2. It's
not right to have infinite loops in any function.
To send a message you call new function in sipxtapi -
sipxPIMSendPagerMessage. The presentityAor of SipPimClient is set to
szIdentity parameter of sipxInitialize.
I also found a memory leak in sipxtapievents.cpp - in
sipxFireKeepaliveEvent memory after strdup is not freed. It has to be
freed there, the callback function (which is always only 1 -
SipXEventDispatcher) just makes a copy and frees its own copy.
This is also fixed in this patch.
|
|
Description
|
I don't like bad solutions of using internal functions/classes of
libraries so I decided to integrate sippimclient into sipxtapi. It
basically creates an instance in sipxtapi initialization, starts the
OsServerTask, registers a new event handler which is defined in
sipxtapievents.cpp. You dont need to register any new event handlers, it
works with the standard sipxtapi event handler. I have added code for
printing event, duplicating, freeing event. There is new event category
- EVENT_CATEGORY_PIM, which has its specific event data. All event data
is only basic C datatypes, no UtlString or anything like that. The event
data contains event enum, which is currently only PIM_INCOMING_MESSAGE.
There is SIPX_PIM_INFO struct, which contains the message details.
During sipxuninitialize, the OsServerTask of sippimclient is shutdown
and deleted. I have modified SipPimClient a little bit so it also
removes message observer from SipUserAgent in destructor, and limited
the number of iterations in internal loop of sendPagerMessage to 2. It's
not right to have infinite loops in any function.
To send a message you call new function in sipxtapi -
sipxPIMSendPagerMessage. The presentityAor of SipPimClient is set to
szIdentity parameter of sipxInitialize.
I also found a memory leak in sipxtapievents.cpp - in
sipxFireKeepaliveEvent memory after strdup is not freed. It has to be
freed there, the callback function (which is always only 1 -
SipXEventDispatcher) just makes a copy and frees its own copy.
This is also fixed in this patch. |
Show » |
| There are no comments yet on this issue.
|
|