JiaNemo / idoubs

Automatically exported from code.google.com/p/idoubs
0 stars 0 forks source link

How to read SIP header which is coming from server after successfully registration? #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Sir,
         I am newbie for SIP and calling functionality. I am working on a application by using iDoubs, here i need to read SIP header after successful registration in application. Server is sending balance and some other useful information by using their header and here i need to read that header and show that values somewhere in application.

Original issue reported on code.google.com by haq.fai...@gmail.com on 3 Aug 2012 at 11:07

GoogleCodeExporter commented 9 years ago
Use functions (getSipHeader() / getSipHeaderValue()) from C++ class 
'SipMessage'.
An example: 
http://code.google.com/p/idoubs/source/browse/branches/2.0/common-ngn-stack/serv
ices/impl/NgnSipService.mm#703
Successful registration is reported at: 
http://code.google.com/p/idoubs/source/browse/branches/2.0/common-ngn-stack/serv
ices/impl/NgnSipService.mm#167

Original comment by boss...@yahoo.fr on 3 Aug 2012 at 1:10

GoogleCodeExporter commented 9 years ago
Issue 115 has been merged into this issue.

Original comment by boss...@yahoo.fr on 3 Aug 2012 at 1:10

GoogleCodeExporter commented 9 years ago
Hi,
    Thanks to quick reply, that i have already tried like this

const SipMessage* _message = _e->getSipMessage();

                    char* _ctype = const_cast<SipMessage*>(_message)->
getSipHeaderValue("c");

                    NSLog(@"_ctype on NgnSipService Page - %s",_ctype);

                    char* via = const_cast<SipMessage*>(_message)->
getSipHeaderValue("v");

                    NSLog(@"via on NgnSipService Page - %s",via);

                    char* _from = const_cast<SipMessage*>(_message)->
getSipHeaderValue("f");

                    NSLog(@"_from on NgnSipService Page - %s",_from);

                    char* to = const_cast<SipMessage*>(_message)->
getSipHeaderValue("t");

                    NSLog(@"to on NgnSipService Page - %s",to);

                    char* contact = const_cast<SipMessage*>(_message)->
getSipHeaderValue("m");

                    NSLog(@"contact on NgnSipService Page - %s",contact);

                    char* caller_id = const_cast<SipMessage*>(_message)->
getSipHeaderValue("i");

                    NSLog(@"caller_id on NgnSipService Page - %s"
,caller_id);

                    char* cseq = const_cast<SipMessage*>(_message)->
getSipHeaderValue("cseq");

                    NSLog(@"cseq on NgnSipService Page - %s",cseq);

                    char* expires = const_cast<SipMessage*>(_message)->
getSipHeaderValue("expires");

                    NSLog(@"expires on NgnSipService Page - %s",expires);

                    char* content_length = const_cast<SipMessage
*>(_message)->getSipHeaderValue("l");

                    NSLog(@"content_length on NgnSipService Page - %s"
,content_length);

                    char* _ctransfer_encoding = const_cast<SipMessage
*>(_message)->getSipHeaderValue("content-transfer-encoding");

                    NSLog(@"_ctransfer_encoding on NgnSipService Page - %s"
,_ctransfer_encoding);
*But i am getting null on every value*

*2012-08-03 23:25:51.194 BossRev[666:15f07] defaultIdentity on
NgnSipService Page - sip:447740927930@66.33.146.12*

*2012-08-03 23:25:51.195 BossRev[666:15f07] _ctype on NgnSipService Page -
(null)*

*2012-08-03 23:25:51.195 BossRev[666:15f07] via on NgnSipService Page -
(null)*

*2012-08-03 23:25:51.196 BossRev[666:15f07] _from on NgnSipService Page -
(null)*

*2012-08-03 23:25:51.196 BossRev[666:15f07] to on NgnSipService Page -
(null)*

*2012-08-03 23:25:51.196 BossRev[666:15f07] contact on NgnSipService Page -
(null)*

*2012-08-03 23:25:51.197 BossRev[666:15f07] caller_id on NgnSipService Page
- (null)*

*2012-08-03 23:25:51.197 BossRev[666:15f07] cseq on NgnSipService Page -
(null)*

*2012-08-03 23:25:51.197 BossRev[666:15f07] expires on NgnSipService Page -
(null)*

*2012-08-03 23:25:51.197 BossRev[666:15f07] content_length on NgnSipService
Page - (null)*

*2012-08-03 23:25:51.197 BossRev[666:15f07] _ctransfer_encoding on
NgnSipService Page - (null)*

*2012-08-03 23:25:51.198 BossRev[666:15f07] getHeaderVal on NgnSipService
Page - (null)*
*Does here i am missing something, please suggest me.*

Original comment by haq.fai...@gmail.com on 3 Aug 2012 at 6:10

GoogleCodeExporter commented 9 years ago
Hi, 
    please help me , I m waiting for reply , any help wil be appreciable

thanks

Original comment by haq.fai...@gmail.com on 5 Aug 2012 at 2:41

GoogleCodeExporter commented 9 years ago
Issue 118 has been merged into this issue.

Original comment by boss...@yahoo.fr on 7 Aug 2012 at 4:32