Hi,

I have a problem with nta_msg_tsend(), I get:
tport.c:3155: tport_tsend: Assertion `self' failed.
when I am trying to send the attached message with the attached code.

As I learned from the RFC, Responses have to be send to the
"From"-Address because response has to have the same "From"- and
"To"-Header as the request.

Why am I getting the error?
Is the URL ( sip:me...@127.0.0.1:5062) wrong?

Best Regards,

Markus
int process_igor_message( struct proxy *p, igor_message_t msg) {
        logit( LOG_DEBUG, "Parsing message");
        // Parse message
        msg_t *m = msg_make( sip_default_mclass(), 0, (void*)msg.data, 
msg.length);
        sip_t *sip = sip_object( m);

        char *recv_aor;
        if( sip->sip_request) { // Request -> Target = "To"
                char *a = url_as_string( p->home, sip->sip_to->a_url);
                recv_aor = (char*)malloc( (strlen(a)+1) * sizeof(char)); 
                strcpy( recv_aor, a);
                su_free( p->home, a);
        } else if( sip->sip_status) { // Response -> Target = "From"
                char *a = url_as_string( p->home, sip->sip_from->a_url);
                recv_aor = (char*)malloc( (strlen(a)+1) * sizeof(char)); 
                strcpy( recv_aor, a);
                su_free( p->home, a);
        } else {
                // Neither Request nor Response !?
                logit( LOG_ERR, "message is neither a request nor a response => 
discarding"); 
                return 1;
        }
        
// Normally I use recv_aor to look up the following address!
// I just cut the lookup code which sets recvr to make it easier to read.
        const char *recvr = "sip:me...@127.0.0.1:5062";
        
        // Forward message
        url_t *recv_url = url_make( p->home, recvr);
        nta_msg_tsend( p->agent,
                       m,
                       (url_string_t*)recv_url,
                       TAG_END());
        

        su_free( p->home, recv_url);
        
        return 0;
}
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 
localhost:5064;branch=z9hG4bK.BNXN46BDg7vtrKgg3tZ1UBKprB;received=127.0.0.1
Via: SIP/2.0/IGOR 3ad326ea83e06744319ec4711a0c025b74327d01
Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKbcbarpww
From: "me...@voigor" <sip:me...@voigor>;tag=kyghl
To: <sip:al...@voigor>;tag=4yrD6Fyyj4cNa
Call-ID: dqakactwpliq...@hal
CSeq: 346 INVITE
Contact: <sip:127.0.0.1:5066;transport=udp>
User-Agent: sofia-sip/1.12.10
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, 
REFER, UPDATE
Supported: timer, 100rel
Content-Length: 0


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to