X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=sip.cpp;h=20e4ecebf523f2552fa3343f66d9144ebe3102b4;hp=e39f19c2a05c5e612e8b8e83edb8122f16828514;hb=1e778230b935453d1183d8a457438221030dd5ee;hpb=5463e1b62a39ce417b610584e3d34a8bc30ac15e diff --git a/sip.cpp b/sip.cpp index e39f19c..20e4ece 100644 --- a/sip.cpp +++ b/sip.cpp @@ -868,6 +868,7 @@ int Psip::message_setup(unsigned int epoint_id, int message_id, union parameter PDEBUG(DEBUG_SIP, "remote ip %08x port %d\n", p_s_rtp_ip_remote, p_s_rtp_port_remote); } else { PDEBUG(DEBUG_SIP, "RTP info not given by remote, so we do our own RTP\n"); + p_s_rtp_bridge = 0; p_s_rtp_payload_type = (options.law=='a') ? RTP_PT_ALAW : RTP_PT_ULAW; /* open local RTP peer (if not bridging) */ @@ -1027,17 +1028,9 @@ int Psip::message_dtmf(unsigned int epoint_id, int message_id, union parameter * int Psip::message_epoint(unsigned int epoint_id, int message_id, union parameter *param) { - class Endpoint *epoint; - if (Port::message_epoint(epoint_id, message_id, param)) return 1; - epoint = find_epoint_id(epoint_id); - if (!epoint) { - PDEBUG(DEBUG_SIP, "PORT(%s) no endpoint object found where the message is from.\n", p_name); - return 0; - } - switch(message_id) { case MESSAGE_ALERTING: /* call is ringing on LCR side */ if (p_state != PORT_STATE_IN_SETUP @@ -1168,6 +1161,13 @@ void Psip::i_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag class Endpoint *epoint; struct lcr_msg *message; uint8_t payload_type; + struct interface *interface; + + interface = getinterfacebyname(inst->interface_name); + if (!interface) { + PERROR("Cannot find interface %s.\n", inst->interface_name); + return; + } if (sip->sip_from && sip->sip_from->a_url) from = sip->sip_from->a_url->url_user; @@ -1258,8 +1258,7 @@ void Psip::i_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag FATAL("Incoming call but already got an endpoint.\n"); if (!(epoint = new Endpoint(p_serial, 0))) FATAL("No memory for Endpoint instance\n"); - if (!(epoint->ep_app = new DEFAULT_ENDPOINT_APP(epoint, 0))) //incoming - FATAL("No memory for Endpoint Application instance\n"); + epoint->ep_app = new_endpointapp(epoint, 0, interface->app); //incoming epointlist_new(epoint->ep_serial); /* send trying (proceeding) */